@bandprotocol/bandchain.js
Version:
Library for interacting with BandChain in browser and Node.js environments
734 lines (686 loc) • 22 kB
JavaScript
// source: ibc/core/channel/v1/upgrade.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')()
var gogoproto_gogo_pb = require('../../../../gogoproto/gogo_pb.js')
goog.object.extend(proto, gogoproto_gogo_pb)
var ibc_core_channel_v1_channel_pb = require('../../../../ibc/core/channel/v1/channel_pb.js')
goog.object.extend(proto, ibc_core_channel_v1_channel_pb)
goog.exportSymbol('proto.ibc.core.channel.v1.ErrorReceipt', null, global)
goog.exportSymbol('proto.ibc.core.channel.v1.Upgrade', null, global)
goog.exportSymbol('proto.ibc.core.channel.v1.UpgradeFields', 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.ibc.core.channel.v1.Upgrade = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null)
}
goog.inherits(proto.ibc.core.channel.v1.Upgrade, jspb.Message)
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.ibc.core.channel.v1.Upgrade.displayName =
'proto.ibc.core.channel.v1.Upgrade'
}
/**
* 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.ibc.core.channel.v1.UpgradeFields = function (opt_data) {
jspb.Message.initialize(
this,
opt_data,
0,
-1,
proto.ibc.core.channel.v1.UpgradeFields.repeatedFields_,
null,
)
}
goog.inherits(proto.ibc.core.channel.v1.UpgradeFields, jspb.Message)
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.ibc.core.channel.v1.UpgradeFields.displayName =
'proto.ibc.core.channel.v1.UpgradeFields'
}
/**
* 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.ibc.core.channel.v1.ErrorReceipt = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null)
}
goog.inherits(proto.ibc.core.channel.v1.ErrorReceipt, jspb.Message)
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.ibc.core.channel.v1.ErrorReceipt.displayName =
'proto.ibc.core.channel.v1.ErrorReceipt'
}
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.ibc.core.channel.v1.Upgrade.prototype.toObject = function (
opt_includeInstance,
) {
return proto.ibc.core.channel.v1.Upgrade.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.ibc.core.channel.v1.Upgrade} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.ibc.core.channel.v1.Upgrade.toObject = function (includeInstance, msg) {
var f,
obj = {
fields:
(f = msg.getFields()) &&
proto.ibc.core.channel.v1.UpgradeFields.toObject(includeInstance, f),
timeout:
(f = msg.getTimeout()) &&
ibc_core_channel_v1_channel_pb.Timeout.toObject(includeInstance, f),
nextSequenceSend: jspb.Message.getFieldWithDefault(msg, 3, 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.ibc.core.channel.v1.Upgrade}
*/
proto.ibc.core.channel.v1.Upgrade.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes)
var msg = new proto.ibc.core.channel.v1.Upgrade()
return proto.ibc.core.channel.v1.Upgrade.deserializeBinaryFromReader(
msg,
reader,
)
}
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.ibc.core.channel.v1.Upgrade} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.ibc.core.channel.v1.Upgrade}
*/
proto.ibc.core.channel.v1.Upgrade.deserializeBinaryFromReader = function (
msg,
reader,
) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break
}
var field = reader.getFieldNumber()
switch (field) {
case 1:
var value = new proto.ibc.core.channel.v1.UpgradeFields()
reader.readMessage(
value,
proto.ibc.core.channel.v1.UpgradeFields.deserializeBinaryFromReader,
)
msg.setFields(value)
break
case 2:
var value = new ibc_core_channel_v1_channel_pb.Timeout()
reader.readMessage(
value,
ibc_core_channel_v1_channel_pb.Timeout.deserializeBinaryFromReader,
)
msg.setTimeout(value)
break
case 3:
var value = /** @type {number} */ (reader.readUint64())
msg.setNextSequenceSend(value)
break
default:
reader.skipField()
break
}
}
return msg
}
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.ibc.core.channel.v1.Upgrade.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter()
proto.ibc.core.channel.v1.Upgrade.serializeBinaryToWriter(this, writer)
return writer.getResultBuffer()
}
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.ibc.core.channel.v1.Upgrade} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.ibc.core.channel.v1.Upgrade.serializeBinaryToWriter = function (
message,
writer,
) {
var f = undefined
f = message.getFields()
if (f != null) {
writer.writeMessage(
1,
f,
proto.ibc.core.channel.v1.UpgradeFields.serializeBinaryToWriter,
)
}
f = message.getTimeout()
if (f != null) {
writer.writeMessage(
2,
f,
ibc_core_channel_v1_channel_pb.Timeout.serializeBinaryToWriter,
)
}
f = message.getNextSequenceSend()
if (f !== 0) {
writer.writeUint64(3, f)
}
}
/**
* optional UpgradeFields fields = 1;
* @return {?proto.ibc.core.channel.v1.UpgradeFields}
*/
proto.ibc.core.channel.v1.Upgrade.prototype.getFields = function () {
return /** @type{?proto.ibc.core.channel.v1.UpgradeFields} */ (
jspb.Message.getWrapperField(
this,
proto.ibc.core.channel.v1.UpgradeFields,
1,
)
)
}
/**
* @param {?proto.ibc.core.channel.v1.UpgradeFields|undefined} value
* @return {!proto.ibc.core.channel.v1.Upgrade} returns this
*/
proto.ibc.core.channel.v1.Upgrade.prototype.setFields = function (value) {
return jspb.Message.setWrapperField(this, 1, value)
}
/**
* Clears the message field making it undefined.
* @return {!proto.ibc.core.channel.v1.Upgrade} returns this
*/
proto.ibc.core.channel.v1.Upgrade.prototype.clearFields = function () {
return this.setFields(undefined)
}
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.ibc.core.channel.v1.Upgrade.prototype.hasFields = function () {
return jspb.Message.getField(this, 1) != null
}
/**
* optional Timeout timeout = 2;
* @return {?proto.ibc.core.channel.v1.Timeout}
*/
proto.ibc.core.channel.v1.Upgrade.prototype.getTimeout = function () {
return /** @type{?proto.ibc.core.channel.v1.Timeout} */ (
jspb.Message.getWrapperField(
this,
ibc_core_channel_v1_channel_pb.Timeout,
2,
)
)
}
/**
* @param {?proto.ibc.core.channel.v1.Timeout|undefined} value
* @return {!proto.ibc.core.channel.v1.Upgrade} returns this
*/
proto.ibc.core.channel.v1.Upgrade.prototype.setTimeout = function (value) {
return jspb.Message.setWrapperField(this, 2, value)
}
/**
* Clears the message field making it undefined.
* @return {!proto.ibc.core.channel.v1.Upgrade} returns this
*/
proto.ibc.core.channel.v1.Upgrade.prototype.clearTimeout = function () {
return this.setTimeout(undefined)
}
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.ibc.core.channel.v1.Upgrade.prototype.hasTimeout = function () {
return jspb.Message.getField(this, 2) != null
}
/**
* optional uint64 next_sequence_send = 3;
* @return {number}
*/
proto.ibc.core.channel.v1.Upgrade.prototype.getNextSequenceSend = function () {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0))
}
/**
* @param {number} value
* @return {!proto.ibc.core.channel.v1.Upgrade} returns this
*/
proto.ibc.core.channel.v1.Upgrade.prototype.setNextSequenceSend = function (
value,
) {
return jspb.Message.setProto3IntField(this, 3, value)
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.ibc.core.channel.v1.UpgradeFields.repeatedFields_ = [2]
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.ibc.core.channel.v1.UpgradeFields.prototype.toObject = function (
opt_includeInstance,
) {
return proto.ibc.core.channel.v1.UpgradeFields.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.ibc.core.channel.v1.UpgradeFields} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.ibc.core.channel.v1.UpgradeFields.toObject = function (
includeInstance,
msg,
) {
var f,
obj = {
ordering: jspb.Message.getFieldWithDefault(msg, 1, 0),
connectionHopsList:
(f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f,
version: jspb.Message.getFieldWithDefault(msg, 3, ''),
}
if (includeInstance) {
obj.$jspbMessageInstance = msg
}
return obj
}
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.ibc.core.channel.v1.UpgradeFields}
*/
proto.ibc.core.channel.v1.UpgradeFields.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes)
var msg = new proto.ibc.core.channel.v1.UpgradeFields()
return proto.ibc.core.channel.v1.UpgradeFields.deserializeBinaryFromReader(
msg,
reader,
)
}
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.ibc.core.channel.v1.UpgradeFields} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.ibc.core.channel.v1.UpgradeFields}
*/
proto.ibc.core.channel.v1.UpgradeFields.deserializeBinaryFromReader = function (
msg,
reader,
) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break
}
var field = reader.getFieldNumber()
switch (field) {
case 1:
var value = /** @type {!proto.ibc.core.channel.v1.Order} */ (
reader.readEnum()
)
msg.setOrdering(value)
break
case 2:
var value = /** @type {string} */ (reader.readString())
msg.addConnectionHops(value)
break
case 3:
var value = /** @type {string} */ (reader.readString())
msg.setVersion(value)
break
default:
reader.skipField()
break
}
}
return msg
}
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.ibc.core.channel.v1.UpgradeFields.prototype.serializeBinary =
function () {
var writer = new jspb.BinaryWriter()
proto.ibc.core.channel.v1.UpgradeFields.serializeBinaryToWriter(
this,
writer,
)
return writer.getResultBuffer()
}
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.ibc.core.channel.v1.UpgradeFields} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.ibc.core.channel.v1.UpgradeFields.serializeBinaryToWriter = function (
message,
writer,
) {
var f = undefined
f = message.getOrdering()
if (f !== 0.0) {
writer.writeEnum(1, f)
}
f = message.getConnectionHopsList()
if (f.length > 0) {
writer.writeRepeatedString(2, f)
}
f = message.getVersion()
if (f.length > 0) {
writer.writeString(3, f)
}
}
/**
* optional Order ordering = 1;
* @return {!proto.ibc.core.channel.v1.Order}
*/
proto.ibc.core.channel.v1.UpgradeFields.prototype.getOrdering = function () {
return /** @type {!proto.ibc.core.channel.v1.Order} */ (
jspb.Message.getFieldWithDefault(this, 1, 0)
)
}
/**
* @param {!proto.ibc.core.channel.v1.Order} value
* @return {!proto.ibc.core.channel.v1.UpgradeFields} returns this
*/
proto.ibc.core.channel.v1.UpgradeFields.prototype.setOrdering = function (
value,
) {
return jspb.Message.setProto3EnumField(this, 1, value)
}
/**
* repeated string connection_hops = 2;
* @return {!Array<string>}
*/
proto.ibc.core.channel.v1.UpgradeFields.prototype.getConnectionHopsList =
function () {
return /** @type {!Array<string>} */ (
jspb.Message.getRepeatedField(this, 2)
)
}
/**
* @param {!Array<string>} value
* @return {!proto.ibc.core.channel.v1.UpgradeFields} returns this
*/
proto.ibc.core.channel.v1.UpgradeFields.prototype.setConnectionHopsList =
function (value) {
return jspb.Message.setField(this, 2, value || [])
}
/**
* @param {string} value
* @param {number=} opt_index
* @return {!proto.ibc.core.channel.v1.UpgradeFields} returns this
*/
proto.ibc.core.channel.v1.UpgradeFields.prototype.addConnectionHops = function (
value,
opt_index,
) {
return jspb.Message.addToRepeatedField(this, 2, value, opt_index)
}
/**
* Clears the list making it empty but non-null.
* @return {!proto.ibc.core.channel.v1.UpgradeFields} returns this
*/
proto.ibc.core.channel.v1.UpgradeFields.prototype.clearConnectionHopsList =
function () {
return this.setConnectionHopsList([])
}
/**
* optional string version = 3;
* @return {string}
*/
proto.ibc.core.channel.v1.UpgradeFields.prototype.getVersion = function () {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ''))
}
/**
* @param {string} value
* @return {!proto.ibc.core.channel.v1.UpgradeFields} returns this
*/
proto.ibc.core.channel.v1.UpgradeFields.prototype.setVersion = function (
value,
) {
return jspb.Message.setProto3StringField(this, 3, 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.ibc.core.channel.v1.ErrorReceipt.prototype.toObject = function (
opt_includeInstance,
) {
return proto.ibc.core.channel.v1.ErrorReceipt.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.ibc.core.channel.v1.ErrorReceipt} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.ibc.core.channel.v1.ErrorReceipt.toObject = function (
includeInstance,
msg,
) {
var f,
obj = {
sequence: jspb.Message.getFieldWithDefault(msg, 1, 0),
message: jspb.Message.getFieldWithDefault(msg, 2, ''),
}
if (includeInstance) {
obj.$jspbMessageInstance = msg
}
return obj
}
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.ibc.core.channel.v1.ErrorReceipt}
*/
proto.ibc.core.channel.v1.ErrorReceipt.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes)
var msg = new proto.ibc.core.channel.v1.ErrorReceipt()
return proto.ibc.core.channel.v1.ErrorReceipt.deserializeBinaryFromReader(
msg,
reader,
)
}
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.ibc.core.channel.v1.ErrorReceipt} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.ibc.core.channel.v1.ErrorReceipt}
*/
proto.ibc.core.channel.v1.ErrorReceipt.deserializeBinaryFromReader = function (
msg,
reader,
) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break
}
var field = reader.getFieldNumber()
switch (field) {
case 1:
var value = /** @type {number} */ (reader.readUint64())
msg.setSequence(value)
break
case 2:
var value = /** @type {string} */ (reader.readString())
msg.setMessage(value)
break
default:
reader.skipField()
break
}
}
return msg
}
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.ibc.core.channel.v1.ErrorReceipt.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter()
proto.ibc.core.channel.v1.ErrorReceipt.serializeBinaryToWriter(this, writer)
return writer.getResultBuffer()
}
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.ibc.core.channel.v1.ErrorReceipt} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.ibc.core.channel.v1.ErrorReceipt.serializeBinaryToWriter = function (
message,
writer,
) {
var f = undefined
f = message.getSequence()
if (f !== 0) {
writer.writeUint64(1, f)
}
f = message.getMessage()
if (f.length > 0) {
writer.writeString(2, f)
}
}
/**
* optional uint64 sequence = 1;
* @return {number}
*/
proto.ibc.core.channel.v1.ErrorReceipt.prototype.getSequence = function () {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0))
}
/**
* @param {number} value
* @return {!proto.ibc.core.channel.v1.ErrorReceipt} returns this
*/
proto.ibc.core.channel.v1.ErrorReceipt.prototype.setSequence = function (
value,
) {
return jspb.Message.setProto3IntField(this, 1, value)
}
/**
* optional string message = 2;
* @return {string}
*/
proto.ibc.core.channel.v1.ErrorReceipt.prototype.getMessage = function () {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ''))
}
/**
* @param {string} value
* @return {!proto.ibc.core.channel.v1.ErrorReceipt} returns this
*/
proto.ibc.core.channel.v1.ErrorReceipt.prototype.setMessage = function (value) {
return jspb.Message.setProto3StringField(this, 2, value)
}
goog.object.extend(exports, proto.ibc.core.channel.v1)