UNPKG

@routerprotocol/chain-api

Version:

Router Chain API Query client with generated gRPC bindings.

521 lines (450 loc) 15.6 kB
// source: cosmos/base/query/v1beta1/pagination.proto /** * @fileoverview * @enhanceable * @suppress {missingRequire} reports error on implicit type usages. * @suppress {messageConventions} JS Compiler reports an error if a variable or * field starts with 'MSG_' and isn't a translatable message. * @public */ // GENERATED CODE -- DO NOT EDIT! /* eslint-disable */ // @ts-nocheck var jspb = require('google-protobuf'); var goog = jspb; var global = Function('return this')(); goog.exportSymbol('proto.cosmos.base.query.v1beta1.PageRequest', null, global); goog.exportSymbol('proto.cosmos.base.query.v1beta1.PageResponse', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.cosmos.base.query.v1beta1.PageRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.cosmos.base.query.v1beta1.PageRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.cosmos.base.query.v1beta1.PageRequest.displayName = 'proto.cosmos.base.query.v1beta1.PageRequest'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.cosmos.base.query.v1beta1.PageResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.cosmos.base.query.v1beta1.PageResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.cosmos.base.query.v1beta1.PageResponse.displayName = 'proto.cosmos.base.query.v1beta1.PageResponse'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.cosmos.base.query.v1beta1.PageRequest.prototype.toObject = function(opt_includeInstance) { return proto.cosmos.base.query.v1beta1.PageRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.cosmos.base.query.v1beta1.PageRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.cosmos.base.query.v1beta1.PageRequest.toObject = function(includeInstance, msg) { var f, obj = { key: msg.getKey_asB64(), offset: jspb.Message.getFieldWithDefault(msg, 2, 0), limit: jspb.Message.getFieldWithDefault(msg, 3, 0), countTotal: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), reverse: jspb.Message.getBooleanFieldWithDefault(msg, 5, false) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.cosmos.base.query.v1beta1.PageRequest} */ proto.cosmos.base.query.v1beta1.PageRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.cosmos.base.query.v1beta1.PageRequest; return proto.cosmos.base.query.v1beta1.PageRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.cosmos.base.query.v1beta1.PageRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.cosmos.base.query.v1beta1.PageRequest} */ proto.cosmos.base.query.v1beta1.PageRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setKey(value); break; case 2: var value = /** @type {number} */ (reader.readUint64()); msg.setOffset(value); break; case 3: var value = /** @type {number} */ (reader.readUint64()); msg.setLimit(value); break; case 4: var value = /** @type {boolean} */ (reader.readBool()); msg.setCountTotal(value); break; case 5: var value = /** @type {boolean} */ (reader.readBool()); msg.setReverse(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.cosmos.base.query.v1beta1.PageRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.cosmos.base.query.v1beta1.PageRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.cosmos.base.query.v1beta1.PageRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.cosmos.base.query.v1beta1.PageRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getKey_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getOffset(); if (f !== 0) { writer.writeUint64( 2, f ); } f = message.getLimit(); if (f !== 0) { writer.writeUint64( 3, f ); } f = message.getCountTotal(); if (f) { writer.writeBool( 4, f ); } f = message.getReverse(); if (f) { writer.writeBool( 5, f ); } }; /** * optional bytes key = 1; * @return {!(string|Uint8Array)} */ proto.cosmos.base.query.v1beta1.PageRequest.prototype.getKey = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes key = 1; * This is a type-conversion wrapper around `getKey()` * @return {string} */ proto.cosmos.base.query.v1beta1.PageRequest.prototype.getKey_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getKey())); }; /** * optional bytes key = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getKey()` * @return {!Uint8Array} */ proto.cosmos.base.query.v1beta1.PageRequest.prototype.getKey_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getKey())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.cosmos.base.query.v1beta1.PageRequest} returns this */ proto.cosmos.base.query.v1beta1.PageRequest.prototype.setKey = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional uint64 offset = 2; * @return {number} */ proto.cosmos.base.query.v1beta1.PageRequest.prototype.getOffset = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value * @return {!proto.cosmos.base.query.v1beta1.PageRequest} returns this */ proto.cosmos.base.query.v1beta1.PageRequest.prototype.setOffset = function(value) { return jspb.Message.setProto3IntField(this, 2, value); }; /** * optional uint64 limit = 3; * @return {number} */ proto.cosmos.base.query.v1beta1.PageRequest.prototype.getLimit = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {number} value * @return {!proto.cosmos.base.query.v1beta1.PageRequest} returns this */ proto.cosmos.base.query.v1beta1.PageRequest.prototype.setLimit = function(value) { return jspb.Message.setProto3IntField(this, 3, value); }; /** * optional bool count_total = 4; * @return {boolean} */ proto.cosmos.base.query.v1beta1.PageRequest.prototype.getCountTotal = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); }; /** * @param {boolean} value * @return {!proto.cosmos.base.query.v1beta1.PageRequest} returns this */ proto.cosmos.base.query.v1beta1.PageRequest.prototype.setCountTotal = function(value) { return jspb.Message.setProto3BooleanField(this, 4, value); }; /** * optional bool reverse = 5; * @return {boolean} */ proto.cosmos.base.query.v1beta1.PageRequest.prototype.getReverse = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); }; /** * @param {boolean} value * @return {!proto.cosmos.base.query.v1beta1.PageRequest} returns this */ proto.cosmos.base.query.v1beta1.PageRequest.prototype.setReverse = function(value) { return jspb.Message.setProto3BooleanField(this, 5, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.cosmos.base.query.v1beta1.PageResponse.prototype.toObject = function(opt_includeInstance) { return proto.cosmos.base.query.v1beta1.PageResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.cosmos.base.query.v1beta1.PageResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.cosmos.base.query.v1beta1.PageResponse.toObject = function(includeInstance, msg) { var f, obj = { nextKey: msg.getNextKey_asB64(), total: jspb.Message.getFieldWithDefault(msg, 2, 0) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.cosmos.base.query.v1beta1.PageResponse} */ proto.cosmos.base.query.v1beta1.PageResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.cosmos.base.query.v1beta1.PageResponse; return proto.cosmos.base.query.v1beta1.PageResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.cosmos.base.query.v1beta1.PageResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.cosmos.base.query.v1beta1.PageResponse} */ proto.cosmos.base.query.v1beta1.PageResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setNextKey(value); break; case 2: var value = /** @type {number} */ (reader.readUint64()); msg.setTotal(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.cosmos.base.query.v1beta1.PageResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.cosmos.base.query.v1beta1.PageResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.cosmos.base.query.v1beta1.PageResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.cosmos.base.query.v1beta1.PageResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getNextKey_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getTotal(); if (f !== 0) { writer.writeUint64( 2, f ); } }; /** * optional bytes next_key = 1; * @return {!(string|Uint8Array)} */ proto.cosmos.base.query.v1beta1.PageResponse.prototype.getNextKey = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes next_key = 1; * This is a type-conversion wrapper around `getNextKey()` * @return {string} */ proto.cosmos.base.query.v1beta1.PageResponse.prototype.getNextKey_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getNextKey())); }; /** * optional bytes next_key = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getNextKey()` * @return {!Uint8Array} */ proto.cosmos.base.query.v1beta1.PageResponse.prototype.getNextKey_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getNextKey())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.cosmos.base.query.v1beta1.PageResponse} returns this */ proto.cosmos.base.query.v1beta1.PageResponse.prototype.setNextKey = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional uint64 total = 2; * @return {number} */ proto.cosmos.base.query.v1beta1.PageResponse.prototype.getTotal = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value * @return {!proto.cosmos.base.query.v1beta1.PageResponse} returns this */ proto.cosmos.base.query.v1beta1.PageResponse.prototype.setTotal = function(value) { return jspb.Message.setProto3IntField(this, 2, value); }; goog.object.extend(exports, proto.cosmos.base.query.v1beta1);