53879 lines
2.7 MiB
53879 lines
2.7 MiB
/* eslint-disable */
|
|
"use strict";
|
|
|
|
var $protobuf = require("protobufjs-dbx/minimal");
|
|
|
|
// Common aliases
|
|
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
|
|
|
|
// Exported root namespace
|
|
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
|
|
|
|
/**
|
|
* Namespace cosmos.
|
|
* @exports cosmos
|
|
* @namespace
|
|
*/
|
|
|
|
$root.cosmos = (function(cosmos) {
|
|
|
|
/**
|
|
* Namespace base.
|
|
* @memberof cosmos
|
|
* @namespace
|
|
*/
|
|
|
|
cosmos.base = (function(base) {
|
|
|
|
/**
|
|
* Namespace v1beta1.
|
|
* @memberof cosmos.base
|
|
* @namespace
|
|
*/
|
|
|
|
base.v1beta1 = (function(v1beta1) {
|
|
|
|
v1beta1.Coin = (function(Coin) {
|
|
|
|
/**
|
|
* 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 = "";
|
|
|
|
/**
|
|
* Creates a new Coin instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.base.v1beta1.Coin
|
|
* @static
|
|
* @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set
|
|
* @returns {cosmos.base.v1beta1.Coin} Coin instance
|
|
*/
|
|
Coin.create = function create(properties) {
|
|
return new Coin(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
Coin.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Coin;
|
|
})(v1beta1.Coin || {});
|
|
|
|
v1beta1.DecCoin = (function(DecCoin) {
|
|
|
|
/**
|
|
* 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 = "";
|
|
|
|
/**
|
|
* Creates a new DecCoin instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.base.v1beta1.DecCoin
|
|
* @static
|
|
* @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set
|
|
* @returns {cosmos.base.v1beta1.DecCoin} DecCoin instance
|
|
*/
|
|
DecCoin.create = function create(properties) {
|
|
return new DecCoin(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
DecCoin.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return DecCoin;
|
|
})(v1beta1.DecCoin || {});
|
|
|
|
v1beta1.IntProto = (function(IntProto) {
|
|
|
|
/**
|
|
* 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 = "";
|
|
|
|
/**
|
|
* Creates a new IntProto instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.base.v1beta1.IntProto
|
|
* @static
|
|
* @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set
|
|
* @returns {cosmos.base.v1beta1.IntProto} IntProto instance
|
|
*/
|
|
IntProto.create = function create(properties) {
|
|
return new IntProto(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
IntProto.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return IntProto;
|
|
})(v1beta1.IntProto || {});
|
|
|
|
v1beta1.DecProto = (function(DecProto) {
|
|
|
|
/**
|
|
* 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 = "";
|
|
|
|
/**
|
|
* Creates a new DecProto instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.base.v1beta1.DecProto
|
|
* @static
|
|
* @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set
|
|
* @returns {cosmos.base.v1beta1.DecProto} DecProto instance
|
|
*/
|
|
DecProto.create = function create(properties) {
|
|
return new DecProto(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
DecProto.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return DecProto;
|
|
})(v1beta1.DecProto || {});
|
|
|
|
return v1beta1;
|
|
})(base.v1beta1 || {});
|
|
|
|
/**
|
|
* Namespace query.
|
|
* @memberof cosmos.base
|
|
* @namespace
|
|
*/
|
|
|
|
base.query = (function(query) {
|
|
|
|
/**
|
|
* Namespace v1beta1.
|
|
* @memberof cosmos.base.query
|
|
* @namespace
|
|
*/
|
|
|
|
query.v1beta1 = (function(v1beta1) {
|
|
|
|
v1beta1.PageRequest = (function(PageRequest) {
|
|
|
|
/**
|
|
* Properties of a PageRequest.
|
|
* @memberof cosmos.base.query.v1beta1
|
|
* @interface IPageRequest
|
|
* @property {Uint8Array|null} [key] PageRequest key
|
|
* @property {number|Long|null} [offset] PageRequest offset
|
|
* @property {number|Long|null} [limit] PageRequest limit
|
|
* @property {boolean|null} [countTotal] PageRequest countTotal
|
|
*/
|
|
|
|
/**
|
|
* 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 {number|Long} offset
|
|
* @memberof cosmos.base.query.v1beta1.PageRequest
|
|
* @instance
|
|
*/
|
|
PageRequest.prototype.offset = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* PageRequest limit.
|
|
* @member {number|Long} limit
|
|
* @memberof cosmos.base.query.v1beta1.PageRequest
|
|
* @instance
|
|
*/
|
|
PageRequest.prototype.limit = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* PageRequest countTotal.
|
|
* @member {boolean} countTotal
|
|
* @memberof cosmos.base.query.v1beta1.PageRequest
|
|
* @instance
|
|
*/
|
|
PageRequest.prototype.countTotal = false;
|
|
|
|
/**
|
|
* Creates a new PageRequest instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.base.query.v1beta1.PageRequest
|
|
* @static
|
|
* @param {cosmos.base.query.v1beta1.IPageRequest=} [properties] Properties to set
|
|
* @returns {cosmos.base.query.v1beta1.PageRequest} PageRequest instance
|
|
*/
|
|
PageRequest.create = function create(properties) {
|
|
return new PageRequest(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.countTotal != null && Object.hasOwnProperty.call(message, "countTotal"))
|
|
writer.uint32(/* id 4, wireType 0 =*/32).bool(message.countTotal);
|
|
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.countTotal = 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.<string,*>} 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.countTotal != null && message.hasOwnProperty("countTotal"))
|
|
if (typeof message.countTotal !== "boolean")
|
|
return "countTotal: 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.<string,*>} 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.countTotal != null)
|
|
message.countTotal = Boolean(object.countTotal);
|
|
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.<string,*>} 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.countTotal = 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.countTotal != null && message.hasOwnProperty("countTotal"))
|
|
object.countTotal = message.countTotal;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this PageRequest to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.base.query.v1beta1.PageRequest
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
PageRequest.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return PageRequest;
|
|
})(v1beta1.PageRequest || {});
|
|
|
|
v1beta1.PageResponse = (function(PageResponse) {
|
|
|
|
/**
|
|
* Properties of a PageResponse.
|
|
* @memberof cosmos.base.query.v1beta1
|
|
* @interface IPageResponse
|
|
* @property {Uint8Array|null} [nextKey] PageResponse nextKey
|
|
* @property {number|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 nextKey.
|
|
* @member {Uint8Array} nextKey
|
|
* @memberof cosmos.base.query.v1beta1.PageResponse
|
|
* @instance
|
|
*/
|
|
PageResponse.prototype.nextKey = $util.newBuffer([]);
|
|
|
|
/**
|
|
* PageResponse total.
|
|
* @member {number|Long} total
|
|
* @memberof cosmos.base.query.v1beta1.PageResponse
|
|
* @instance
|
|
*/
|
|
PageResponse.prototype.total = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* Creates a new PageResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.base.query.v1beta1.PageResponse
|
|
* @static
|
|
* @param {cosmos.base.query.v1beta1.IPageResponse=} [properties] Properties to set
|
|
* @returns {cosmos.base.query.v1beta1.PageResponse} PageResponse instance
|
|
*/
|
|
PageResponse.create = function create(properties) {
|
|
return new PageResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.nextKey != null && Object.hasOwnProperty.call(message, "nextKey"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.nextKey);
|
|
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.nextKey = 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.<string,*>} 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.nextKey != null && message.hasOwnProperty("nextKey"))
|
|
if (!(message.nextKey && typeof message.nextKey.length === "number" || $util.isString(message.nextKey)))
|
|
return "nextKey: 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.<string,*>} 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.nextKey != null)
|
|
if (typeof object.nextKey === "string")
|
|
$util.base64.decode(object.nextKey, message.nextKey = $util.newBuffer($util.base64.length(object.nextKey)), 0);
|
|
else if (object.nextKey.length)
|
|
message.nextKey = object.nextKey;
|
|
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.<string,*>} Plain object
|
|
*/
|
|
PageResponse.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
if (options.bytes === String)
|
|
object.nextKey = "";
|
|
else {
|
|
object.nextKey = [];
|
|
if (options.bytes !== Array)
|
|
object.nextKey = $util.newBuffer(object.nextKey);
|
|
}
|
|
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.nextKey != null && message.hasOwnProperty("nextKey"))
|
|
object.nextKey = options.bytes === String ? $util.base64.encode(message.nextKey, 0, message.nextKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.nextKey) : message.nextKey;
|
|
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.<string,*>} JSON object
|
|
*/
|
|
PageResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return PageResponse;
|
|
})(v1beta1.PageResponse || {});
|
|
|
|
return v1beta1;
|
|
})(query.v1beta1 || {});
|
|
|
|
return query;
|
|
})(base.query || {});
|
|
|
|
return base;
|
|
})(cosmos.base || {});
|
|
|
|
/**
|
|
* Namespace bank.
|
|
* @memberof cosmos
|
|
* @namespace
|
|
*/
|
|
|
|
cosmos.bank = (function(bank) {
|
|
|
|
/**
|
|
* Namespace v1beta1.
|
|
* @memberof cosmos.bank
|
|
* @namespace
|
|
*/
|
|
|
|
bank.v1beta1 = (function(v1beta1) {
|
|
|
|
v1beta1.Params = (function(Params) {
|
|
|
|
/**
|
|
* Properties of a Params.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @interface IParams
|
|
* @property {Array.<cosmos.bank.v1beta1.ISendEnabled>|null} [sendEnabled] Params sendEnabled
|
|
* @property {boolean|null} [defaultSendEnabled] Params defaultSendEnabled
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Params.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @classdesc Represents a Params.
|
|
* @implements IParams
|
|
* @constructor
|
|
* @param {cosmos.bank.v1beta1.IParams=} [properties] Properties to set
|
|
*/
|
|
function Params(properties) {
|
|
this.sendEnabled = [];
|
|
if (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 sendEnabled.
|
|
* @member {Array.<cosmos.bank.v1beta1.ISendEnabled>} sendEnabled
|
|
* @memberof cosmos.bank.v1beta1.Params
|
|
* @instance
|
|
*/
|
|
Params.prototype.sendEnabled = $util.emptyArray;
|
|
|
|
/**
|
|
* Params defaultSendEnabled.
|
|
* @member {boolean} defaultSendEnabled
|
|
* @memberof cosmos.bank.v1beta1.Params
|
|
* @instance
|
|
*/
|
|
Params.prototype.defaultSendEnabled = false;
|
|
|
|
/**
|
|
* Creates a new Params instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.bank.v1beta1.Params
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IParams=} [properties] Properties to set
|
|
* @returns {cosmos.bank.v1beta1.Params} Params instance
|
|
*/
|
|
Params.create = function create(properties) {
|
|
return new Params(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Params message. Does not implicitly {@link cosmos.bank.v1beta1.Params.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.bank.v1beta1.Params
|
|
* @static
|
|
* @param {cosmos.bank.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.sendEnabled != null && message.sendEnabled.length)
|
|
for (var i = 0; i < message.sendEnabled.length; ++i)
|
|
$root.cosmos.bank.v1beta1.SendEnabled.encode(message.sendEnabled[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.defaultSendEnabled != null && Object.hasOwnProperty.call(message, "defaultSendEnabled"))
|
|
writer.uint32(/* id 2, wireType 0 =*/16).bool(message.defaultSendEnabled);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Params message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Params.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.bank.v1beta1.Params
|
|
* @static
|
|
* @param {cosmos.bank.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.bank.v1beta1.Params
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.bank.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.bank.v1beta1.Params();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
if (!(message.sendEnabled && message.sendEnabled.length))
|
|
message.sendEnabled = [];
|
|
message.sendEnabled.push($root.cosmos.bank.v1beta1.SendEnabled.decode(reader, reader.uint32()));
|
|
break;
|
|
case 2:
|
|
message.defaultSendEnabled = 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 cosmos.bank.v1beta1.Params
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.bank.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.bank.v1beta1.Params
|
|
* @static
|
|
* @param {Object.<string,*>} 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.sendEnabled != null && message.hasOwnProperty("sendEnabled")) {
|
|
if (!Array.isArray(message.sendEnabled))
|
|
return "sendEnabled: array expected";
|
|
for (var i = 0; i < message.sendEnabled.length; ++i) {
|
|
var error = $root.cosmos.bank.v1beta1.SendEnabled.verify(message.sendEnabled[i]);
|
|
if (error)
|
|
return "sendEnabled." + error;
|
|
}
|
|
}
|
|
if (message.defaultSendEnabled != null && message.hasOwnProperty("defaultSendEnabled"))
|
|
if (typeof message.defaultSendEnabled !== "boolean")
|
|
return "defaultSendEnabled: boolean expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a Params message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.bank.v1beta1.Params
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.bank.v1beta1.Params} Params
|
|
*/
|
|
Params.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.bank.v1beta1.Params)
|
|
return object;
|
|
var message = new $root.cosmos.bank.v1beta1.Params();
|
|
if (object.sendEnabled) {
|
|
if (!Array.isArray(object.sendEnabled))
|
|
throw TypeError(".cosmos.bank.v1beta1.Params.sendEnabled: array expected");
|
|
message.sendEnabled = [];
|
|
for (var i = 0; i < object.sendEnabled.length; ++i) {
|
|
if (typeof object.sendEnabled[i] !== "object")
|
|
throw TypeError(".cosmos.bank.v1beta1.Params.sendEnabled: object expected");
|
|
message.sendEnabled[i] = $root.cosmos.bank.v1beta1.SendEnabled.fromObject(object.sendEnabled[i]);
|
|
}
|
|
}
|
|
if (object.defaultSendEnabled != null)
|
|
message.defaultSendEnabled = Boolean(object.defaultSendEnabled);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a Params message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.bank.v1beta1.Params
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.Params} message Params
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Params.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.sendEnabled = [];
|
|
if (options.defaults)
|
|
object.defaultSendEnabled = false;
|
|
if (message.sendEnabled && message.sendEnabled.length) {
|
|
object.sendEnabled = [];
|
|
for (var j = 0; j < message.sendEnabled.length; ++j)
|
|
object.sendEnabled[j] = $root.cosmos.bank.v1beta1.SendEnabled.toObject(message.sendEnabled[j], options);
|
|
}
|
|
if (message.defaultSendEnabled != null && message.hasOwnProperty("defaultSendEnabled"))
|
|
object.defaultSendEnabled = message.defaultSendEnabled;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Params to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.bank.v1beta1.Params
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Params.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Params;
|
|
})(v1beta1.Params || {});
|
|
|
|
v1beta1.SendEnabled = (function(SendEnabled) {
|
|
|
|
/**
|
|
* Properties of a SendEnabled.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @interface ISendEnabled
|
|
* @property {string|null} [denom] SendEnabled denom
|
|
* @property {boolean|null} [enabled] SendEnabled enabled
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new SendEnabled.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @classdesc Represents a SendEnabled.
|
|
* @implements ISendEnabled
|
|
* @constructor
|
|
* @param {cosmos.bank.v1beta1.ISendEnabled=} [properties] Properties to set
|
|
*/
|
|
function SendEnabled(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* SendEnabled denom.
|
|
* @member {string} denom
|
|
* @memberof cosmos.bank.v1beta1.SendEnabled
|
|
* @instance
|
|
*/
|
|
SendEnabled.prototype.denom = "";
|
|
|
|
/**
|
|
* SendEnabled enabled.
|
|
* @member {boolean} enabled
|
|
* @memberof cosmos.bank.v1beta1.SendEnabled
|
|
* @instance
|
|
*/
|
|
SendEnabled.prototype.enabled = false;
|
|
|
|
/**
|
|
* Creates a new SendEnabled instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.bank.v1beta1.SendEnabled
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.ISendEnabled=} [properties] Properties to set
|
|
* @returns {cosmos.bank.v1beta1.SendEnabled} SendEnabled instance
|
|
*/
|
|
SendEnabled.create = function create(properties) {
|
|
return new SendEnabled(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified SendEnabled message. Does not implicitly {@link cosmos.bank.v1beta1.SendEnabled.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.bank.v1beta1.SendEnabled
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.ISendEnabled} message SendEnabled message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
SendEnabled.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.enabled != null && Object.hasOwnProperty.call(message, "enabled"))
|
|
writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enabled);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified SendEnabled message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.SendEnabled.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.bank.v1beta1.SendEnabled
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.ISendEnabled} message SendEnabled message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
SendEnabled.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a SendEnabled message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.bank.v1beta1.SendEnabled
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.bank.v1beta1.SendEnabled} SendEnabled
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
SendEnabled.decode = 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.bank.v1beta1.SendEnabled();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.denom = reader.string();
|
|
break;
|
|
case 2:
|
|
message.enabled = reader.bool();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a SendEnabled message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.bank.v1beta1.SendEnabled
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.bank.v1beta1.SendEnabled} SendEnabled
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
SendEnabled.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a SendEnabled message.
|
|
* @function verify
|
|
* @memberof cosmos.bank.v1beta1.SendEnabled
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
SendEnabled.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.enabled != null && message.hasOwnProperty("enabled"))
|
|
if (typeof message.enabled !== "boolean")
|
|
return "enabled: boolean expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a SendEnabled message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.bank.v1beta1.SendEnabled
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.bank.v1beta1.SendEnabled} SendEnabled
|
|
*/
|
|
SendEnabled.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.bank.v1beta1.SendEnabled)
|
|
return object;
|
|
var message = new $root.cosmos.bank.v1beta1.SendEnabled();
|
|
if (object.denom != null)
|
|
message.denom = String(object.denom);
|
|
if (object.enabled != null)
|
|
message.enabled = Boolean(object.enabled);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a SendEnabled message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.bank.v1beta1.SendEnabled
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.SendEnabled} message SendEnabled
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
SendEnabled.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.denom = "";
|
|
object.enabled = false;
|
|
}
|
|
if (message.denom != null && message.hasOwnProperty("denom"))
|
|
object.denom = message.denom;
|
|
if (message.enabled != null && message.hasOwnProperty("enabled"))
|
|
object.enabled = message.enabled;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this SendEnabled to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.bank.v1beta1.SendEnabled
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
SendEnabled.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return SendEnabled;
|
|
})(v1beta1.SendEnabled || {});
|
|
|
|
v1beta1.Input = (function(Input) {
|
|
|
|
/**
|
|
* Properties of an Input.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @interface IInput
|
|
* @property {string|null} [address] Input address
|
|
* @property {Array.<cosmos.base.v1beta1.ICoin>|null} [coins] Input coins
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Input.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @classdesc Represents an Input.
|
|
* @implements IInput
|
|
* @constructor
|
|
* @param {cosmos.bank.v1beta1.IInput=} [properties] Properties to set
|
|
*/
|
|
function Input(properties) {
|
|
this.coins = [];
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Input address.
|
|
* @member {string} address
|
|
* @memberof cosmos.bank.v1beta1.Input
|
|
* @instance
|
|
*/
|
|
Input.prototype.address = "";
|
|
|
|
/**
|
|
* Input coins.
|
|
* @member {Array.<cosmos.base.v1beta1.ICoin>} coins
|
|
* @memberof cosmos.bank.v1beta1.Input
|
|
* @instance
|
|
*/
|
|
Input.prototype.coins = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new Input instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.bank.v1beta1.Input
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IInput=} [properties] Properties to set
|
|
* @returns {cosmos.bank.v1beta1.Input} Input instance
|
|
*/
|
|
Input.create = function create(properties) {
|
|
return new Input(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Input message. Does not implicitly {@link cosmos.bank.v1beta1.Input.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.bank.v1beta1.Input
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IInput} message Input message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Input.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.coins != null && message.coins.length)
|
|
for (var i = 0; i < message.coins.length; ++i)
|
|
$root.cosmos.base.v1beta1.Coin.encode(message.coins[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Input message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Input.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.bank.v1beta1.Input
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IInput} message Input message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Input.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes an Input message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.bank.v1beta1.Input
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.bank.v1beta1.Input} Input
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Input.decode = 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.bank.v1beta1.Input();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.address = reader.string();
|
|
break;
|
|
case 2:
|
|
if (!(message.coins && message.coins.length))
|
|
message.coins = [];
|
|
message.coins.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()));
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes an Input message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.bank.v1beta1.Input
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.bank.v1beta1.Input} Input
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Input.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies an Input message.
|
|
* @function verify
|
|
* @memberof cosmos.bank.v1beta1.Input
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
Input.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.coins != null && message.hasOwnProperty("coins")) {
|
|
if (!Array.isArray(message.coins))
|
|
return "coins: array expected";
|
|
for (var i = 0; i < message.coins.length; ++i) {
|
|
var error = $root.cosmos.base.v1beta1.Coin.verify(message.coins[i]);
|
|
if (error)
|
|
return "coins." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates an Input message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.bank.v1beta1.Input
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.bank.v1beta1.Input} Input
|
|
*/
|
|
Input.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.bank.v1beta1.Input)
|
|
return object;
|
|
var message = new $root.cosmos.bank.v1beta1.Input();
|
|
if (object.address != null)
|
|
message.address = String(object.address);
|
|
if (object.coins) {
|
|
if (!Array.isArray(object.coins))
|
|
throw TypeError(".cosmos.bank.v1beta1.Input.coins: array expected");
|
|
message.coins = [];
|
|
for (var i = 0; i < object.coins.length; ++i) {
|
|
if (typeof object.coins[i] !== "object")
|
|
throw TypeError(".cosmos.bank.v1beta1.Input.coins: object expected");
|
|
message.coins[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.coins[i]);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from an Input message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.bank.v1beta1.Input
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.Input} message Input
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Input.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.coins = [];
|
|
if (options.defaults)
|
|
object.address = "";
|
|
if (message.address != null && message.hasOwnProperty("address"))
|
|
object.address = message.address;
|
|
if (message.coins && message.coins.length) {
|
|
object.coins = [];
|
|
for (var j = 0; j < message.coins.length; ++j)
|
|
object.coins[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.coins[j], options);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Input to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.bank.v1beta1.Input
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Input.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Input;
|
|
})(v1beta1.Input || {});
|
|
|
|
v1beta1.Output = (function(Output) {
|
|
|
|
/**
|
|
* Properties of an Output.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @interface IOutput
|
|
* @property {string|null} [address] Output address
|
|
* @property {Array.<cosmos.base.v1beta1.ICoin>|null} [coins] Output coins
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Output.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @classdesc Represents an Output.
|
|
* @implements IOutput
|
|
* @constructor
|
|
* @param {cosmos.bank.v1beta1.IOutput=} [properties] Properties to set
|
|
*/
|
|
function Output(properties) {
|
|
this.coins = [];
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Output address.
|
|
* @member {string} address
|
|
* @memberof cosmos.bank.v1beta1.Output
|
|
* @instance
|
|
*/
|
|
Output.prototype.address = "";
|
|
|
|
/**
|
|
* Output coins.
|
|
* @member {Array.<cosmos.base.v1beta1.ICoin>} coins
|
|
* @memberof cosmos.bank.v1beta1.Output
|
|
* @instance
|
|
*/
|
|
Output.prototype.coins = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new Output instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.bank.v1beta1.Output
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IOutput=} [properties] Properties to set
|
|
* @returns {cosmos.bank.v1beta1.Output} Output instance
|
|
*/
|
|
Output.create = function create(properties) {
|
|
return new Output(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Output message. Does not implicitly {@link cosmos.bank.v1beta1.Output.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.bank.v1beta1.Output
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IOutput} message Output message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Output.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.coins != null && message.coins.length)
|
|
for (var i = 0; i < message.coins.length; ++i)
|
|
$root.cosmos.base.v1beta1.Coin.encode(message.coins[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Output message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Output.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.bank.v1beta1.Output
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IOutput} message Output message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Output.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes an Output message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.bank.v1beta1.Output
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.bank.v1beta1.Output} Output
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Output.decode = 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.bank.v1beta1.Output();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.address = reader.string();
|
|
break;
|
|
case 2:
|
|
if (!(message.coins && message.coins.length))
|
|
message.coins = [];
|
|
message.coins.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()));
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes an Output message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.bank.v1beta1.Output
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.bank.v1beta1.Output} Output
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Output.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies an Output message.
|
|
* @function verify
|
|
* @memberof cosmos.bank.v1beta1.Output
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
Output.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.coins != null && message.hasOwnProperty("coins")) {
|
|
if (!Array.isArray(message.coins))
|
|
return "coins: array expected";
|
|
for (var i = 0; i < message.coins.length; ++i) {
|
|
var error = $root.cosmos.base.v1beta1.Coin.verify(message.coins[i]);
|
|
if (error)
|
|
return "coins." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates an Output message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.bank.v1beta1.Output
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.bank.v1beta1.Output} Output
|
|
*/
|
|
Output.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.bank.v1beta1.Output)
|
|
return object;
|
|
var message = new $root.cosmos.bank.v1beta1.Output();
|
|
if (object.address != null)
|
|
message.address = String(object.address);
|
|
if (object.coins) {
|
|
if (!Array.isArray(object.coins))
|
|
throw TypeError(".cosmos.bank.v1beta1.Output.coins: array expected");
|
|
message.coins = [];
|
|
for (var i = 0; i < object.coins.length; ++i) {
|
|
if (typeof object.coins[i] !== "object")
|
|
throw TypeError(".cosmos.bank.v1beta1.Output.coins: object expected");
|
|
message.coins[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.coins[i]);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from an Output message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.bank.v1beta1.Output
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.Output} message Output
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Output.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.coins = [];
|
|
if (options.defaults)
|
|
object.address = "";
|
|
if (message.address != null && message.hasOwnProperty("address"))
|
|
object.address = message.address;
|
|
if (message.coins && message.coins.length) {
|
|
object.coins = [];
|
|
for (var j = 0; j < message.coins.length; ++j)
|
|
object.coins[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.coins[j], options);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Output to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.bank.v1beta1.Output
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Output.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Output;
|
|
})(v1beta1.Output || {});
|
|
|
|
v1beta1.Supply = (function(Supply) {
|
|
|
|
/**
|
|
* Properties of a Supply.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @interface ISupply
|
|
* @property {Array.<cosmos.base.v1beta1.ICoin>|null} [total] Supply total
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Supply.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @classdesc Represents a Supply.
|
|
* @implements ISupply
|
|
* @constructor
|
|
* @param {cosmos.bank.v1beta1.ISupply=} [properties] Properties to set
|
|
*/
|
|
function Supply(properties) {
|
|
this.total = [];
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Supply total.
|
|
* @member {Array.<cosmos.base.v1beta1.ICoin>} total
|
|
* @memberof cosmos.bank.v1beta1.Supply
|
|
* @instance
|
|
*/
|
|
Supply.prototype.total = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new Supply instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.bank.v1beta1.Supply
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.ISupply=} [properties] Properties to set
|
|
* @returns {cosmos.bank.v1beta1.Supply} Supply instance
|
|
*/
|
|
Supply.create = function create(properties) {
|
|
return new Supply(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Supply message. Does not implicitly {@link cosmos.bank.v1beta1.Supply.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.bank.v1beta1.Supply
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.ISupply} message Supply message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Supply.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.total != null && message.total.length)
|
|
for (var i = 0; i < message.total.length; ++i)
|
|
$root.cosmos.base.v1beta1.Coin.encode(message.total[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Supply message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Supply.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.bank.v1beta1.Supply
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.ISupply} message Supply message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Supply.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a Supply message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.bank.v1beta1.Supply
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.bank.v1beta1.Supply} Supply
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Supply.decode = 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.bank.v1beta1.Supply();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
if (!(message.total && message.total.length))
|
|
message.total = [];
|
|
message.total.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()));
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a Supply message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.bank.v1beta1.Supply
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.bank.v1beta1.Supply} Supply
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Supply.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a Supply message.
|
|
* @function verify
|
|
* @memberof cosmos.bank.v1beta1.Supply
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
Supply.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.total != null && message.hasOwnProperty("total")) {
|
|
if (!Array.isArray(message.total))
|
|
return "total: array expected";
|
|
for (var i = 0; i < message.total.length; ++i) {
|
|
var error = $root.cosmos.base.v1beta1.Coin.verify(message.total[i]);
|
|
if (error)
|
|
return "total." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a Supply message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.bank.v1beta1.Supply
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.bank.v1beta1.Supply} Supply
|
|
*/
|
|
Supply.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.bank.v1beta1.Supply)
|
|
return object;
|
|
var message = new $root.cosmos.bank.v1beta1.Supply();
|
|
if (object.total) {
|
|
if (!Array.isArray(object.total))
|
|
throw TypeError(".cosmos.bank.v1beta1.Supply.total: array expected");
|
|
message.total = [];
|
|
for (var i = 0; i < object.total.length; ++i) {
|
|
if (typeof object.total[i] !== "object")
|
|
throw TypeError(".cosmos.bank.v1beta1.Supply.total: object expected");
|
|
message.total[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.total[i]);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a Supply message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.bank.v1beta1.Supply
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.Supply} message Supply
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Supply.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.total = [];
|
|
if (message.total && message.total.length) {
|
|
object.total = [];
|
|
for (var j = 0; j < message.total.length; ++j)
|
|
object.total[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.total[j], options);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Supply to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.bank.v1beta1.Supply
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Supply.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Supply;
|
|
})(v1beta1.Supply || {});
|
|
|
|
v1beta1.DenomUnit = (function(DenomUnit) {
|
|
|
|
/**
|
|
* Properties of a DenomUnit.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @interface IDenomUnit
|
|
* @property {string|null} [denom] DenomUnit denom
|
|
* @property {number|null} [exponent] DenomUnit exponent
|
|
* @property {Array.<string>|null} [aliases] DenomUnit aliases
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new DenomUnit.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @classdesc Represents a DenomUnit.
|
|
* @implements IDenomUnit
|
|
* @constructor
|
|
* @param {cosmos.bank.v1beta1.IDenomUnit=} [properties] Properties to set
|
|
*/
|
|
function DenomUnit(properties) {
|
|
this.aliases = [];
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* DenomUnit denom.
|
|
* @member {string} denom
|
|
* @memberof cosmos.bank.v1beta1.DenomUnit
|
|
* @instance
|
|
*/
|
|
DenomUnit.prototype.denom = "";
|
|
|
|
/**
|
|
* DenomUnit exponent.
|
|
* @member {number} exponent
|
|
* @memberof cosmos.bank.v1beta1.DenomUnit
|
|
* @instance
|
|
*/
|
|
DenomUnit.prototype.exponent = 0;
|
|
|
|
/**
|
|
* DenomUnit aliases.
|
|
* @member {Array.<string>} aliases
|
|
* @memberof cosmos.bank.v1beta1.DenomUnit
|
|
* @instance
|
|
*/
|
|
DenomUnit.prototype.aliases = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new DenomUnit instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.bank.v1beta1.DenomUnit
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IDenomUnit=} [properties] Properties to set
|
|
* @returns {cosmos.bank.v1beta1.DenomUnit} DenomUnit instance
|
|
*/
|
|
DenomUnit.create = function create(properties) {
|
|
return new DenomUnit(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified DenomUnit message. Does not implicitly {@link cosmos.bank.v1beta1.DenomUnit.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.bank.v1beta1.DenomUnit
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IDenomUnit} message DenomUnit message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
DenomUnit.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.exponent != null && Object.hasOwnProperty.call(message, "exponent"))
|
|
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.exponent);
|
|
if (message.aliases != null && message.aliases.length)
|
|
for (var i = 0; i < message.aliases.length; ++i)
|
|
writer.uint32(/* id 3, wireType 2 =*/26).string(message.aliases[i]);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified DenomUnit message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.DenomUnit.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.bank.v1beta1.DenomUnit
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IDenomUnit} message DenomUnit message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
DenomUnit.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a DenomUnit message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.bank.v1beta1.DenomUnit
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.bank.v1beta1.DenomUnit} DenomUnit
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
DenomUnit.decode = 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.bank.v1beta1.DenomUnit();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.denom = reader.string();
|
|
break;
|
|
case 2:
|
|
message.exponent = reader.uint32();
|
|
break;
|
|
case 3:
|
|
if (!(message.aliases && message.aliases.length))
|
|
message.aliases = [];
|
|
message.aliases.push(reader.string());
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a DenomUnit message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.bank.v1beta1.DenomUnit
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.bank.v1beta1.DenomUnit} DenomUnit
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
DenomUnit.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a DenomUnit message.
|
|
* @function verify
|
|
* @memberof cosmos.bank.v1beta1.DenomUnit
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
DenomUnit.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.exponent != null && message.hasOwnProperty("exponent"))
|
|
if (!$util.isInteger(message.exponent))
|
|
return "exponent: integer expected";
|
|
if (message.aliases != null && message.hasOwnProperty("aliases")) {
|
|
if (!Array.isArray(message.aliases))
|
|
return "aliases: array expected";
|
|
for (var i = 0; i < message.aliases.length; ++i)
|
|
if (!$util.isString(message.aliases[i]))
|
|
return "aliases: string[] expected";
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a DenomUnit message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.bank.v1beta1.DenomUnit
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.bank.v1beta1.DenomUnit} DenomUnit
|
|
*/
|
|
DenomUnit.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.bank.v1beta1.DenomUnit)
|
|
return object;
|
|
var message = new $root.cosmos.bank.v1beta1.DenomUnit();
|
|
if (object.denom != null)
|
|
message.denom = String(object.denom);
|
|
if (object.exponent != null)
|
|
message.exponent = object.exponent >>> 0;
|
|
if (object.aliases) {
|
|
if (!Array.isArray(object.aliases))
|
|
throw TypeError(".cosmos.bank.v1beta1.DenomUnit.aliases: array expected");
|
|
message.aliases = [];
|
|
for (var i = 0; i < object.aliases.length; ++i)
|
|
message.aliases[i] = String(object.aliases[i]);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a DenomUnit message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.bank.v1beta1.DenomUnit
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.DenomUnit} message DenomUnit
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
DenomUnit.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.aliases = [];
|
|
if (options.defaults) {
|
|
object.denom = "";
|
|
object.exponent = 0;
|
|
}
|
|
if (message.denom != null && message.hasOwnProperty("denom"))
|
|
object.denom = message.denom;
|
|
if (message.exponent != null && message.hasOwnProperty("exponent"))
|
|
object.exponent = message.exponent;
|
|
if (message.aliases && message.aliases.length) {
|
|
object.aliases = [];
|
|
for (var j = 0; j < message.aliases.length; ++j)
|
|
object.aliases[j] = message.aliases[j];
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this DenomUnit to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.bank.v1beta1.DenomUnit
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
DenomUnit.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return DenomUnit;
|
|
})(v1beta1.DenomUnit || {});
|
|
|
|
v1beta1.Metadata = (function(Metadata) {
|
|
|
|
/**
|
|
* Properties of a Metadata.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @interface IMetadata
|
|
* @property {string|null} [description] Metadata description
|
|
* @property {Array.<cosmos.bank.v1beta1.IDenomUnit>|null} [denomUnits] Metadata denomUnits
|
|
* @property {string|null} [base] Metadata base
|
|
* @property {string|null} [display] Metadata display
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Metadata.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @classdesc Represents a Metadata.
|
|
* @implements IMetadata
|
|
* @constructor
|
|
* @param {cosmos.bank.v1beta1.IMetadata=} [properties] Properties to set
|
|
*/
|
|
function Metadata(properties) {
|
|
this.denomUnits = [];
|
|
if (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 description.
|
|
* @member {string} description
|
|
* @memberof cosmos.bank.v1beta1.Metadata
|
|
* @instance
|
|
*/
|
|
Metadata.prototype.description = "";
|
|
|
|
/**
|
|
* Metadata denomUnits.
|
|
* @member {Array.<cosmos.bank.v1beta1.IDenomUnit>} denomUnits
|
|
* @memberof cosmos.bank.v1beta1.Metadata
|
|
* @instance
|
|
*/
|
|
Metadata.prototype.denomUnits = $util.emptyArray;
|
|
|
|
/**
|
|
* Metadata base.
|
|
* @member {string} base
|
|
* @memberof cosmos.bank.v1beta1.Metadata
|
|
* @instance
|
|
*/
|
|
Metadata.prototype.base = "";
|
|
|
|
/**
|
|
* Metadata display.
|
|
* @member {string} display
|
|
* @memberof cosmos.bank.v1beta1.Metadata
|
|
* @instance
|
|
*/
|
|
Metadata.prototype.display = "";
|
|
|
|
/**
|
|
* Creates a new Metadata instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.bank.v1beta1.Metadata
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IMetadata=} [properties] Properties to set
|
|
* @returns {cosmos.bank.v1beta1.Metadata} Metadata instance
|
|
*/
|
|
Metadata.create = function create(properties) {
|
|
return new Metadata(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Metadata message. Does not implicitly {@link cosmos.bank.v1beta1.Metadata.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.bank.v1beta1.Metadata
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.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.description != null && Object.hasOwnProperty.call(message, "description"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.description);
|
|
if (message.denomUnits != null && message.denomUnits.length)
|
|
for (var i = 0; i < message.denomUnits.length; ++i)
|
|
$root.cosmos.bank.v1beta1.DenomUnit.encode(message.denomUnits[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
if (message.base != null && Object.hasOwnProperty.call(message, "base"))
|
|
writer.uint32(/* id 3, wireType 2 =*/26).string(message.base);
|
|
if (message.display != null && Object.hasOwnProperty.call(message, "display"))
|
|
writer.uint32(/* id 4, wireType 2 =*/34).string(message.display);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Metadata message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.Metadata.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.bank.v1beta1.Metadata
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.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 cosmos.bank.v1beta1.Metadata
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.bank.v1beta1.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.cosmos.bank.v1beta1.Metadata();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.description = reader.string();
|
|
break;
|
|
case 2:
|
|
if (!(message.denomUnits && message.denomUnits.length))
|
|
message.denomUnits = [];
|
|
message.denomUnits.push($root.cosmos.bank.v1beta1.DenomUnit.decode(reader, reader.uint32()));
|
|
break;
|
|
case 3:
|
|
message.base = reader.string();
|
|
break;
|
|
case 4:
|
|
message.display = 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 cosmos.bank.v1beta1.Metadata
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.bank.v1beta1.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 cosmos.bank.v1beta1.Metadata
|
|
* @static
|
|
* @param {Object.<string,*>} 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.description != null && message.hasOwnProperty("description"))
|
|
if (!$util.isString(message.description))
|
|
return "description: string expected";
|
|
if (message.denomUnits != null && message.hasOwnProperty("denomUnits")) {
|
|
if (!Array.isArray(message.denomUnits))
|
|
return "denomUnits: array expected";
|
|
for (var i = 0; i < message.denomUnits.length; ++i) {
|
|
var error = $root.cosmos.bank.v1beta1.DenomUnit.verify(message.denomUnits[i]);
|
|
if (error)
|
|
return "denomUnits." + error;
|
|
}
|
|
}
|
|
if (message.base != null && message.hasOwnProperty("base"))
|
|
if (!$util.isString(message.base))
|
|
return "base: string expected";
|
|
if (message.display != null && message.hasOwnProperty("display"))
|
|
if (!$util.isString(message.display))
|
|
return "display: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a Metadata message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.bank.v1beta1.Metadata
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.bank.v1beta1.Metadata} Metadata
|
|
*/
|
|
Metadata.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.bank.v1beta1.Metadata)
|
|
return object;
|
|
var message = new $root.cosmos.bank.v1beta1.Metadata();
|
|
if (object.description != null)
|
|
message.description = String(object.description);
|
|
if (object.denomUnits) {
|
|
if (!Array.isArray(object.denomUnits))
|
|
throw TypeError(".cosmos.bank.v1beta1.Metadata.denomUnits: array expected");
|
|
message.denomUnits = [];
|
|
for (var i = 0; i < object.denomUnits.length; ++i) {
|
|
if (typeof object.denomUnits[i] !== "object")
|
|
throw TypeError(".cosmos.bank.v1beta1.Metadata.denomUnits: object expected");
|
|
message.denomUnits[i] = $root.cosmos.bank.v1beta1.DenomUnit.fromObject(object.denomUnits[i]);
|
|
}
|
|
}
|
|
if (object.base != null)
|
|
message.base = String(object.base);
|
|
if (object.display != null)
|
|
message.display = String(object.display);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a Metadata message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.bank.v1beta1.Metadata
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.Metadata} message Metadata
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Metadata.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.denomUnits = [];
|
|
if (options.defaults) {
|
|
object.description = "";
|
|
object.base = "";
|
|
object.display = "";
|
|
}
|
|
if (message.description != null && message.hasOwnProperty("description"))
|
|
object.description = message.description;
|
|
if (message.denomUnits && message.denomUnits.length) {
|
|
object.denomUnits = [];
|
|
for (var j = 0; j < message.denomUnits.length; ++j)
|
|
object.denomUnits[j] = $root.cosmos.bank.v1beta1.DenomUnit.toObject(message.denomUnits[j], options);
|
|
}
|
|
if (message.base != null && message.hasOwnProperty("base"))
|
|
object.base = message.base;
|
|
if (message.display != null && message.hasOwnProperty("display"))
|
|
object.display = message.display;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Metadata to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.bank.v1beta1.Metadata
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Metadata.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Metadata;
|
|
})(v1beta1.Metadata || {});
|
|
|
|
v1beta1.Msg = (function(Msg) {
|
|
|
|
/**
|
|
* Constructs a new Msg service.
|
|
* @memberof cosmos.bank.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;
|
|
|
|
/**
|
|
* Creates new Msg service using the specified rpc implementation.
|
|
* @function create
|
|
* @memberof cosmos.bank.v1beta1.Msg
|
|
* @static
|
|
* @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
|
* @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
|
* @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
|
* @returns {Msg} RPC service. Useful where requests and/or responses are streamed.
|
|
*/
|
|
Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
|
return new this(rpcImpl, requestDelimited, responseDelimited);
|
|
};
|
|
|
|
/**
|
|
* Callback as used by {@link cosmos.bank.v1beta1.Msg#send}.
|
|
* @memberof cosmos.bank.v1beta1.Msg
|
|
* @typedef SendCallback
|
|
* @type {function}
|
|
* @param {Error|null} error Error, if any
|
|
* @param {cosmos.bank.v1beta1.IMsgSendResponse} [response] MsgSendResponse
|
|
*/
|
|
|
|
/**
|
|
* Calls Send.
|
|
* @function send
|
|
* @memberof cosmos.bank.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.bank.v1beta1.IMsgSend} request MsgSend message or plain object
|
|
* @param {cosmos.bank.v1beta1.Msg.SendCallback} callback Node-style callback called with the error, if any, and MsgSendResponse
|
|
* @returns {undefined}
|
|
* @variation 1
|
|
*/
|
|
Object.defineProperty(Msg.prototype.send = function send(request, callback) {
|
|
return this.rpcCall(send, $root.cosmos.bank.v1beta1.MsgSend, $root.cosmos.bank.v1beta1.MsgSendResponse, request, callback);
|
|
}, "name", { value: "Send" });
|
|
|
|
/**
|
|
* Calls Send.
|
|
* @function send
|
|
* @memberof cosmos.bank.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.bank.v1beta1.IMsgSend} request MsgSend message or plain object
|
|
* @returns {Promise<cosmos.bank.v1beta1.IMsgSendResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
/**
|
|
* Callback as used by {@link cosmos.bank.v1beta1.Msg#multiSend}.
|
|
* @memberof cosmos.bank.v1beta1.Msg
|
|
* @typedef MultiSendCallback
|
|
* @type {function}
|
|
* @param {Error|null} error Error, if any
|
|
* @param {cosmos.bank.v1beta1.IMsgMultiSendResponse} [response] MsgMultiSendResponse
|
|
*/
|
|
|
|
/**
|
|
* Calls MultiSend.
|
|
* @function multiSend
|
|
* @memberof cosmos.bank.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.bank.v1beta1.IMsgMultiSend} request MsgMultiSend message or plain object
|
|
* @param {cosmos.bank.v1beta1.Msg.MultiSendCallback} callback Node-style callback called with the error, if any, and MsgMultiSendResponse
|
|
* @returns {undefined}
|
|
* @variation 1
|
|
*/
|
|
Object.defineProperty(Msg.prototype.multiSend = function multiSend(request, callback) {
|
|
return this.rpcCall(multiSend, $root.cosmos.bank.v1beta1.MsgMultiSend, $root.cosmos.bank.v1beta1.MsgMultiSendResponse, request, callback);
|
|
}, "name", { value: "MultiSend" });
|
|
|
|
/**
|
|
* Calls MultiSend.
|
|
* @function multiSend
|
|
* @memberof cosmos.bank.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.bank.v1beta1.IMsgMultiSend} request MsgMultiSend message or plain object
|
|
* @returns {Promise<cosmos.bank.v1beta1.IMsgMultiSendResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
return Msg;
|
|
})(v1beta1.Msg || {});
|
|
|
|
v1beta1.MsgSend = (function(MsgSend) {
|
|
|
|
/**
|
|
* Properties of a MsgSend.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @interface IMsgSend
|
|
* @property {string|null} [fromAddress] MsgSend fromAddress
|
|
* @property {string|null} [toAddress] MsgSend toAddress
|
|
* @property {Array.<cosmos.base.v1beta1.ICoin>|null} [amount] MsgSend amount
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgSend.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @classdesc Represents a MsgSend.
|
|
* @implements IMsgSend
|
|
* @constructor
|
|
* @param {cosmos.bank.v1beta1.IMsgSend=} [properties] Properties to set
|
|
*/
|
|
function MsgSend(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]];
|
|
}
|
|
|
|
/**
|
|
* MsgSend fromAddress.
|
|
* @member {string} fromAddress
|
|
* @memberof cosmos.bank.v1beta1.MsgSend
|
|
* @instance
|
|
*/
|
|
MsgSend.prototype.fromAddress = "";
|
|
|
|
/**
|
|
* MsgSend toAddress.
|
|
* @member {string} toAddress
|
|
* @memberof cosmos.bank.v1beta1.MsgSend
|
|
* @instance
|
|
*/
|
|
MsgSend.prototype.toAddress = "";
|
|
|
|
/**
|
|
* MsgSend amount.
|
|
* @member {Array.<cosmos.base.v1beta1.ICoin>} amount
|
|
* @memberof cosmos.bank.v1beta1.MsgSend
|
|
* @instance
|
|
*/
|
|
MsgSend.prototype.amount = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new MsgSend instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.bank.v1beta1.MsgSend
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IMsgSend=} [properties] Properties to set
|
|
* @returns {cosmos.bank.v1beta1.MsgSend} MsgSend instance
|
|
*/
|
|
MsgSend.create = function create(properties) {
|
|
return new MsgSend(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgSend message. Does not implicitly {@link cosmos.bank.v1beta1.MsgSend.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.bank.v1beta1.MsgSend
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IMsgSend} message MsgSend message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgSend.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.fromAddress != null && Object.hasOwnProperty.call(message, "fromAddress"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.fromAddress);
|
|
if (message.toAddress != null && Object.hasOwnProperty.call(message, "toAddress"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.toAddress);
|
|
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 MsgSend message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.MsgSend.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.bank.v1beta1.MsgSend
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IMsgSend} message MsgSend message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgSend.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgSend message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.bank.v1beta1.MsgSend
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.bank.v1beta1.MsgSend} MsgSend
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgSend.decode = 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.bank.v1beta1.MsgSend();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.fromAddress = reader.string();
|
|
break;
|
|
case 2:
|
|
message.toAddress = 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 MsgSend message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.bank.v1beta1.MsgSend
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.bank.v1beta1.MsgSend} MsgSend
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgSend.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgSend message.
|
|
* @function verify
|
|
* @memberof cosmos.bank.v1beta1.MsgSend
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgSend.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.fromAddress != null && message.hasOwnProperty("fromAddress"))
|
|
if (!$util.isString(message.fromAddress))
|
|
return "fromAddress: string expected";
|
|
if (message.toAddress != null && message.hasOwnProperty("toAddress"))
|
|
if (!$util.isString(message.toAddress))
|
|
return "toAddress: 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 MsgSend message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.bank.v1beta1.MsgSend
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.bank.v1beta1.MsgSend} MsgSend
|
|
*/
|
|
MsgSend.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.bank.v1beta1.MsgSend)
|
|
return object;
|
|
var message = new $root.cosmos.bank.v1beta1.MsgSend();
|
|
if (object.fromAddress != null)
|
|
message.fromAddress = String(object.fromAddress);
|
|
if (object.toAddress != null)
|
|
message.toAddress = String(object.toAddress);
|
|
if (object.amount) {
|
|
if (!Array.isArray(object.amount))
|
|
throw TypeError(".cosmos.bank.v1beta1.MsgSend.amount: array expected");
|
|
message.amount = [];
|
|
for (var i = 0; i < object.amount.length; ++i) {
|
|
if (typeof object.amount[i] !== "object")
|
|
throw TypeError(".cosmos.bank.v1beta1.MsgSend.amount: object expected");
|
|
message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgSend message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.bank.v1beta1.MsgSend
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.MsgSend} message MsgSend
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgSend.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.amount = [];
|
|
if (options.defaults) {
|
|
object.fromAddress = "";
|
|
object.toAddress = "";
|
|
}
|
|
if (message.fromAddress != null && message.hasOwnProperty("fromAddress"))
|
|
object.fromAddress = message.fromAddress;
|
|
if (message.toAddress != null && message.hasOwnProperty("toAddress"))
|
|
object.toAddress = message.toAddress;
|
|
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 MsgSend to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.bank.v1beta1.MsgSend
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgSend.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgSend;
|
|
})(v1beta1.MsgSend || {});
|
|
|
|
v1beta1.MsgSendResponse = (function(MsgSendResponse) {
|
|
|
|
/**
|
|
* Properties of a MsgSendResponse.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @interface IMsgSendResponse
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgSendResponse.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @classdesc Represents a MsgSendResponse.
|
|
* @implements IMsgSendResponse
|
|
* @constructor
|
|
* @param {cosmos.bank.v1beta1.IMsgSendResponse=} [properties] Properties to set
|
|
*/
|
|
function MsgSendResponse(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new MsgSendResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.bank.v1beta1.MsgSendResponse
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IMsgSendResponse=} [properties] Properties to set
|
|
* @returns {cosmos.bank.v1beta1.MsgSendResponse} MsgSendResponse instance
|
|
*/
|
|
MsgSendResponse.create = function create(properties) {
|
|
return new MsgSendResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgSendResponse message. Does not implicitly {@link cosmos.bank.v1beta1.MsgSendResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.bank.v1beta1.MsgSendResponse
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IMsgSendResponse} message MsgSendResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgSendResponse.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgSendResponse message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.MsgSendResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.bank.v1beta1.MsgSendResponse
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IMsgSendResponse} message MsgSendResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgSendResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgSendResponse message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.bank.v1beta1.MsgSendResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.bank.v1beta1.MsgSendResponse} MsgSendResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgSendResponse.decode = 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.bank.v1beta1.MsgSendResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgSendResponse message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.bank.v1beta1.MsgSendResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.bank.v1beta1.MsgSendResponse} MsgSendResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgSendResponse.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgSendResponse message.
|
|
* @function verify
|
|
* @memberof cosmos.bank.v1beta1.MsgSendResponse
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgSendResponse.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgSendResponse message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.bank.v1beta1.MsgSendResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.bank.v1beta1.MsgSendResponse} MsgSendResponse
|
|
*/
|
|
MsgSendResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.bank.v1beta1.MsgSendResponse)
|
|
return object;
|
|
return new $root.cosmos.bank.v1beta1.MsgSendResponse();
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgSendResponse message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.bank.v1beta1.MsgSendResponse
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.MsgSendResponse} message MsgSendResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgSendResponse.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgSendResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.bank.v1beta1.MsgSendResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgSendResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgSendResponse;
|
|
})(v1beta1.MsgSendResponse || {});
|
|
|
|
v1beta1.MsgMultiSend = (function(MsgMultiSend) {
|
|
|
|
/**
|
|
* Properties of a MsgMultiSend.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @interface IMsgMultiSend
|
|
* @property {Array.<cosmos.bank.v1beta1.IInput>|null} [inputs] MsgMultiSend inputs
|
|
* @property {Array.<cosmos.bank.v1beta1.IOutput>|null} [outputs] MsgMultiSend outputs
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgMultiSend.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @classdesc Represents a MsgMultiSend.
|
|
* @implements IMsgMultiSend
|
|
* @constructor
|
|
* @param {cosmos.bank.v1beta1.IMsgMultiSend=} [properties] Properties to set
|
|
*/
|
|
function MsgMultiSend(properties) {
|
|
this.inputs = [];
|
|
this.outputs = [];
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* MsgMultiSend inputs.
|
|
* @member {Array.<cosmos.bank.v1beta1.IInput>} inputs
|
|
* @memberof cosmos.bank.v1beta1.MsgMultiSend
|
|
* @instance
|
|
*/
|
|
MsgMultiSend.prototype.inputs = $util.emptyArray;
|
|
|
|
/**
|
|
* MsgMultiSend outputs.
|
|
* @member {Array.<cosmos.bank.v1beta1.IOutput>} outputs
|
|
* @memberof cosmos.bank.v1beta1.MsgMultiSend
|
|
* @instance
|
|
*/
|
|
MsgMultiSend.prototype.outputs = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new MsgMultiSend instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.bank.v1beta1.MsgMultiSend
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IMsgMultiSend=} [properties] Properties to set
|
|
* @returns {cosmos.bank.v1beta1.MsgMultiSend} MsgMultiSend instance
|
|
*/
|
|
MsgMultiSend.create = function create(properties) {
|
|
return new MsgMultiSend(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgMultiSend message. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSend.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.bank.v1beta1.MsgMultiSend
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IMsgMultiSend} message MsgMultiSend message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgMultiSend.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.inputs != null && message.inputs.length)
|
|
for (var i = 0; i < message.inputs.length; ++i)
|
|
$root.cosmos.bank.v1beta1.Input.encode(message.inputs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.outputs != null && message.outputs.length)
|
|
for (var i = 0; i < message.outputs.length; ++i)
|
|
$root.cosmos.bank.v1beta1.Output.encode(message.outputs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgMultiSend message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSend.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.bank.v1beta1.MsgMultiSend
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IMsgMultiSend} message MsgMultiSend message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgMultiSend.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgMultiSend message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.bank.v1beta1.MsgMultiSend
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.bank.v1beta1.MsgMultiSend} MsgMultiSend
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgMultiSend.decode = 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.bank.v1beta1.MsgMultiSend();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
if (!(message.inputs && message.inputs.length))
|
|
message.inputs = [];
|
|
message.inputs.push($root.cosmos.bank.v1beta1.Input.decode(reader, reader.uint32()));
|
|
break;
|
|
case 2:
|
|
if (!(message.outputs && message.outputs.length))
|
|
message.outputs = [];
|
|
message.outputs.push($root.cosmos.bank.v1beta1.Output.decode(reader, reader.uint32()));
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgMultiSend message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.bank.v1beta1.MsgMultiSend
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.bank.v1beta1.MsgMultiSend} MsgMultiSend
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgMultiSend.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgMultiSend message.
|
|
* @function verify
|
|
* @memberof cosmos.bank.v1beta1.MsgMultiSend
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgMultiSend.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.inputs != null && message.hasOwnProperty("inputs")) {
|
|
if (!Array.isArray(message.inputs))
|
|
return "inputs: array expected";
|
|
for (var i = 0; i < message.inputs.length; ++i) {
|
|
var error = $root.cosmos.bank.v1beta1.Input.verify(message.inputs[i]);
|
|
if (error)
|
|
return "inputs." + error;
|
|
}
|
|
}
|
|
if (message.outputs != null && message.hasOwnProperty("outputs")) {
|
|
if (!Array.isArray(message.outputs))
|
|
return "outputs: array expected";
|
|
for (var i = 0; i < message.outputs.length; ++i) {
|
|
var error = $root.cosmos.bank.v1beta1.Output.verify(message.outputs[i]);
|
|
if (error)
|
|
return "outputs." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgMultiSend message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.bank.v1beta1.MsgMultiSend
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.bank.v1beta1.MsgMultiSend} MsgMultiSend
|
|
*/
|
|
MsgMultiSend.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.bank.v1beta1.MsgMultiSend)
|
|
return object;
|
|
var message = new $root.cosmos.bank.v1beta1.MsgMultiSend();
|
|
if (object.inputs) {
|
|
if (!Array.isArray(object.inputs))
|
|
throw TypeError(".cosmos.bank.v1beta1.MsgMultiSend.inputs: array expected");
|
|
message.inputs = [];
|
|
for (var i = 0; i < object.inputs.length; ++i) {
|
|
if (typeof object.inputs[i] !== "object")
|
|
throw TypeError(".cosmos.bank.v1beta1.MsgMultiSend.inputs: object expected");
|
|
message.inputs[i] = $root.cosmos.bank.v1beta1.Input.fromObject(object.inputs[i]);
|
|
}
|
|
}
|
|
if (object.outputs) {
|
|
if (!Array.isArray(object.outputs))
|
|
throw TypeError(".cosmos.bank.v1beta1.MsgMultiSend.outputs: array expected");
|
|
message.outputs = [];
|
|
for (var i = 0; i < object.outputs.length; ++i) {
|
|
if (typeof object.outputs[i] !== "object")
|
|
throw TypeError(".cosmos.bank.v1beta1.MsgMultiSend.outputs: object expected");
|
|
message.outputs[i] = $root.cosmos.bank.v1beta1.Output.fromObject(object.outputs[i]);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgMultiSend message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.bank.v1beta1.MsgMultiSend
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.MsgMultiSend} message MsgMultiSend
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgMultiSend.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) {
|
|
object.inputs = [];
|
|
object.outputs = [];
|
|
}
|
|
if (message.inputs && message.inputs.length) {
|
|
object.inputs = [];
|
|
for (var j = 0; j < message.inputs.length; ++j)
|
|
object.inputs[j] = $root.cosmos.bank.v1beta1.Input.toObject(message.inputs[j], options);
|
|
}
|
|
if (message.outputs && message.outputs.length) {
|
|
object.outputs = [];
|
|
for (var j = 0; j < message.outputs.length; ++j)
|
|
object.outputs[j] = $root.cosmos.bank.v1beta1.Output.toObject(message.outputs[j], options);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgMultiSend to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.bank.v1beta1.MsgMultiSend
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgMultiSend.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgMultiSend;
|
|
})(v1beta1.MsgMultiSend || {});
|
|
|
|
v1beta1.MsgMultiSendResponse = (function(MsgMultiSendResponse) {
|
|
|
|
/**
|
|
* Properties of a MsgMultiSendResponse.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @interface IMsgMultiSendResponse
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgMultiSendResponse.
|
|
* @memberof cosmos.bank.v1beta1
|
|
* @classdesc Represents a MsgMultiSendResponse.
|
|
* @implements IMsgMultiSendResponse
|
|
* @constructor
|
|
* @param {cosmos.bank.v1beta1.IMsgMultiSendResponse=} [properties] Properties to set
|
|
*/
|
|
function MsgMultiSendResponse(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new MsgMultiSendResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.bank.v1beta1.MsgMultiSendResponse
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IMsgMultiSendResponse=} [properties] Properties to set
|
|
* @returns {cosmos.bank.v1beta1.MsgMultiSendResponse} MsgMultiSendResponse instance
|
|
*/
|
|
MsgMultiSendResponse.create = function create(properties) {
|
|
return new MsgMultiSendResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgMultiSendResponse message. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSendResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.bank.v1beta1.MsgMultiSendResponse
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IMsgMultiSendResponse} message MsgMultiSendResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgMultiSendResponse.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgMultiSendResponse message, length delimited. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSendResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.bank.v1beta1.MsgMultiSendResponse
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.IMsgMultiSendResponse} message MsgMultiSendResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgMultiSendResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgMultiSendResponse message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.bank.v1beta1.MsgMultiSendResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.bank.v1beta1.MsgMultiSendResponse} MsgMultiSendResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgMultiSendResponse.decode = 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.bank.v1beta1.MsgMultiSendResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgMultiSendResponse message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.bank.v1beta1.MsgMultiSendResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.bank.v1beta1.MsgMultiSendResponse} MsgMultiSendResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgMultiSendResponse.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgMultiSendResponse message.
|
|
* @function verify
|
|
* @memberof cosmos.bank.v1beta1.MsgMultiSendResponse
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgMultiSendResponse.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgMultiSendResponse message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.bank.v1beta1.MsgMultiSendResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.bank.v1beta1.MsgMultiSendResponse} MsgMultiSendResponse
|
|
*/
|
|
MsgMultiSendResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.bank.v1beta1.MsgMultiSendResponse)
|
|
return object;
|
|
return new $root.cosmos.bank.v1beta1.MsgMultiSendResponse();
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgMultiSendResponse message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.bank.v1beta1.MsgMultiSendResponse
|
|
* @static
|
|
* @param {cosmos.bank.v1beta1.MsgMultiSendResponse} message MsgMultiSendResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgMultiSendResponse.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgMultiSendResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.bank.v1beta1.MsgMultiSendResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgMultiSendResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgMultiSendResponse;
|
|
})(v1beta1.MsgMultiSendResponse || {});
|
|
|
|
return v1beta1;
|
|
})(bank.v1beta1 || {});
|
|
|
|
return bank;
|
|
})(cosmos.bank || {});
|
|
|
|
/**
|
|
* Namespace gov.
|
|
* @memberof cosmos
|
|
* @namespace
|
|
*/
|
|
|
|
cosmos.gov = (function(gov) {
|
|
|
|
/**
|
|
* Namespace v1beta1.
|
|
* @memberof cosmos.gov
|
|
* @namespace
|
|
*/
|
|
|
|
gov.v1beta1 = (function(v1beta1) {
|
|
|
|
/**
|
|
* VoteOption enum.
|
|
* @name cosmos.gov.v1beta1.VoteOption
|
|
* @enum {string}
|
|
* @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.TextProposal = (function(TextProposal) {
|
|
|
|
/**
|
|
* 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 = "";
|
|
|
|
/**
|
|
* Creates a new TextProposal instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.gov.v1beta1.TextProposal
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.ITextProposal=} [properties] Properties to set
|
|
* @returns {cosmos.gov.v1beta1.TextProposal} TextProposal instance
|
|
*/
|
|
TextProposal.create = function create(properties) {
|
|
return new TextProposal(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
TextProposal.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return TextProposal;
|
|
})(v1beta1.TextProposal || {});
|
|
|
|
v1beta1.Deposit = (function(Deposit) {
|
|
|
|
/**
|
|
* Properties of a Deposit.
|
|
* @memberof cosmos.gov.v1beta1
|
|
* @interface IDeposit
|
|
* @property {number|Long|null} [proposalId] Deposit proposalId
|
|
* @property {string|null} [depositor] Deposit depositor
|
|
* @property {Array.<cosmos.base.v1beta1.ICoin>|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 proposalId.
|
|
* @member {number|Long} proposalId
|
|
* @memberof cosmos.gov.v1beta1.Deposit
|
|
* @instance
|
|
*/
|
|
Deposit.prototype.proposalId = $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.<cosmos.base.v1beta1.ICoin>} amount
|
|
* @memberof cosmos.gov.v1beta1.Deposit
|
|
* @instance
|
|
*/
|
|
Deposit.prototype.amount = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new Deposit instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.gov.v1beta1.Deposit
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.IDeposit=} [properties] Properties to set
|
|
* @returns {cosmos.gov.v1beta1.Deposit} Deposit instance
|
|
*/
|
|
Deposit.create = function create(properties) {
|
|
return new Deposit(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.proposalId != null && Object.hasOwnProperty.call(message, "proposalId"))
|
|
writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId);
|
|
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.proposalId = 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.<string,*>} 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.proposalId != null && message.hasOwnProperty("proposalId"))
|
|
if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high)))
|
|
return "proposalId: 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.<string,*>} 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.proposalId != null)
|
|
if ($util.Long)
|
|
(message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true;
|
|
else if (typeof object.proposalId === "string")
|
|
message.proposalId = parseInt(object.proposalId, 10);
|
|
else if (typeof object.proposalId === "number")
|
|
message.proposalId = object.proposalId;
|
|
else if (typeof object.proposalId === "object")
|
|
message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.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.<string,*>} 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.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.proposalId = options.longs === String ? "0" : 0;
|
|
object.depositor = "";
|
|
}
|
|
if (message.proposalId != null && message.hasOwnProperty("proposalId"))
|
|
if (typeof message.proposalId === "number")
|
|
object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId;
|
|
else
|
|
object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId;
|
|
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.<string,*>} JSON object
|
|
*/
|
|
Deposit.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Deposit;
|
|
})(v1beta1.Deposit || {});
|
|
|
|
v1beta1.Proposal = (function(Proposal) {
|
|
|
|
/**
|
|
* Properties of a Proposal.
|
|
* @memberof cosmos.gov.v1beta1
|
|
* @interface IProposal
|
|
* @property {number|Long|null} [proposalId] Proposal proposalId
|
|
* @property {google.protobuf.IAny|null} [content] Proposal content
|
|
* @property {cosmos.gov.v1beta1.ProposalStatus|null} [status] Proposal status
|
|
* @property {cosmos.gov.v1beta1.ITallyResult|null} [finalTallyResult] Proposal finalTallyResult
|
|
* @property {google.protobuf.ITimestamp|null} [submitTime] Proposal submitTime
|
|
* @property {google.protobuf.ITimestamp|null} [depositEndTime] Proposal depositEndTime
|
|
* @property {Array.<cosmos.base.v1beta1.ICoin>|null} [totalDeposit] Proposal totalDeposit
|
|
* @property {google.protobuf.ITimestamp|null} [votingStartTime] Proposal votingStartTime
|
|
* @property {google.protobuf.ITimestamp|null} [votingEndTime] Proposal votingEndTime
|
|
*/
|
|
|
|
/**
|
|
* 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.totalDeposit = [];
|
|
if (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 proposalId.
|
|
* @member {number|Long} proposalId
|
|
* @memberof cosmos.gov.v1beta1.Proposal
|
|
* @instance
|
|
*/
|
|
Proposal.prototype.proposalId = $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 finalTallyResult.
|
|
* @member {cosmos.gov.v1beta1.ITallyResult|null|undefined} finalTallyResult
|
|
* @memberof cosmos.gov.v1beta1.Proposal
|
|
* @instance
|
|
*/
|
|
Proposal.prototype.finalTallyResult = null;
|
|
|
|
/**
|
|
* Proposal submitTime.
|
|
* @member {google.protobuf.ITimestamp|null|undefined} submitTime
|
|
* @memberof cosmos.gov.v1beta1.Proposal
|
|
* @instance
|
|
*/
|
|
Proposal.prototype.submitTime = null;
|
|
|
|
/**
|
|
* Proposal depositEndTime.
|
|
* @member {google.protobuf.ITimestamp|null|undefined} depositEndTime
|
|
* @memberof cosmos.gov.v1beta1.Proposal
|
|
* @instance
|
|
*/
|
|
Proposal.prototype.depositEndTime = null;
|
|
|
|
/**
|
|
* Proposal totalDeposit.
|
|
* @member {Array.<cosmos.base.v1beta1.ICoin>} totalDeposit
|
|
* @memberof cosmos.gov.v1beta1.Proposal
|
|
* @instance
|
|
*/
|
|
Proposal.prototype.totalDeposit = $util.emptyArray;
|
|
|
|
/**
|
|
* Proposal votingStartTime.
|
|
* @member {google.protobuf.ITimestamp|null|undefined} votingStartTime
|
|
* @memberof cosmos.gov.v1beta1.Proposal
|
|
* @instance
|
|
*/
|
|
Proposal.prototype.votingStartTime = null;
|
|
|
|
/**
|
|
* Proposal votingEndTime.
|
|
* @member {google.protobuf.ITimestamp|null|undefined} votingEndTime
|
|
* @memberof cosmos.gov.v1beta1.Proposal
|
|
* @instance
|
|
*/
|
|
Proposal.prototype.votingEndTime = null;
|
|
|
|
/**
|
|
* Creates a new Proposal instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.gov.v1beta1.Proposal
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.IProposal=} [properties] Properties to set
|
|
* @returns {cosmos.gov.v1beta1.Proposal} Proposal instance
|
|
*/
|
|
Proposal.create = function create(properties) {
|
|
return new Proposal(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.proposalId != null && Object.hasOwnProperty.call(message, "proposalId"))
|
|
writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId);
|
|
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.finalTallyResult != null && Object.hasOwnProperty.call(message, "finalTallyResult"))
|
|
$root.cosmos.gov.v1beta1.TallyResult.encode(message.finalTallyResult, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
|
if (message.submitTime != null && Object.hasOwnProperty.call(message, "submitTime"))
|
|
$root.google.protobuf.Timestamp.encode(message.submitTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
|
if (message.depositEndTime != null && Object.hasOwnProperty.call(message, "depositEndTime"))
|
|
$root.google.protobuf.Timestamp.encode(message.depositEndTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
|
if (message.totalDeposit != null && message.totalDeposit.length)
|
|
for (var i = 0; i < message.totalDeposit.length; ++i)
|
|
$root.cosmos.base.v1beta1.Coin.encode(message.totalDeposit[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
|
if (message.votingStartTime != null && Object.hasOwnProperty.call(message, "votingStartTime"))
|
|
$root.google.protobuf.Timestamp.encode(message.votingStartTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
|
if (message.votingEndTime != null && Object.hasOwnProperty.call(message, "votingEndTime"))
|
|
$root.google.protobuf.Timestamp.encode(message.votingEndTime, 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.proposalId = 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.finalTallyResult = $root.cosmos.gov.v1beta1.TallyResult.decode(reader, reader.uint32());
|
|
break;
|
|
case 5:
|
|
message.submitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
|
break;
|
|
case 6:
|
|
message.depositEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
|
break;
|
|
case 7:
|
|
if (!(message.totalDeposit && message.totalDeposit.length))
|
|
message.totalDeposit = [];
|
|
message.totalDeposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()));
|
|
break;
|
|
case 8:
|
|
message.votingStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
|
break;
|
|
case 9:
|
|
message.votingEndTime = $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.<string,*>} 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.proposalId != null && message.hasOwnProperty("proposalId"))
|
|
if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high)))
|
|
return "proposalId: 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.finalTallyResult != null && message.hasOwnProperty("finalTallyResult")) {
|
|
var error = $root.cosmos.gov.v1beta1.TallyResult.verify(message.finalTallyResult);
|
|
if (error)
|
|
return "finalTallyResult." + error;
|
|
}
|
|
if (message.submitTime != null && message.hasOwnProperty("submitTime")) {
|
|
var error = $root.google.protobuf.Timestamp.verify(message.submitTime);
|
|
if (error)
|
|
return "submitTime." + error;
|
|
}
|
|
if (message.depositEndTime != null && message.hasOwnProperty("depositEndTime")) {
|
|
var error = $root.google.protobuf.Timestamp.verify(message.depositEndTime);
|
|
if (error)
|
|
return "depositEndTime." + error;
|
|
}
|
|
if (message.totalDeposit != null && message.hasOwnProperty("totalDeposit")) {
|
|
if (!Array.isArray(message.totalDeposit))
|
|
return "totalDeposit: array expected";
|
|
for (var i = 0; i < message.totalDeposit.length; ++i) {
|
|
var error = $root.cosmos.base.v1beta1.Coin.verify(message.totalDeposit[i]);
|
|
if (error)
|
|
return "totalDeposit." + error;
|
|
}
|
|
}
|
|
if (message.votingStartTime != null && message.hasOwnProperty("votingStartTime")) {
|
|
var error = $root.google.protobuf.Timestamp.verify(message.votingStartTime);
|
|
if (error)
|
|
return "votingStartTime." + error;
|
|
}
|
|
if (message.votingEndTime != null && message.hasOwnProperty("votingEndTime")) {
|
|
var error = $root.google.protobuf.Timestamp.verify(message.votingEndTime);
|
|
if (error)
|
|
return "votingEndTime." + 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.<string,*>} 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.proposalId != null)
|
|
if ($util.Long)
|
|
(message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true;
|
|
else if (typeof object.proposalId === "string")
|
|
message.proposalId = parseInt(object.proposalId, 10);
|
|
else if (typeof object.proposalId === "number")
|
|
message.proposalId = object.proposalId;
|
|
else if (typeof object.proposalId === "object")
|
|
message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.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.finalTallyResult != null) {
|
|
if (typeof object.finalTallyResult !== "object")
|
|
throw TypeError(".cosmos.gov.v1beta1.Proposal.finalTallyResult: object expected");
|
|
message.finalTallyResult = $root.cosmos.gov.v1beta1.TallyResult.fromObject(object.finalTallyResult);
|
|
}
|
|
if (object.submitTime != null) {
|
|
if (typeof object.submitTime !== "object")
|
|
throw TypeError(".cosmos.gov.v1beta1.Proposal.submitTime: object expected");
|
|
message.submitTime = $root.google.protobuf.Timestamp.fromObject(object.submitTime);
|
|
}
|
|
if (object.depositEndTime != null) {
|
|
if (typeof object.depositEndTime !== "object")
|
|
throw TypeError(".cosmos.gov.v1beta1.Proposal.depositEndTime: object expected");
|
|
message.depositEndTime = $root.google.protobuf.Timestamp.fromObject(object.depositEndTime);
|
|
}
|
|
if (object.totalDeposit) {
|
|
if (!Array.isArray(object.totalDeposit))
|
|
throw TypeError(".cosmos.gov.v1beta1.Proposal.totalDeposit: array expected");
|
|
message.totalDeposit = [];
|
|
for (var i = 0; i < object.totalDeposit.length; ++i) {
|
|
if (typeof object.totalDeposit[i] !== "object")
|
|
throw TypeError(".cosmos.gov.v1beta1.Proposal.totalDeposit: object expected");
|
|
message.totalDeposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.totalDeposit[i]);
|
|
}
|
|
}
|
|
if (object.votingStartTime != null) {
|
|
if (typeof object.votingStartTime !== "object")
|
|
throw TypeError(".cosmos.gov.v1beta1.Proposal.votingStartTime: object expected");
|
|
message.votingStartTime = $root.google.protobuf.Timestamp.fromObject(object.votingStartTime);
|
|
}
|
|
if (object.votingEndTime != null) {
|
|
if (typeof object.votingEndTime !== "object")
|
|
throw TypeError(".cosmos.gov.v1beta1.Proposal.votingEndTime: object expected");
|
|
message.votingEndTime = $root.google.protobuf.Timestamp.fromObject(object.votingEndTime);
|
|
}
|
|
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.<string,*>} Plain object
|
|
*/
|
|
Proposal.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.totalDeposit = [];
|
|
if (options.defaults) {
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, true);
|
|
object.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.proposalId = options.longs === String ? "0" : 0;
|
|
object.content = null;
|
|
object.status = options.enums === String ? "PROPOSAL_STATUS_UNSPECIFIED" : 0;
|
|
object.finalTallyResult = null;
|
|
object.submitTime = null;
|
|
object.depositEndTime = null;
|
|
object.votingStartTime = null;
|
|
object.votingEndTime = null;
|
|
}
|
|
if (message.proposalId != null && message.hasOwnProperty("proposalId"))
|
|
if (typeof message.proposalId === "number")
|
|
object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId;
|
|
else
|
|
object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId;
|
|
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.finalTallyResult != null && message.hasOwnProperty("finalTallyResult"))
|
|
object.finalTallyResult = $root.cosmos.gov.v1beta1.TallyResult.toObject(message.finalTallyResult, options);
|
|
if (message.submitTime != null && message.hasOwnProperty("submitTime"))
|
|
object.submitTime = $root.google.protobuf.Timestamp.toObject(message.submitTime, options);
|
|
if (message.depositEndTime != null && message.hasOwnProperty("depositEndTime"))
|
|
object.depositEndTime = $root.google.protobuf.Timestamp.toObject(message.depositEndTime, options);
|
|
if (message.totalDeposit && message.totalDeposit.length) {
|
|
object.totalDeposit = [];
|
|
for (var j = 0; j < message.totalDeposit.length; ++j)
|
|
object.totalDeposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.totalDeposit[j], options);
|
|
}
|
|
if (message.votingStartTime != null && message.hasOwnProperty("votingStartTime"))
|
|
object.votingStartTime = $root.google.protobuf.Timestamp.toObject(message.votingStartTime, options);
|
|
if (message.votingEndTime != null && message.hasOwnProperty("votingEndTime"))
|
|
object.votingEndTime = $root.google.protobuf.Timestamp.toObject(message.votingEndTime, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Proposal to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.gov.v1beta1.Proposal
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Proposal.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Proposal;
|
|
})(v1beta1.Proposal || {});
|
|
|
|
/**
|
|
* ProposalStatus enum.
|
|
* @name cosmos.gov.v1beta1.ProposalStatus
|
|
* @enum {string}
|
|
* @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(TallyResult) {
|
|
|
|
/**
|
|
* 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} [noWithVeto] TallyResult noWithVeto
|
|
*/
|
|
|
|
/**
|
|
* 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 noWithVeto.
|
|
* @member {string} noWithVeto
|
|
* @memberof cosmos.gov.v1beta1.TallyResult
|
|
* @instance
|
|
*/
|
|
TallyResult.prototype.noWithVeto = "";
|
|
|
|
/**
|
|
* Creates a new TallyResult instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.gov.v1beta1.TallyResult
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.ITallyResult=} [properties] Properties to set
|
|
* @returns {cosmos.gov.v1beta1.TallyResult} TallyResult instance
|
|
*/
|
|
TallyResult.create = function create(properties) {
|
|
return new TallyResult(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.noWithVeto != null && Object.hasOwnProperty.call(message, "noWithVeto"))
|
|
writer.uint32(/* id 4, wireType 2 =*/34).string(message.noWithVeto);
|
|
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.noWithVeto = 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.<string,*>} 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.noWithVeto != null && message.hasOwnProperty("noWithVeto"))
|
|
if (!$util.isString(message.noWithVeto))
|
|
return "noWithVeto: 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.<string,*>} 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.noWithVeto != null)
|
|
message.noWithVeto = String(object.noWithVeto);
|
|
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.<string,*>} Plain object
|
|
*/
|
|
TallyResult.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.yes = "";
|
|
object.abstain = "";
|
|
object.no = "";
|
|
object.noWithVeto = "";
|
|
}
|
|
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.noWithVeto != null && message.hasOwnProperty("noWithVeto"))
|
|
object.noWithVeto = message.noWithVeto;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this TallyResult to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.gov.v1beta1.TallyResult
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
TallyResult.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return TallyResult;
|
|
})(v1beta1.TallyResult || {});
|
|
|
|
v1beta1.Vote = (function(Vote) {
|
|
|
|
/**
|
|
* Properties of a Vote.
|
|
* @memberof cosmos.gov.v1beta1
|
|
* @interface IVote
|
|
* @property {number|Long|null} [proposalId] Vote proposalId
|
|
* @property {string|null} [voter] Vote voter
|
|
* @property {cosmos.gov.v1beta1.VoteOption|null} [option] Vote option
|
|
*/
|
|
|
|
/**
|
|
* 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) {
|
|
if (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 proposalId.
|
|
* @member {number|Long} proposalId
|
|
* @memberof cosmos.gov.v1beta1.Vote
|
|
* @instance
|
|
*/
|
|
Vote.prototype.proposalId = $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;
|
|
|
|
/**
|
|
* Creates a new Vote instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.gov.v1beta1.Vote
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.IVote=} [properties] Properties to set
|
|
* @returns {cosmos.gov.v1beta1.Vote} Vote instance
|
|
*/
|
|
Vote.create = function create(properties) {
|
|
return new Vote(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.proposalId != null && Object.hasOwnProperty.call(message, "proposalId"))
|
|
writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId);
|
|
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);
|
|
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.proposalId = reader.uint64();
|
|
break;
|
|
case 2:
|
|
message.voter = reader.string();
|
|
break;
|
|
case 3:
|
|
message.option = reader.int32();
|
|
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.<string,*>} 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.proposalId != null && message.hasOwnProperty("proposalId"))
|
|
if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high)))
|
|
return "proposalId: 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;
|
|
}
|
|
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.<string,*>} 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.proposalId != null)
|
|
if ($util.Long)
|
|
(message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true;
|
|
else if (typeof object.proposalId === "string")
|
|
message.proposalId = parseInt(object.proposalId, 10);
|
|
else if (typeof object.proposalId === "number")
|
|
message.proposalId = object.proposalId;
|
|
else if (typeof object.proposalId === "object")
|
|
message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.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;
|
|
}
|
|
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.<string,*>} Plain object
|
|
*/
|
|
Vote.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.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.proposalId = options.longs === String ? "0" : 0;
|
|
object.voter = "";
|
|
object.option = options.enums === String ? "VOTE_OPTION_UNSPECIFIED" : 0;
|
|
}
|
|
if (message.proposalId != null && message.hasOwnProperty("proposalId"))
|
|
if (typeof message.proposalId === "number")
|
|
object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId;
|
|
else
|
|
object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId;
|
|
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;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Vote to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.gov.v1beta1.Vote
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Vote.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Vote;
|
|
})(v1beta1.Vote || {});
|
|
|
|
v1beta1.DepositParams = (function(DepositParams) {
|
|
|
|
/**
|
|
* Properties of a DepositParams.
|
|
* @memberof cosmos.gov.v1beta1
|
|
* @interface IDepositParams
|
|
* @property {Array.<cosmos.base.v1beta1.ICoin>|null} [minDeposit] DepositParams minDeposit
|
|
* @property {google.protobuf.IDuration|null} [maxDepositPeriod] DepositParams maxDepositPeriod
|
|
*/
|
|
|
|
/**
|
|
* 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.minDeposit = [];
|
|
if (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 minDeposit.
|
|
* @member {Array.<cosmos.base.v1beta1.ICoin>} minDeposit
|
|
* @memberof cosmos.gov.v1beta1.DepositParams
|
|
* @instance
|
|
*/
|
|
DepositParams.prototype.minDeposit = $util.emptyArray;
|
|
|
|
/**
|
|
* DepositParams maxDepositPeriod.
|
|
* @member {google.protobuf.IDuration|null|undefined} maxDepositPeriod
|
|
* @memberof cosmos.gov.v1beta1.DepositParams
|
|
* @instance
|
|
*/
|
|
DepositParams.prototype.maxDepositPeriod = null;
|
|
|
|
/**
|
|
* Creates a new DepositParams instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.gov.v1beta1.DepositParams
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.IDepositParams=} [properties] Properties to set
|
|
* @returns {cosmos.gov.v1beta1.DepositParams} DepositParams instance
|
|
*/
|
|
DepositParams.create = function create(properties) {
|
|
return new DepositParams(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.minDeposit != null && message.minDeposit.length)
|
|
for (var i = 0; i < message.minDeposit.length; ++i)
|
|
$root.cosmos.base.v1beta1.Coin.encode(message.minDeposit[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.maxDepositPeriod != null && Object.hasOwnProperty.call(message, "maxDepositPeriod"))
|
|
$root.google.protobuf.Duration.encode(message.maxDepositPeriod, 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.minDeposit && message.minDeposit.length))
|
|
message.minDeposit = [];
|
|
message.minDeposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()));
|
|
break;
|
|
case 2:
|
|
message.maxDepositPeriod = $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.<string,*>} 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.minDeposit != null && message.hasOwnProperty("minDeposit")) {
|
|
if (!Array.isArray(message.minDeposit))
|
|
return "minDeposit: array expected";
|
|
for (var i = 0; i < message.minDeposit.length; ++i) {
|
|
var error = $root.cosmos.base.v1beta1.Coin.verify(message.minDeposit[i]);
|
|
if (error)
|
|
return "minDeposit." + error;
|
|
}
|
|
}
|
|
if (message.maxDepositPeriod != null && message.hasOwnProperty("maxDepositPeriod")) {
|
|
var error = $root.google.protobuf.Duration.verify(message.maxDepositPeriod);
|
|
if (error)
|
|
return "maxDepositPeriod." + 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.<string,*>} 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.minDeposit) {
|
|
if (!Array.isArray(object.minDeposit))
|
|
throw TypeError(".cosmos.gov.v1beta1.DepositParams.minDeposit: array expected");
|
|
message.minDeposit = [];
|
|
for (var i = 0; i < object.minDeposit.length; ++i) {
|
|
if (typeof object.minDeposit[i] !== "object")
|
|
throw TypeError(".cosmos.gov.v1beta1.DepositParams.minDeposit: object expected");
|
|
message.minDeposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.minDeposit[i]);
|
|
}
|
|
}
|
|
if (object.maxDepositPeriod != null) {
|
|
if (typeof object.maxDepositPeriod !== "object")
|
|
throw TypeError(".cosmos.gov.v1beta1.DepositParams.maxDepositPeriod: object expected");
|
|
message.maxDepositPeriod = $root.google.protobuf.Duration.fromObject(object.maxDepositPeriod);
|
|
}
|
|
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.<string,*>} Plain object
|
|
*/
|
|
DepositParams.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.minDeposit = [];
|
|
if (options.defaults)
|
|
object.maxDepositPeriod = null;
|
|
if (message.minDeposit && message.minDeposit.length) {
|
|
object.minDeposit = [];
|
|
for (var j = 0; j < message.minDeposit.length; ++j)
|
|
object.minDeposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.minDeposit[j], options);
|
|
}
|
|
if (message.maxDepositPeriod != null && message.hasOwnProperty("maxDepositPeriod"))
|
|
object.maxDepositPeriod = $root.google.protobuf.Duration.toObject(message.maxDepositPeriod, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this DepositParams to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.gov.v1beta1.DepositParams
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
DepositParams.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return DepositParams;
|
|
})(v1beta1.DepositParams || {});
|
|
|
|
v1beta1.VotingParams = (function(VotingParams) {
|
|
|
|
/**
|
|
* Properties of a VotingParams.
|
|
* @memberof cosmos.gov.v1beta1
|
|
* @interface IVotingParams
|
|
* @property {google.protobuf.IDuration|null} [votingPeriod] VotingParams votingPeriod
|
|
*/
|
|
|
|
/**
|
|
* 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 votingPeriod.
|
|
* @member {google.protobuf.IDuration|null|undefined} votingPeriod
|
|
* @memberof cosmos.gov.v1beta1.VotingParams
|
|
* @instance
|
|
*/
|
|
VotingParams.prototype.votingPeriod = null;
|
|
|
|
/**
|
|
* Creates a new VotingParams instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.gov.v1beta1.VotingParams
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.IVotingParams=} [properties] Properties to set
|
|
* @returns {cosmos.gov.v1beta1.VotingParams} VotingParams instance
|
|
*/
|
|
VotingParams.create = function create(properties) {
|
|
return new VotingParams(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.votingPeriod != null && Object.hasOwnProperty.call(message, "votingPeriod"))
|
|
$root.google.protobuf.Duration.encode(message.votingPeriod, 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.votingPeriod = $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.<string,*>} 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.votingPeriod != null && message.hasOwnProperty("votingPeriod")) {
|
|
var error = $root.google.protobuf.Duration.verify(message.votingPeriod);
|
|
if (error)
|
|
return "votingPeriod." + 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.<string,*>} 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.votingPeriod != null) {
|
|
if (typeof object.votingPeriod !== "object")
|
|
throw TypeError(".cosmos.gov.v1beta1.VotingParams.votingPeriod: object expected");
|
|
message.votingPeriod = $root.google.protobuf.Duration.fromObject(object.votingPeriod);
|
|
}
|
|
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.<string,*>} Plain object
|
|
*/
|
|
VotingParams.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults)
|
|
object.votingPeriod = null;
|
|
if (message.votingPeriod != null && message.hasOwnProperty("votingPeriod"))
|
|
object.votingPeriod = $root.google.protobuf.Duration.toObject(message.votingPeriod, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this VotingParams to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.gov.v1beta1.VotingParams
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
VotingParams.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return VotingParams;
|
|
})(v1beta1.VotingParams || {});
|
|
|
|
v1beta1.TallyParams = (function(TallyParams) {
|
|
|
|
/**
|
|
* 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} [vetoThreshold] TallyParams vetoThreshold
|
|
*/
|
|
|
|
/**
|
|
* 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 vetoThreshold.
|
|
* @member {Uint8Array} vetoThreshold
|
|
* @memberof cosmos.gov.v1beta1.TallyParams
|
|
* @instance
|
|
*/
|
|
TallyParams.prototype.vetoThreshold = $util.newBuffer([]);
|
|
|
|
/**
|
|
* Creates a new TallyParams instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.gov.v1beta1.TallyParams
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.ITallyParams=} [properties] Properties to set
|
|
* @returns {cosmos.gov.v1beta1.TallyParams} TallyParams instance
|
|
*/
|
|
TallyParams.create = function create(properties) {
|
|
return new TallyParams(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.vetoThreshold != null && Object.hasOwnProperty.call(message, "vetoThreshold"))
|
|
writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.vetoThreshold);
|
|
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.vetoThreshold = 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.<string,*>} 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.vetoThreshold != null && message.hasOwnProperty("vetoThreshold"))
|
|
if (!(message.vetoThreshold && typeof message.vetoThreshold.length === "number" || $util.isString(message.vetoThreshold)))
|
|
return "vetoThreshold: 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.<string,*>} 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.vetoThreshold != null)
|
|
if (typeof object.vetoThreshold === "string")
|
|
$util.base64.decode(object.vetoThreshold, message.vetoThreshold = $util.newBuffer($util.base64.length(object.vetoThreshold)), 0);
|
|
else if (object.vetoThreshold.length)
|
|
message.vetoThreshold = object.vetoThreshold;
|
|
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.<string,*>} 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.vetoThreshold = "";
|
|
else {
|
|
object.vetoThreshold = [];
|
|
if (options.bytes !== Array)
|
|
object.vetoThreshold = $util.newBuffer(object.vetoThreshold);
|
|
}
|
|
}
|
|
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.vetoThreshold != null && message.hasOwnProperty("vetoThreshold"))
|
|
object.vetoThreshold = options.bytes === String ? $util.base64.encode(message.vetoThreshold, 0, message.vetoThreshold.length) : options.bytes === Array ? Array.prototype.slice.call(message.vetoThreshold) : message.vetoThreshold;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this TallyParams to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.gov.v1beta1.TallyParams
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
TallyParams.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return TallyParams;
|
|
})(v1beta1.TallyParams || {});
|
|
|
|
v1beta1.Msg = (function(Msg) {
|
|
|
|
/**
|
|
* Constructs a new Msg service.
|
|
* @memberof cosmos.gov.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;
|
|
|
|
/**
|
|
* Creates new Msg service using the specified rpc implementation.
|
|
* @function create
|
|
* @memberof cosmos.gov.v1beta1.Msg
|
|
* @static
|
|
* @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
|
* @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
|
* @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
|
* @returns {Msg} RPC service. Useful where requests and/or responses are streamed.
|
|
*/
|
|
Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
|
return new this(rpcImpl, requestDelimited, responseDelimited);
|
|
};
|
|
|
|
/**
|
|
* Callback as used by {@link cosmos.gov.v1beta1.Msg#submitProposal}.
|
|
* @memberof cosmos.gov.v1beta1.Msg
|
|
* @typedef SubmitProposalCallback
|
|
* @type {function}
|
|
* @param {Error|null} error Error, if any
|
|
* @param {cosmos.gov.v1beta1.IMsgSubmitProposalResponse} [response] MsgSubmitProposalResponse
|
|
*/
|
|
|
|
/**
|
|
* Calls SubmitProposal.
|
|
* @function submitProposal
|
|
* @memberof cosmos.gov.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.gov.v1beta1.IMsgSubmitProposal} request MsgSubmitProposal message or plain object
|
|
* @param {cosmos.gov.v1beta1.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.gov.v1beta1.MsgSubmitProposal, $root.cosmos.gov.v1beta1.MsgSubmitProposalResponse, request, callback);
|
|
}, "name", { value: "SubmitProposal" });
|
|
|
|
/**
|
|
* Calls SubmitProposal.
|
|
* @function submitProposal
|
|
* @memberof cosmos.gov.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.gov.v1beta1.IMsgSubmitProposal} request MsgSubmitProposal message or plain object
|
|
* @returns {Promise<cosmos.gov.v1beta1.IMsgSubmitProposalResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
/**
|
|
* Callback as used by {@link cosmos.gov.v1beta1.Msg#vote}.
|
|
* @memberof cosmos.gov.v1beta1.Msg
|
|
* @typedef VoteCallback
|
|
* @type {function}
|
|
* @param {Error|null} error Error, if any
|
|
* @param {cosmos.gov.v1beta1.IMsgVoteResponse} [response] MsgVoteResponse
|
|
*/
|
|
|
|
/**
|
|
* Calls Vote.
|
|
* @function vote
|
|
* @memberof cosmos.gov.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.gov.v1beta1.IMsgVote} request MsgVote message or plain object
|
|
* @param {cosmos.gov.v1beta1.Msg.VoteCallback} callback Node-style callback called with the error, if any, and MsgVoteResponse
|
|
* @returns {undefined}
|
|
* @variation 1
|
|
*/
|
|
Object.defineProperty(Msg.prototype.vote = function vote(request, callback) {
|
|
return this.rpcCall(vote, $root.cosmos.gov.v1beta1.MsgVote, $root.cosmos.gov.v1beta1.MsgVoteResponse, request, callback);
|
|
}, "name", { value: "Vote" });
|
|
|
|
/**
|
|
* Calls Vote.
|
|
* @function vote
|
|
* @memberof cosmos.gov.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.gov.v1beta1.IMsgVote} request MsgVote message or plain object
|
|
* @returns {Promise<cosmos.gov.v1beta1.IMsgVoteResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
/**
|
|
* Callback as used by {@link cosmos.gov.v1beta1.Msg#deposit}.
|
|
* @memberof cosmos.gov.v1beta1.Msg
|
|
* @typedef DepositCallback
|
|
* @type {function}
|
|
* @param {Error|null} error Error, if any
|
|
* @param {cosmos.gov.v1beta1.IMsgDepositResponse} [response] MsgDepositResponse
|
|
*/
|
|
|
|
/**
|
|
* Calls Deposit.
|
|
* @function deposit
|
|
* @memberof cosmos.gov.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.gov.v1beta1.IMsgDeposit} request MsgDeposit message or plain object
|
|
* @param {cosmos.gov.v1beta1.Msg.DepositCallback} callback Node-style callback called with the error, if any, and MsgDepositResponse
|
|
* @returns {undefined}
|
|
* @variation 1
|
|
*/
|
|
Object.defineProperty(Msg.prototype.deposit = function deposit(request, callback) {
|
|
return this.rpcCall(deposit, $root.cosmos.gov.v1beta1.MsgDeposit, $root.cosmos.gov.v1beta1.MsgDepositResponse, request, callback);
|
|
}, "name", { value: "Deposit" });
|
|
|
|
/**
|
|
* Calls Deposit.
|
|
* @function deposit
|
|
* @memberof cosmos.gov.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.gov.v1beta1.IMsgDeposit} request MsgDeposit message or plain object
|
|
* @returns {Promise<cosmos.gov.v1beta1.IMsgDepositResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
return Msg;
|
|
})(v1beta1.Msg || {});
|
|
|
|
v1beta1.MsgSubmitProposal = (function(MsgSubmitProposal) {
|
|
|
|
/**
|
|
* Properties of a MsgSubmitProposal.
|
|
* @memberof cosmos.gov.v1beta1
|
|
* @interface IMsgSubmitProposal
|
|
* @property {google.protobuf.IAny|null} [content] MsgSubmitProposal content
|
|
* @property {Array.<cosmos.base.v1beta1.ICoin>|null} [initialDeposit] MsgSubmitProposal initialDeposit
|
|
* @property {string|null} [proposer] MsgSubmitProposal proposer
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgSubmitProposal.
|
|
* @memberof cosmos.gov.v1beta1
|
|
* @classdesc Represents a MsgSubmitProposal.
|
|
* @implements IMsgSubmitProposal
|
|
* @constructor
|
|
* @param {cosmos.gov.v1beta1.IMsgSubmitProposal=} [properties] Properties to set
|
|
*/
|
|
function MsgSubmitProposal(properties) {
|
|
this.initialDeposit = [];
|
|
if (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.gov.v1beta1.MsgSubmitProposal
|
|
* @instance
|
|
*/
|
|
MsgSubmitProposal.prototype.content = null;
|
|
|
|
/**
|
|
* MsgSubmitProposal initialDeposit.
|
|
* @member {Array.<cosmos.base.v1beta1.ICoin>} initialDeposit
|
|
* @memberof cosmos.gov.v1beta1.MsgSubmitProposal
|
|
* @instance
|
|
*/
|
|
MsgSubmitProposal.prototype.initialDeposit = $util.emptyArray;
|
|
|
|
/**
|
|
* MsgSubmitProposal proposer.
|
|
* @member {string} proposer
|
|
* @memberof cosmos.gov.v1beta1.MsgSubmitProposal
|
|
* @instance
|
|
*/
|
|
MsgSubmitProposal.prototype.proposer = "";
|
|
|
|
/**
|
|
* Creates a new MsgSubmitProposal instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.gov.v1beta1.MsgSubmitProposal
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.IMsgSubmitProposal=} [properties] Properties to set
|
|
* @returns {cosmos.gov.v1beta1.MsgSubmitProposal} MsgSubmitProposal instance
|
|
*/
|
|
MsgSubmitProposal.create = function create(properties) {
|
|
return new MsgSubmitProposal(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgSubmitProposal message. Does not implicitly {@link cosmos.gov.v1beta1.MsgSubmitProposal.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.gov.v1beta1.MsgSubmitProposal
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.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.initialDeposit != null && message.initialDeposit.length)
|
|
for (var i = 0; i < message.initialDeposit.length; ++i)
|
|
$root.cosmos.base.v1beta1.Coin.encode(message.initialDeposit[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
if (message.proposer != null && Object.hasOwnProperty.call(message, "proposer"))
|
|
writer.uint32(/* id 3, wireType 2 =*/26).string(message.proposer);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgSubmitProposal message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgSubmitProposal.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.gov.v1beta1.MsgSubmitProposal
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.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.gov.v1beta1.MsgSubmitProposal
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.gov.v1beta1.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.gov.v1beta1.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:
|
|
if (!(message.initialDeposit && message.initialDeposit.length))
|
|
message.initialDeposit = [];
|
|
message.initialDeposit.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()));
|
|
break;
|
|
case 3:
|
|
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.gov.v1beta1.MsgSubmitProposal
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.gov.v1beta1.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.gov.v1beta1.MsgSubmitProposal
|
|
* @static
|
|
* @param {Object.<string,*>} 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.initialDeposit != null && message.hasOwnProperty("initialDeposit")) {
|
|
if (!Array.isArray(message.initialDeposit))
|
|
return "initialDeposit: array expected";
|
|
for (var i = 0; i < message.initialDeposit.length; ++i) {
|
|
var error = $root.cosmos.base.v1beta1.Coin.verify(message.initialDeposit[i]);
|
|
if (error)
|
|
return "initialDeposit." + 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.gov.v1beta1.MsgSubmitProposal
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.gov.v1beta1.MsgSubmitProposal} MsgSubmitProposal
|
|
*/
|
|
MsgSubmitProposal.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.gov.v1beta1.MsgSubmitProposal)
|
|
return object;
|
|
var message = new $root.cosmos.gov.v1beta1.MsgSubmitProposal();
|
|
if (object.content != null) {
|
|
if (typeof object.content !== "object")
|
|
throw TypeError(".cosmos.gov.v1beta1.MsgSubmitProposal.content: object expected");
|
|
message.content = $root.google.protobuf.Any.fromObject(object.content);
|
|
}
|
|
if (object.initialDeposit) {
|
|
if (!Array.isArray(object.initialDeposit))
|
|
throw TypeError(".cosmos.gov.v1beta1.MsgSubmitProposal.initialDeposit: array expected");
|
|
message.initialDeposit = [];
|
|
for (var i = 0; i < object.initialDeposit.length; ++i) {
|
|
if (typeof object.initialDeposit[i] !== "object")
|
|
throw TypeError(".cosmos.gov.v1beta1.MsgSubmitProposal.initialDeposit: object expected");
|
|
message.initialDeposit[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.initialDeposit[i]);
|
|
}
|
|
}
|
|
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.gov.v1beta1.MsgSubmitProposal
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.MsgSubmitProposal} message MsgSubmitProposal
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgSubmitProposal.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.initialDeposit = [];
|
|
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.initialDeposit && message.initialDeposit.length) {
|
|
object.initialDeposit = [];
|
|
for (var j = 0; j < message.initialDeposit.length; ++j)
|
|
object.initialDeposit[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.initialDeposit[j], options);
|
|
}
|
|
if (message.proposer != null && message.hasOwnProperty("proposer"))
|
|
object.proposer = message.proposer;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgSubmitProposal to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.gov.v1beta1.MsgSubmitProposal
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgSubmitProposal.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgSubmitProposal;
|
|
})(v1beta1.MsgSubmitProposal || {});
|
|
|
|
v1beta1.MsgSubmitProposalResponse = (function(MsgSubmitProposalResponse) {
|
|
|
|
/**
|
|
* Properties of a MsgSubmitProposalResponse.
|
|
* @memberof cosmos.gov.v1beta1
|
|
* @interface IMsgSubmitProposalResponse
|
|
* @property {number|Long|null} [proposalId] MsgSubmitProposalResponse proposalId
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgSubmitProposalResponse.
|
|
* @memberof cosmos.gov.v1beta1
|
|
* @classdesc Represents a MsgSubmitProposalResponse.
|
|
* @implements IMsgSubmitProposalResponse
|
|
* @constructor
|
|
* @param {cosmos.gov.v1beta1.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 proposalId.
|
|
* @member {number|Long} proposalId
|
|
* @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse
|
|
* @instance
|
|
*/
|
|
MsgSubmitProposalResponse.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* Creates a new MsgSubmitProposalResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.IMsgSubmitProposalResponse=} [properties] Properties to set
|
|
* @returns {cosmos.gov.v1beta1.MsgSubmitProposalResponse} MsgSubmitProposalResponse instance
|
|
*/
|
|
MsgSubmitProposalResponse.create = function create(properties) {
|
|
return new MsgSubmitProposalResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgSubmitProposalResponse message. Does not implicitly {@link cosmos.gov.v1beta1.MsgSubmitProposalResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.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.proposalId != null && Object.hasOwnProperty.call(message, "proposalId"))
|
|
writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgSubmitProposalResponse message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgSubmitProposalResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.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.gov.v1beta1.MsgSubmitProposalResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.gov.v1beta1.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.gov.v1beta1.MsgSubmitProposalResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.proposalId = 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.gov.v1beta1.MsgSubmitProposalResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.gov.v1beta1.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.gov.v1beta1.MsgSubmitProposalResponse
|
|
* @static
|
|
* @param {Object.<string,*>} 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.proposalId != null && message.hasOwnProperty("proposalId"))
|
|
if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high)))
|
|
return "proposalId: 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.gov.v1beta1.MsgSubmitProposalResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.gov.v1beta1.MsgSubmitProposalResponse} MsgSubmitProposalResponse
|
|
*/
|
|
MsgSubmitProposalResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.gov.v1beta1.MsgSubmitProposalResponse)
|
|
return object;
|
|
var message = new $root.cosmos.gov.v1beta1.MsgSubmitProposalResponse();
|
|
if (object.proposalId != null)
|
|
if ($util.Long)
|
|
(message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true;
|
|
else if (typeof object.proposalId === "string")
|
|
message.proposalId = parseInt(object.proposalId, 10);
|
|
else if (typeof object.proposalId === "number")
|
|
message.proposalId = object.proposalId;
|
|
else if (typeof object.proposalId === "object")
|
|
message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.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.gov.v1beta1.MsgSubmitProposalResponse
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.MsgSubmitProposalResponse} message MsgSubmitProposalResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} 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.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.proposalId = options.longs === String ? "0" : 0;
|
|
if (message.proposalId != null && message.hasOwnProperty("proposalId"))
|
|
if (typeof message.proposalId === "number")
|
|
object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId;
|
|
else
|
|
object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgSubmitProposalResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.gov.v1beta1.MsgSubmitProposalResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgSubmitProposalResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgSubmitProposalResponse;
|
|
})(v1beta1.MsgSubmitProposalResponse || {});
|
|
|
|
v1beta1.MsgVote = (function(MsgVote) {
|
|
|
|
/**
|
|
* Properties of a MsgVote.
|
|
* @memberof cosmos.gov.v1beta1
|
|
* @interface IMsgVote
|
|
* @property {number|Long|null} [proposalId] MsgVote proposalId
|
|
* @property {string|null} [voter] MsgVote voter
|
|
* @property {cosmos.gov.v1beta1.VoteOption|null} [option] MsgVote option
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgVote.
|
|
* @memberof cosmos.gov.v1beta1
|
|
* @classdesc Represents a MsgVote.
|
|
* @implements IMsgVote
|
|
* @constructor
|
|
* @param {cosmos.gov.v1beta1.IMsgVote=} [properties] Properties to set
|
|
*/
|
|
function MsgVote(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* MsgVote proposalId.
|
|
* @member {number|Long} proposalId
|
|
* @memberof cosmos.gov.v1beta1.MsgVote
|
|
* @instance
|
|
*/
|
|
MsgVote.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* MsgVote voter.
|
|
* @member {string} voter
|
|
* @memberof cosmos.gov.v1beta1.MsgVote
|
|
* @instance
|
|
*/
|
|
MsgVote.prototype.voter = "";
|
|
|
|
/**
|
|
* MsgVote option.
|
|
* @member {cosmos.gov.v1beta1.VoteOption} option
|
|
* @memberof cosmos.gov.v1beta1.MsgVote
|
|
* @instance
|
|
*/
|
|
MsgVote.prototype.option = 0;
|
|
|
|
/**
|
|
* Creates a new MsgVote instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.gov.v1beta1.MsgVote
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.IMsgVote=} [properties] Properties to set
|
|
* @returns {cosmos.gov.v1beta1.MsgVote} MsgVote instance
|
|
*/
|
|
MsgVote.create = function create(properties) {
|
|
return new MsgVote(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgVote message. Does not implicitly {@link cosmos.gov.v1beta1.MsgVote.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.gov.v1beta1.MsgVote
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.IMsgVote} message MsgVote message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgVote.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId"))
|
|
writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId);
|
|
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);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgVote message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgVote.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.gov.v1beta1.MsgVote
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.IMsgVote} message MsgVote message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgVote.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgVote message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.gov.v1beta1.MsgVote
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.gov.v1beta1.MsgVote} MsgVote
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgVote.decode = 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.MsgVote();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.proposalId = reader.uint64();
|
|
break;
|
|
case 2:
|
|
message.voter = reader.string();
|
|
break;
|
|
case 3:
|
|
message.option = reader.int32();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgVote message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.gov.v1beta1.MsgVote
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.gov.v1beta1.MsgVote} MsgVote
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgVote.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgVote message.
|
|
* @function verify
|
|
* @memberof cosmos.gov.v1beta1.MsgVote
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgVote.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.proposalId != null && message.hasOwnProperty("proposalId"))
|
|
if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high)))
|
|
return "proposalId: 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;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgVote message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.gov.v1beta1.MsgVote
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.gov.v1beta1.MsgVote} MsgVote
|
|
*/
|
|
MsgVote.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.gov.v1beta1.MsgVote)
|
|
return object;
|
|
var message = new $root.cosmos.gov.v1beta1.MsgVote();
|
|
if (object.proposalId != null)
|
|
if ($util.Long)
|
|
(message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true;
|
|
else if (typeof object.proposalId === "string")
|
|
message.proposalId = parseInt(object.proposalId, 10);
|
|
else if (typeof object.proposalId === "number")
|
|
message.proposalId = object.proposalId;
|
|
else if (typeof object.proposalId === "object")
|
|
message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.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;
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgVote message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.gov.v1beta1.MsgVote
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.MsgVote} message MsgVote
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgVote.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.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.proposalId = options.longs === String ? "0" : 0;
|
|
object.voter = "";
|
|
object.option = options.enums === String ? "VOTE_OPTION_UNSPECIFIED" : 0;
|
|
}
|
|
if (message.proposalId != null && message.hasOwnProperty("proposalId"))
|
|
if (typeof message.proposalId === "number")
|
|
object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId;
|
|
else
|
|
object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId;
|
|
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;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgVote to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.gov.v1beta1.MsgVote
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgVote.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgVote;
|
|
})(v1beta1.MsgVote || {});
|
|
|
|
v1beta1.MsgVoteResponse = (function(MsgVoteResponse) {
|
|
|
|
/**
|
|
* Properties of a MsgVoteResponse.
|
|
* @memberof cosmos.gov.v1beta1
|
|
* @interface IMsgVoteResponse
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgVoteResponse.
|
|
* @memberof cosmos.gov.v1beta1
|
|
* @classdesc Represents a MsgVoteResponse.
|
|
* @implements IMsgVoteResponse
|
|
* @constructor
|
|
* @param {cosmos.gov.v1beta1.IMsgVoteResponse=} [properties] Properties to set
|
|
*/
|
|
function MsgVoteResponse(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new MsgVoteResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.gov.v1beta1.MsgVoteResponse
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.IMsgVoteResponse=} [properties] Properties to set
|
|
* @returns {cosmos.gov.v1beta1.MsgVoteResponse} MsgVoteResponse instance
|
|
*/
|
|
MsgVoteResponse.create = function create(properties) {
|
|
return new MsgVoteResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgVoteResponse message. Does not implicitly {@link cosmos.gov.v1beta1.MsgVoteResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.gov.v1beta1.MsgVoteResponse
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.IMsgVoteResponse} message MsgVoteResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgVoteResponse.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgVoteResponse message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgVoteResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.gov.v1beta1.MsgVoteResponse
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.IMsgVoteResponse} message MsgVoteResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgVoteResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgVoteResponse message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.gov.v1beta1.MsgVoteResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.gov.v1beta1.MsgVoteResponse} MsgVoteResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgVoteResponse.decode = 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.MsgVoteResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgVoteResponse message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.gov.v1beta1.MsgVoteResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.gov.v1beta1.MsgVoteResponse} MsgVoteResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgVoteResponse.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgVoteResponse message.
|
|
* @function verify
|
|
* @memberof cosmos.gov.v1beta1.MsgVoteResponse
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgVoteResponse.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgVoteResponse message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.gov.v1beta1.MsgVoteResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.gov.v1beta1.MsgVoteResponse} MsgVoteResponse
|
|
*/
|
|
MsgVoteResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.gov.v1beta1.MsgVoteResponse)
|
|
return object;
|
|
return new $root.cosmos.gov.v1beta1.MsgVoteResponse();
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgVoteResponse message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.gov.v1beta1.MsgVoteResponse
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.MsgVoteResponse} message MsgVoteResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgVoteResponse.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgVoteResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.gov.v1beta1.MsgVoteResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgVoteResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgVoteResponse;
|
|
})(v1beta1.MsgVoteResponse || {});
|
|
|
|
v1beta1.MsgDeposit = (function(MsgDeposit) {
|
|
|
|
/**
|
|
* Properties of a MsgDeposit.
|
|
* @memberof cosmos.gov.v1beta1
|
|
* @interface IMsgDeposit
|
|
* @property {number|Long|null} [proposalId] MsgDeposit proposalId
|
|
* @property {string|null} [depositor] MsgDeposit depositor
|
|
* @property {Array.<cosmos.base.v1beta1.ICoin>|null} [amount] MsgDeposit amount
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgDeposit.
|
|
* @memberof cosmos.gov.v1beta1
|
|
* @classdesc Represents a MsgDeposit.
|
|
* @implements IMsgDeposit
|
|
* @constructor
|
|
* @param {cosmos.gov.v1beta1.IMsgDeposit=} [properties] Properties to set
|
|
*/
|
|
function MsgDeposit(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]];
|
|
}
|
|
|
|
/**
|
|
* MsgDeposit proposalId.
|
|
* @member {number|Long} proposalId
|
|
* @memberof cosmos.gov.v1beta1.MsgDeposit
|
|
* @instance
|
|
*/
|
|
MsgDeposit.prototype.proposalId = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* MsgDeposit depositor.
|
|
* @member {string} depositor
|
|
* @memberof cosmos.gov.v1beta1.MsgDeposit
|
|
* @instance
|
|
*/
|
|
MsgDeposit.prototype.depositor = "";
|
|
|
|
/**
|
|
* MsgDeposit amount.
|
|
* @member {Array.<cosmos.base.v1beta1.ICoin>} amount
|
|
* @memberof cosmos.gov.v1beta1.MsgDeposit
|
|
* @instance
|
|
*/
|
|
MsgDeposit.prototype.amount = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new MsgDeposit instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.gov.v1beta1.MsgDeposit
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.IMsgDeposit=} [properties] Properties to set
|
|
* @returns {cosmos.gov.v1beta1.MsgDeposit} MsgDeposit instance
|
|
*/
|
|
MsgDeposit.create = function create(properties) {
|
|
return new MsgDeposit(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgDeposit message. Does not implicitly {@link cosmos.gov.v1beta1.MsgDeposit.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.gov.v1beta1.MsgDeposit
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.IMsgDeposit} message MsgDeposit message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgDeposit.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.proposalId != null && Object.hasOwnProperty.call(message, "proposalId"))
|
|
writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.proposalId);
|
|
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 MsgDeposit message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgDeposit.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.gov.v1beta1.MsgDeposit
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.IMsgDeposit} message MsgDeposit message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgDeposit.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgDeposit message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.gov.v1beta1.MsgDeposit
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.gov.v1beta1.MsgDeposit} MsgDeposit
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgDeposit.decode = 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.MsgDeposit();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.proposalId = 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 MsgDeposit message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.gov.v1beta1.MsgDeposit
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.gov.v1beta1.MsgDeposit} MsgDeposit
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgDeposit.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgDeposit message.
|
|
* @function verify
|
|
* @memberof cosmos.gov.v1beta1.MsgDeposit
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgDeposit.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.proposalId != null && message.hasOwnProperty("proposalId"))
|
|
if (!$util.isInteger(message.proposalId) && !(message.proposalId && $util.isInteger(message.proposalId.low) && $util.isInteger(message.proposalId.high)))
|
|
return "proposalId: 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 MsgDeposit message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.gov.v1beta1.MsgDeposit
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.gov.v1beta1.MsgDeposit} MsgDeposit
|
|
*/
|
|
MsgDeposit.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.gov.v1beta1.MsgDeposit)
|
|
return object;
|
|
var message = new $root.cosmos.gov.v1beta1.MsgDeposit();
|
|
if (object.proposalId != null)
|
|
if ($util.Long)
|
|
(message.proposalId = $util.Long.fromValue(object.proposalId)).unsigned = true;
|
|
else if (typeof object.proposalId === "string")
|
|
message.proposalId = parseInt(object.proposalId, 10);
|
|
else if (typeof object.proposalId === "number")
|
|
message.proposalId = object.proposalId;
|
|
else if (typeof object.proposalId === "object")
|
|
message.proposalId = new $util.LongBits(object.proposalId.low >>> 0, object.proposalId.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.MsgDeposit.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.MsgDeposit.amount: object expected");
|
|
message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgDeposit message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.gov.v1beta1.MsgDeposit
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.MsgDeposit} message MsgDeposit
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgDeposit.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.proposalId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.proposalId = options.longs === String ? "0" : 0;
|
|
object.depositor = "";
|
|
}
|
|
if (message.proposalId != null && message.hasOwnProperty("proposalId"))
|
|
if (typeof message.proposalId === "number")
|
|
object.proposalId = options.longs === String ? String(message.proposalId) : message.proposalId;
|
|
else
|
|
object.proposalId = options.longs === String ? $util.Long.prototype.toString.call(message.proposalId) : options.longs === Number ? new $util.LongBits(message.proposalId.low >>> 0, message.proposalId.high >>> 0).toNumber(true) : message.proposalId;
|
|
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 MsgDeposit to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.gov.v1beta1.MsgDeposit
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgDeposit.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgDeposit;
|
|
})(v1beta1.MsgDeposit || {});
|
|
|
|
v1beta1.MsgDepositResponse = (function(MsgDepositResponse) {
|
|
|
|
/**
|
|
* Properties of a MsgDepositResponse.
|
|
* @memberof cosmos.gov.v1beta1
|
|
* @interface IMsgDepositResponse
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgDepositResponse.
|
|
* @memberof cosmos.gov.v1beta1
|
|
* @classdesc Represents a MsgDepositResponse.
|
|
* @implements IMsgDepositResponse
|
|
* @constructor
|
|
* @param {cosmos.gov.v1beta1.IMsgDepositResponse=} [properties] Properties to set
|
|
*/
|
|
function MsgDepositResponse(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new MsgDepositResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.gov.v1beta1.MsgDepositResponse
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.IMsgDepositResponse=} [properties] Properties to set
|
|
* @returns {cosmos.gov.v1beta1.MsgDepositResponse} MsgDepositResponse instance
|
|
*/
|
|
MsgDepositResponse.create = function create(properties) {
|
|
return new MsgDepositResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgDepositResponse message. Does not implicitly {@link cosmos.gov.v1beta1.MsgDepositResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.gov.v1beta1.MsgDepositResponse
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.IMsgDepositResponse} message MsgDepositResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgDepositResponse.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgDepositResponse message, length delimited. Does not implicitly {@link cosmos.gov.v1beta1.MsgDepositResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.gov.v1beta1.MsgDepositResponse
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.IMsgDepositResponse} message MsgDepositResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgDepositResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgDepositResponse message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.gov.v1beta1.MsgDepositResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.gov.v1beta1.MsgDepositResponse} MsgDepositResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgDepositResponse.decode = 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.MsgDepositResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgDepositResponse message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.gov.v1beta1.MsgDepositResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.gov.v1beta1.MsgDepositResponse} MsgDepositResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgDepositResponse.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgDepositResponse message.
|
|
* @function verify
|
|
* @memberof cosmos.gov.v1beta1.MsgDepositResponse
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgDepositResponse.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgDepositResponse message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.gov.v1beta1.MsgDepositResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.gov.v1beta1.MsgDepositResponse} MsgDepositResponse
|
|
*/
|
|
MsgDepositResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.gov.v1beta1.MsgDepositResponse)
|
|
return object;
|
|
return new $root.cosmos.gov.v1beta1.MsgDepositResponse();
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgDepositResponse message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.gov.v1beta1.MsgDepositResponse
|
|
* @static
|
|
* @param {cosmos.gov.v1beta1.MsgDepositResponse} message MsgDepositResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgDepositResponse.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgDepositResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.gov.v1beta1.MsgDepositResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgDepositResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgDepositResponse;
|
|
})(v1beta1.MsgDepositResponse || {});
|
|
|
|
return v1beta1;
|
|
})(gov.v1beta1 || {});
|
|
|
|
return gov;
|
|
})(cosmos.gov || {});
|
|
|
|
/**
|
|
* Namespace staking.
|
|
* @memberof cosmos
|
|
* @namespace
|
|
*/
|
|
|
|
cosmos.staking = (function(staking) {
|
|
|
|
/**
|
|
* Namespace v1beta1.
|
|
* @memberof cosmos.staking
|
|
* @namespace
|
|
*/
|
|
|
|
staking.v1beta1 = (function(v1beta1) {
|
|
|
|
v1beta1.HistoricalInfo = (function(HistoricalInfo) {
|
|
|
|
/**
|
|
* Properties of a HistoricalInfo.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IHistoricalInfo
|
|
* @property {tendermint.types.IHeader|null} [header] HistoricalInfo header
|
|
* @property {Array.<cosmos.staking.v1beta1.IValidator>|null} [valset] HistoricalInfo valset
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new HistoricalInfo.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a HistoricalInfo.
|
|
* @implements IHistoricalInfo
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IHistoricalInfo=} [properties] Properties to set
|
|
*/
|
|
function HistoricalInfo(properties) {
|
|
this.valset = [];
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* HistoricalInfo header.
|
|
* @member {tendermint.types.IHeader|null|undefined} header
|
|
* @memberof cosmos.staking.v1beta1.HistoricalInfo
|
|
* @instance
|
|
*/
|
|
HistoricalInfo.prototype.header = null;
|
|
|
|
/**
|
|
* HistoricalInfo valset.
|
|
* @member {Array.<cosmos.staking.v1beta1.IValidator>} valset
|
|
* @memberof cosmos.staking.v1beta1.HistoricalInfo
|
|
* @instance
|
|
*/
|
|
HistoricalInfo.prototype.valset = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new HistoricalInfo instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.HistoricalInfo
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IHistoricalInfo=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.HistoricalInfo} HistoricalInfo instance
|
|
*/
|
|
HistoricalInfo.create = function create(properties) {
|
|
return new HistoricalInfo(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified HistoricalInfo message. Does not implicitly {@link cosmos.staking.v1beta1.HistoricalInfo.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.HistoricalInfo
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IHistoricalInfo} message HistoricalInfo message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
HistoricalInfo.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.valset != null && message.valset.length)
|
|
for (var i = 0; i < message.valset.length; ++i)
|
|
$root.cosmos.staking.v1beta1.Validator.encode(message.valset[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified HistoricalInfo message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.HistoricalInfo.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.HistoricalInfo
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IHistoricalInfo} message HistoricalInfo message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
HistoricalInfo.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a HistoricalInfo message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.HistoricalInfo
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.HistoricalInfo} HistoricalInfo
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
HistoricalInfo.decode = 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.staking.v1beta1.HistoricalInfo();
|
|
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:
|
|
if (!(message.valset && message.valset.length))
|
|
message.valset = [];
|
|
message.valset.push($root.cosmos.staking.v1beta1.Validator.decode(reader, reader.uint32()));
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a HistoricalInfo message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.HistoricalInfo
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.HistoricalInfo} HistoricalInfo
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
HistoricalInfo.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a HistoricalInfo message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.HistoricalInfo
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
HistoricalInfo.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.valset != null && message.hasOwnProperty("valset")) {
|
|
if (!Array.isArray(message.valset))
|
|
return "valset: array expected";
|
|
for (var i = 0; i < message.valset.length; ++i) {
|
|
var error = $root.cosmos.staking.v1beta1.Validator.verify(message.valset[i]);
|
|
if (error)
|
|
return "valset." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a HistoricalInfo message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.HistoricalInfo
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.HistoricalInfo} HistoricalInfo
|
|
*/
|
|
HistoricalInfo.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.HistoricalInfo)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.HistoricalInfo();
|
|
if (object.header != null) {
|
|
if (typeof object.header !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.HistoricalInfo.header: object expected");
|
|
message.header = $root.tendermint.types.Header.fromObject(object.header);
|
|
}
|
|
if (object.valset) {
|
|
if (!Array.isArray(object.valset))
|
|
throw TypeError(".cosmos.staking.v1beta1.HistoricalInfo.valset: array expected");
|
|
message.valset = [];
|
|
for (var i = 0; i < object.valset.length; ++i) {
|
|
if (typeof object.valset[i] !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.HistoricalInfo.valset: object expected");
|
|
message.valset[i] = $root.cosmos.staking.v1beta1.Validator.fromObject(object.valset[i]);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a HistoricalInfo message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.HistoricalInfo
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.HistoricalInfo} message HistoricalInfo
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
HistoricalInfo.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.valset = [];
|
|
if (options.defaults)
|
|
object.header = null;
|
|
if (message.header != null && message.hasOwnProperty("header"))
|
|
object.header = $root.tendermint.types.Header.toObject(message.header, options);
|
|
if (message.valset && message.valset.length) {
|
|
object.valset = [];
|
|
for (var j = 0; j < message.valset.length; ++j)
|
|
object.valset[j] = $root.cosmos.staking.v1beta1.Validator.toObject(message.valset[j], options);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this HistoricalInfo to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.HistoricalInfo
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
HistoricalInfo.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return HistoricalInfo;
|
|
})(v1beta1.HistoricalInfo || {});
|
|
|
|
v1beta1.CommissionRates = (function(CommissionRates) {
|
|
|
|
/**
|
|
* Properties of a CommissionRates.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface ICommissionRates
|
|
* @property {string|null} [rate] CommissionRates rate
|
|
* @property {string|null} [maxRate] CommissionRates maxRate
|
|
* @property {string|null} [maxChangeRate] CommissionRates maxChangeRate
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new CommissionRates.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a CommissionRates.
|
|
* @implements ICommissionRates
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.ICommissionRates=} [properties] Properties to set
|
|
*/
|
|
function CommissionRates(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* CommissionRates rate.
|
|
* @member {string} rate
|
|
* @memberof cosmos.staking.v1beta1.CommissionRates
|
|
* @instance
|
|
*/
|
|
CommissionRates.prototype.rate = "";
|
|
|
|
/**
|
|
* CommissionRates maxRate.
|
|
* @member {string} maxRate
|
|
* @memberof cosmos.staking.v1beta1.CommissionRates
|
|
* @instance
|
|
*/
|
|
CommissionRates.prototype.maxRate = "";
|
|
|
|
/**
|
|
* CommissionRates maxChangeRate.
|
|
* @member {string} maxChangeRate
|
|
* @memberof cosmos.staking.v1beta1.CommissionRates
|
|
* @instance
|
|
*/
|
|
CommissionRates.prototype.maxChangeRate = "";
|
|
|
|
/**
|
|
* Creates a new CommissionRates instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.CommissionRates
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.ICommissionRates=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.CommissionRates} CommissionRates instance
|
|
*/
|
|
CommissionRates.create = function create(properties) {
|
|
return new CommissionRates(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified CommissionRates message. Does not implicitly {@link cosmos.staking.v1beta1.CommissionRates.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.CommissionRates
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.ICommissionRates} message CommissionRates message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
CommissionRates.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.rate != null && Object.hasOwnProperty.call(message, "rate"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.rate);
|
|
if (message.maxRate != null && Object.hasOwnProperty.call(message, "maxRate"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.maxRate);
|
|
if (message.maxChangeRate != null && Object.hasOwnProperty.call(message, "maxChangeRate"))
|
|
writer.uint32(/* id 3, wireType 2 =*/26).string(message.maxChangeRate);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified CommissionRates message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.CommissionRates.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.CommissionRates
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.ICommissionRates} message CommissionRates message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
CommissionRates.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a CommissionRates message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.CommissionRates
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.CommissionRates} CommissionRates
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
CommissionRates.decode = 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.staking.v1beta1.CommissionRates();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.rate = reader.string();
|
|
break;
|
|
case 2:
|
|
message.maxRate = reader.string();
|
|
break;
|
|
case 3:
|
|
message.maxChangeRate = reader.string();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a CommissionRates message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.CommissionRates
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.CommissionRates} CommissionRates
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
CommissionRates.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a CommissionRates message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.CommissionRates
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
CommissionRates.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.rate != null && message.hasOwnProperty("rate"))
|
|
if (!$util.isString(message.rate))
|
|
return "rate: string expected";
|
|
if (message.maxRate != null && message.hasOwnProperty("maxRate"))
|
|
if (!$util.isString(message.maxRate))
|
|
return "maxRate: string expected";
|
|
if (message.maxChangeRate != null && message.hasOwnProperty("maxChangeRate"))
|
|
if (!$util.isString(message.maxChangeRate))
|
|
return "maxChangeRate: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a CommissionRates message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.CommissionRates
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.CommissionRates} CommissionRates
|
|
*/
|
|
CommissionRates.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.CommissionRates)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.CommissionRates();
|
|
if (object.rate != null)
|
|
message.rate = String(object.rate);
|
|
if (object.maxRate != null)
|
|
message.maxRate = String(object.maxRate);
|
|
if (object.maxChangeRate != null)
|
|
message.maxChangeRate = String(object.maxChangeRate);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a CommissionRates message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.CommissionRates
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.CommissionRates} message CommissionRates
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
CommissionRates.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.rate = "";
|
|
object.maxRate = "";
|
|
object.maxChangeRate = "";
|
|
}
|
|
if (message.rate != null && message.hasOwnProperty("rate"))
|
|
object.rate = message.rate;
|
|
if (message.maxRate != null && message.hasOwnProperty("maxRate"))
|
|
object.maxRate = message.maxRate;
|
|
if (message.maxChangeRate != null && message.hasOwnProperty("maxChangeRate"))
|
|
object.maxChangeRate = message.maxChangeRate;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this CommissionRates to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.CommissionRates
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
CommissionRates.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return CommissionRates;
|
|
})(v1beta1.CommissionRates || {});
|
|
|
|
v1beta1.Commission = (function(Commission) {
|
|
|
|
/**
|
|
* Properties of a Commission.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface ICommission
|
|
* @property {cosmos.staking.v1beta1.ICommissionRates|null} [commissionRates] Commission commissionRates
|
|
* @property {google.protobuf.ITimestamp|null} [updateTime] Commission updateTime
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Commission.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a Commission.
|
|
* @implements ICommission
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.ICommission=} [properties] Properties to set
|
|
*/
|
|
function Commission(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Commission commissionRates.
|
|
* @member {cosmos.staking.v1beta1.ICommissionRates|null|undefined} commissionRates
|
|
* @memberof cosmos.staking.v1beta1.Commission
|
|
* @instance
|
|
*/
|
|
Commission.prototype.commissionRates = null;
|
|
|
|
/**
|
|
* Commission updateTime.
|
|
* @member {google.protobuf.ITimestamp|null|undefined} updateTime
|
|
* @memberof cosmos.staking.v1beta1.Commission
|
|
* @instance
|
|
*/
|
|
Commission.prototype.updateTime = null;
|
|
|
|
/**
|
|
* Creates a new Commission instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.Commission
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.ICommission=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.Commission} Commission instance
|
|
*/
|
|
Commission.create = function create(properties) {
|
|
return new Commission(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Commission message. Does not implicitly {@link cosmos.staking.v1beta1.Commission.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.Commission
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.ICommission} message Commission message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Commission.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.commissionRates != null && Object.hasOwnProperty.call(message, "commissionRates"))
|
|
$root.cosmos.staking.v1beta1.CommissionRates.encode(message.commissionRates, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime"))
|
|
$root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Commission message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Commission.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.Commission
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.ICommission} message Commission message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Commission.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a Commission message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.Commission
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.Commission} Commission
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Commission.decode = 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.staking.v1beta1.Commission();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.commissionRates = $root.cosmos.staking.v1beta1.CommissionRates.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a Commission message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.Commission
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.Commission} Commission
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Commission.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a Commission message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.Commission
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
Commission.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.commissionRates != null && message.hasOwnProperty("commissionRates")) {
|
|
var error = $root.cosmos.staking.v1beta1.CommissionRates.verify(message.commissionRates);
|
|
if (error)
|
|
return "commissionRates." + error;
|
|
}
|
|
if (message.updateTime != null && message.hasOwnProperty("updateTime")) {
|
|
var error = $root.google.protobuf.Timestamp.verify(message.updateTime);
|
|
if (error)
|
|
return "updateTime." + error;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a Commission message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.Commission
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.Commission} Commission
|
|
*/
|
|
Commission.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.Commission)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.Commission();
|
|
if (object.commissionRates != null) {
|
|
if (typeof object.commissionRates !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.Commission.commissionRates: object expected");
|
|
message.commissionRates = $root.cosmos.staking.v1beta1.CommissionRates.fromObject(object.commissionRates);
|
|
}
|
|
if (object.updateTime != null) {
|
|
if (typeof object.updateTime !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.Commission.updateTime: object expected");
|
|
message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a Commission message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.Commission
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.Commission} message Commission
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Commission.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.commissionRates = null;
|
|
object.updateTime = null;
|
|
}
|
|
if (message.commissionRates != null && message.hasOwnProperty("commissionRates"))
|
|
object.commissionRates = $root.cosmos.staking.v1beta1.CommissionRates.toObject(message.commissionRates, options);
|
|
if (message.updateTime != null && message.hasOwnProperty("updateTime"))
|
|
object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Commission to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.Commission
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Commission.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Commission;
|
|
})(v1beta1.Commission || {});
|
|
|
|
v1beta1.Description = (function(Description) {
|
|
|
|
/**
|
|
* Properties of a Description.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IDescription
|
|
* @property {string|null} [moniker] Description moniker
|
|
* @property {string|null} [identity] Description identity
|
|
* @property {string|null} [website] Description website
|
|
* @property {string|null} [securityContact] Description securityContact
|
|
* @property {string|null} [details] Description details
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Description.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a Description.
|
|
* @implements IDescription
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IDescription=} [properties] Properties to set
|
|
*/
|
|
function Description(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Description moniker.
|
|
* @member {string} moniker
|
|
* @memberof cosmos.staking.v1beta1.Description
|
|
* @instance
|
|
*/
|
|
Description.prototype.moniker = "";
|
|
|
|
/**
|
|
* Description identity.
|
|
* @member {string} identity
|
|
* @memberof cosmos.staking.v1beta1.Description
|
|
* @instance
|
|
*/
|
|
Description.prototype.identity = "";
|
|
|
|
/**
|
|
* Description website.
|
|
* @member {string} website
|
|
* @memberof cosmos.staking.v1beta1.Description
|
|
* @instance
|
|
*/
|
|
Description.prototype.website = "";
|
|
|
|
/**
|
|
* Description securityContact.
|
|
* @member {string} securityContact
|
|
* @memberof cosmos.staking.v1beta1.Description
|
|
* @instance
|
|
*/
|
|
Description.prototype.securityContact = "";
|
|
|
|
/**
|
|
* Description details.
|
|
* @member {string} details
|
|
* @memberof cosmos.staking.v1beta1.Description
|
|
* @instance
|
|
*/
|
|
Description.prototype.details = "";
|
|
|
|
/**
|
|
* Creates a new Description instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.Description
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDescription=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.Description} Description instance
|
|
*/
|
|
Description.create = function create(properties) {
|
|
return new Description(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Description message. Does not implicitly {@link cosmos.staking.v1beta1.Description.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.Description
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDescription} message Description message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Description.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.moniker != null && Object.hasOwnProperty.call(message, "moniker"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.moniker);
|
|
if (message.identity != null && Object.hasOwnProperty.call(message, "identity"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.identity);
|
|
if (message.website != null && Object.hasOwnProperty.call(message, "website"))
|
|
writer.uint32(/* id 3, wireType 2 =*/26).string(message.website);
|
|
if (message.securityContact != null && Object.hasOwnProperty.call(message, "securityContact"))
|
|
writer.uint32(/* id 4, wireType 2 =*/34).string(message.securityContact);
|
|
if (message.details != null && Object.hasOwnProperty.call(message, "details"))
|
|
writer.uint32(/* id 5, wireType 2 =*/42).string(message.details);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Description message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Description.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.Description
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDescription} message Description message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Description.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a Description message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.Description
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.Description} Description
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Description.decode = 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.staking.v1beta1.Description();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.moniker = reader.string();
|
|
break;
|
|
case 2:
|
|
message.identity = reader.string();
|
|
break;
|
|
case 3:
|
|
message.website = reader.string();
|
|
break;
|
|
case 4:
|
|
message.securityContact = reader.string();
|
|
break;
|
|
case 5:
|
|
message.details = reader.string();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a Description message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.Description
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.Description} Description
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Description.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a Description message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.Description
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
Description.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.moniker != null && message.hasOwnProperty("moniker"))
|
|
if (!$util.isString(message.moniker))
|
|
return "moniker: string expected";
|
|
if (message.identity != null && message.hasOwnProperty("identity"))
|
|
if (!$util.isString(message.identity))
|
|
return "identity: string expected";
|
|
if (message.website != null && message.hasOwnProperty("website"))
|
|
if (!$util.isString(message.website))
|
|
return "website: string expected";
|
|
if (message.securityContact != null && message.hasOwnProperty("securityContact"))
|
|
if (!$util.isString(message.securityContact))
|
|
return "securityContact: string expected";
|
|
if (message.details != null && message.hasOwnProperty("details"))
|
|
if (!$util.isString(message.details))
|
|
return "details: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a Description message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.Description
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.Description} Description
|
|
*/
|
|
Description.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.Description)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.Description();
|
|
if (object.moniker != null)
|
|
message.moniker = String(object.moniker);
|
|
if (object.identity != null)
|
|
message.identity = String(object.identity);
|
|
if (object.website != null)
|
|
message.website = String(object.website);
|
|
if (object.securityContact != null)
|
|
message.securityContact = String(object.securityContact);
|
|
if (object.details != null)
|
|
message.details = String(object.details);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a Description message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.Description
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.Description} message Description
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Description.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.moniker = "";
|
|
object.identity = "";
|
|
object.website = "";
|
|
object.securityContact = "";
|
|
object.details = "";
|
|
}
|
|
if (message.moniker != null && message.hasOwnProperty("moniker"))
|
|
object.moniker = message.moniker;
|
|
if (message.identity != null && message.hasOwnProperty("identity"))
|
|
object.identity = message.identity;
|
|
if (message.website != null && message.hasOwnProperty("website"))
|
|
object.website = message.website;
|
|
if (message.securityContact != null && message.hasOwnProperty("securityContact"))
|
|
object.securityContact = message.securityContact;
|
|
if (message.details != null && message.hasOwnProperty("details"))
|
|
object.details = message.details;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Description to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.Description
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Description.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Description;
|
|
})(v1beta1.Description || {});
|
|
|
|
v1beta1.Validator = (function(Validator) {
|
|
|
|
/**
|
|
* Properties of a Validator.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IValidator
|
|
* @property {string|null} [operatorAddress] Validator operatorAddress
|
|
* @property {google.protobuf.IAny|null} [consensusPubkey] Validator consensusPubkey
|
|
* @property {boolean|null} [jailed] Validator jailed
|
|
* @property {cosmos.staking.v1beta1.BondStatus|null} [status] Validator status
|
|
* @property {string|null} [tokens] Validator tokens
|
|
* @property {string|null} [delegatorShares] Validator delegatorShares
|
|
* @property {cosmos.staking.v1beta1.IDescription|null} [description] Validator description
|
|
* @property {number|Long|null} [unbondingHeight] Validator unbondingHeight
|
|
* @property {google.protobuf.ITimestamp|null} [unbondingTime] Validator unbondingTime
|
|
* @property {cosmos.staking.v1beta1.ICommission|null} [commission] Validator commission
|
|
* @property {string|null} [minSelfDelegation] Validator minSelfDelegation
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Validator.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a Validator.
|
|
* @implements IValidator
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.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 operatorAddress.
|
|
* @member {string} operatorAddress
|
|
* @memberof cosmos.staking.v1beta1.Validator
|
|
* @instance
|
|
*/
|
|
Validator.prototype.operatorAddress = "";
|
|
|
|
/**
|
|
* Validator consensusPubkey.
|
|
* @member {google.protobuf.IAny|null|undefined} consensusPubkey
|
|
* @memberof cosmos.staking.v1beta1.Validator
|
|
* @instance
|
|
*/
|
|
Validator.prototype.consensusPubkey = null;
|
|
|
|
/**
|
|
* Validator jailed.
|
|
* @member {boolean} jailed
|
|
* @memberof cosmos.staking.v1beta1.Validator
|
|
* @instance
|
|
*/
|
|
Validator.prototype.jailed = false;
|
|
|
|
/**
|
|
* Validator status.
|
|
* @member {cosmos.staking.v1beta1.BondStatus} status
|
|
* @memberof cosmos.staking.v1beta1.Validator
|
|
* @instance
|
|
*/
|
|
Validator.prototype.status = 0;
|
|
|
|
/**
|
|
* Validator tokens.
|
|
* @member {string} tokens
|
|
* @memberof cosmos.staking.v1beta1.Validator
|
|
* @instance
|
|
*/
|
|
Validator.prototype.tokens = "";
|
|
|
|
/**
|
|
* Validator delegatorShares.
|
|
* @member {string} delegatorShares
|
|
* @memberof cosmos.staking.v1beta1.Validator
|
|
* @instance
|
|
*/
|
|
Validator.prototype.delegatorShares = "";
|
|
|
|
/**
|
|
* Validator description.
|
|
* @member {cosmos.staking.v1beta1.IDescription|null|undefined} description
|
|
* @memberof cosmos.staking.v1beta1.Validator
|
|
* @instance
|
|
*/
|
|
Validator.prototype.description = null;
|
|
|
|
/**
|
|
* Validator unbondingHeight.
|
|
* @member {number|Long} unbondingHeight
|
|
* @memberof cosmos.staking.v1beta1.Validator
|
|
* @instance
|
|
*/
|
|
Validator.prototype.unbondingHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* Validator unbondingTime.
|
|
* @member {google.protobuf.ITimestamp|null|undefined} unbondingTime
|
|
* @memberof cosmos.staking.v1beta1.Validator
|
|
* @instance
|
|
*/
|
|
Validator.prototype.unbondingTime = null;
|
|
|
|
/**
|
|
* Validator commission.
|
|
* @member {cosmos.staking.v1beta1.ICommission|null|undefined} commission
|
|
* @memberof cosmos.staking.v1beta1.Validator
|
|
* @instance
|
|
*/
|
|
Validator.prototype.commission = null;
|
|
|
|
/**
|
|
* Validator minSelfDelegation.
|
|
* @member {string} minSelfDelegation
|
|
* @memberof cosmos.staking.v1beta1.Validator
|
|
* @instance
|
|
*/
|
|
Validator.prototype.minSelfDelegation = "";
|
|
|
|
/**
|
|
* Creates a new Validator instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.Validator
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IValidator=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.Validator} Validator instance
|
|
*/
|
|
Validator.create = function create(properties) {
|
|
return new Validator(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Validator message. Does not implicitly {@link cosmos.staking.v1beta1.Validator.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.Validator
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.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.operatorAddress != null && Object.hasOwnProperty.call(message, "operatorAddress"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.operatorAddress);
|
|
if (message.consensusPubkey != null && Object.hasOwnProperty.call(message, "consensusPubkey"))
|
|
$root.google.protobuf.Any.encode(message.consensusPubkey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
if (message.jailed != null && Object.hasOwnProperty.call(message, "jailed"))
|
|
writer.uint32(/* id 3, wireType 0 =*/24).bool(message.jailed);
|
|
if (message.status != null && Object.hasOwnProperty.call(message, "status"))
|
|
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status);
|
|
if (message.tokens != null && Object.hasOwnProperty.call(message, "tokens"))
|
|
writer.uint32(/* id 5, wireType 2 =*/42).string(message.tokens);
|
|
if (message.delegatorShares != null && Object.hasOwnProperty.call(message, "delegatorShares"))
|
|
writer.uint32(/* id 6, wireType 2 =*/50).string(message.delegatorShares);
|
|
if (message.description != null && Object.hasOwnProperty.call(message, "description"))
|
|
$root.cosmos.staking.v1beta1.Description.encode(message.description, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
|
if (message.unbondingHeight != null && Object.hasOwnProperty.call(message, "unbondingHeight"))
|
|
writer.uint32(/* id 8, wireType 0 =*/64).int64(message.unbondingHeight);
|
|
if (message.unbondingTime != null && Object.hasOwnProperty.call(message, "unbondingTime"))
|
|
$root.google.protobuf.Timestamp.encode(message.unbondingTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
|
|
if (message.commission != null && Object.hasOwnProperty.call(message, "commission"))
|
|
$root.cosmos.staking.v1beta1.Commission.encode(message.commission, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
|
|
if (message.minSelfDelegation != null && Object.hasOwnProperty.call(message, "minSelfDelegation"))
|
|
writer.uint32(/* id 11, wireType 2 =*/90).string(message.minSelfDelegation);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Validator message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Validator.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.Validator
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.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 cosmos.staking.v1beta1.Validator
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.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.cosmos.staking.v1beta1.Validator();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.operatorAddress = reader.string();
|
|
break;
|
|
case 2:
|
|
message.consensusPubkey = $root.google.protobuf.Any.decode(reader, reader.uint32());
|
|
break;
|
|
case 3:
|
|
message.jailed = reader.bool();
|
|
break;
|
|
case 4:
|
|
message.status = reader.int32();
|
|
break;
|
|
case 5:
|
|
message.tokens = reader.string();
|
|
break;
|
|
case 6:
|
|
message.delegatorShares = reader.string();
|
|
break;
|
|
case 7:
|
|
message.description = $root.cosmos.staking.v1beta1.Description.decode(reader, reader.uint32());
|
|
break;
|
|
case 8:
|
|
message.unbondingHeight = reader.int64();
|
|
break;
|
|
case 9:
|
|
message.unbondingTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
|
break;
|
|
case 10:
|
|
message.commission = $root.cosmos.staking.v1beta1.Commission.decode(reader, reader.uint32());
|
|
break;
|
|
case 11:
|
|
message.minSelfDelegation = reader.string();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a Validator message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.Validator
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.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 cosmos.staking.v1beta1.Validator
|
|
* @static
|
|
* @param {Object.<string,*>} 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.operatorAddress != null && message.hasOwnProperty("operatorAddress"))
|
|
if (!$util.isString(message.operatorAddress))
|
|
return "operatorAddress: string expected";
|
|
if (message.consensusPubkey != null && message.hasOwnProperty("consensusPubkey")) {
|
|
var error = $root.google.protobuf.Any.verify(message.consensusPubkey);
|
|
if (error)
|
|
return "consensusPubkey." + error;
|
|
}
|
|
if (message.jailed != null && message.hasOwnProperty("jailed"))
|
|
if (typeof message.jailed !== "boolean")
|
|
return "jailed: boolean expected";
|
|
if (message.status != null && message.hasOwnProperty("status"))
|
|
switch (message.status) {
|
|
default:
|
|
return "status: enum value expected";
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
case 3:
|
|
break;
|
|
}
|
|
if (message.tokens != null && message.hasOwnProperty("tokens"))
|
|
if (!$util.isString(message.tokens))
|
|
return "tokens: string expected";
|
|
if (message.delegatorShares != null && message.hasOwnProperty("delegatorShares"))
|
|
if (!$util.isString(message.delegatorShares))
|
|
return "delegatorShares: string expected";
|
|
if (message.description != null && message.hasOwnProperty("description")) {
|
|
var error = $root.cosmos.staking.v1beta1.Description.verify(message.description);
|
|
if (error)
|
|
return "description." + error;
|
|
}
|
|
if (message.unbondingHeight != null && message.hasOwnProperty("unbondingHeight"))
|
|
if (!$util.isInteger(message.unbondingHeight) && !(message.unbondingHeight && $util.isInteger(message.unbondingHeight.low) && $util.isInteger(message.unbondingHeight.high)))
|
|
return "unbondingHeight: integer|Long expected";
|
|
if (message.unbondingTime != null && message.hasOwnProperty("unbondingTime")) {
|
|
var error = $root.google.protobuf.Timestamp.verify(message.unbondingTime);
|
|
if (error)
|
|
return "unbondingTime." + error;
|
|
}
|
|
if (message.commission != null && message.hasOwnProperty("commission")) {
|
|
var error = $root.cosmos.staking.v1beta1.Commission.verify(message.commission);
|
|
if (error)
|
|
return "commission." + error;
|
|
}
|
|
if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation"))
|
|
if (!$util.isString(message.minSelfDelegation))
|
|
return "minSelfDelegation: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a Validator message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.Validator
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.Validator} Validator
|
|
*/
|
|
Validator.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.Validator)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.Validator();
|
|
if (object.operatorAddress != null)
|
|
message.operatorAddress = String(object.operatorAddress);
|
|
if (object.consensusPubkey != null) {
|
|
if (typeof object.consensusPubkey !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.Validator.consensusPubkey: object expected");
|
|
message.consensusPubkey = $root.google.protobuf.Any.fromObject(object.consensusPubkey);
|
|
}
|
|
if (object.jailed != null)
|
|
message.jailed = Boolean(object.jailed);
|
|
switch (object.status) {
|
|
case "BOND_STATUS_UNSPECIFIED":
|
|
case 0:
|
|
message.status = 0;
|
|
break;
|
|
case "BOND_STATUS_UNBONDED":
|
|
case 1:
|
|
message.status = 1;
|
|
break;
|
|
case "BOND_STATUS_UNBONDING":
|
|
case 2:
|
|
message.status = 2;
|
|
break;
|
|
case "BOND_STATUS_BONDED":
|
|
case 3:
|
|
message.status = 3;
|
|
break;
|
|
}
|
|
if (object.tokens != null)
|
|
message.tokens = String(object.tokens);
|
|
if (object.delegatorShares != null)
|
|
message.delegatorShares = String(object.delegatorShares);
|
|
if (object.description != null) {
|
|
if (typeof object.description !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.Validator.description: object expected");
|
|
message.description = $root.cosmos.staking.v1beta1.Description.fromObject(object.description);
|
|
}
|
|
if (object.unbondingHeight != null)
|
|
if ($util.Long)
|
|
(message.unbondingHeight = $util.Long.fromValue(object.unbondingHeight)).unsigned = false;
|
|
else if (typeof object.unbondingHeight === "string")
|
|
message.unbondingHeight = parseInt(object.unbondingHeight, 10);
|
|
else if (typeof object.unbondingHeight === "number")
|
|
message.unbondingHeight = object.unbondingHeight;
|
|
else if (typeof object.unbondingHeight === "object")
|
|
message.unbondingHeight = new $util.LongBits(object.unbondingHeight.low >>> 0, object.unbondingHeight.high >>> 0).toNumber();
|
|
if (object.unbondingTime != null) {
|
|
if (typeof object.unbondingTime !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.Validator.unbondingTime: object expected");
|
|
message.unbondingTime = $root.google.protobuf.Timestamp.fromObject(object.unbondingTime);
|
|
}
|
|
if (object.commission != null) {
|
|
if (typeof object.commission !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.Validator.commission: object expected");
|
|
message.commission = $root.cosmos.staking.v1beta1.Commission.fromObject(object.commission);
|
|
}
|
|
if (object.minSelfDelegation != null)
|
|
message.minSelfDelegation = String(object.minSelfDelegation);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a Validator message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.Validator
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.Validator} message Validator
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Validator.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.operatorAddress = "";
|
|
object.consensusPubkey = null;
|
|
object.jailed = false;
|
|
object.status = options.enums === String ? "BOND_STATUS_UNSPECIFIED" : 0;
|
|
object.tokens = "";
|
|
object.delegatorShares = "";
|
|
object.description = null;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.unbondingHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.unbondingHeight = options.longs === String ? "0" : 0;
|
|
object.unbondingTime = null;
|
|
object.commission = null;
|
|
object.minSelfDelegation = "";
|
|
}
|
|
if (message.operatorAddress != null && message.hasOwnProperty("operatorAddress"))
|
|
object.operatorAddress = message.operatorAddress;
|
|
if (message.consensusPubkey != null && message.hasOwnProperty("consensusPubkey"))
|
|
object.consensusPubkey = $root.google.protobuf.Any.toObject(message.consensusPubkey, options);
|
|
if (message.jailed != null && message.hasOwnProperty("jailed"))
|
|
object.jailed = message.jailed;
|
|
if (message.status != null && message.hasOwnProperty("status"))
|
|
object.status = options.enums === String ? $root.cosmos.staking.v1beta1.BondStatus[message.status] : message.status;
|
|
if (message.tokens != null && message.hasOwnProperty("tokens"))
|
|
object.tokens = message.tokens;
|
|
if (message.delegatorShares != null && message.hasOwnProperty("delegatorShares"))
|
|
object.delegatorShares = message.delegatorShares;
|
|
if (message.description != null && message.hasOwnProperty("description"))
|
|
object.description = $root.cosmos.staking.v1beta1.Description.toObject(message.description, options);
|
|
if (message.unbondingHeight != null && message.hasOwnProperty("unbondingHeight"))
|
|
if (typeof message.unbondingHeight === "number")
|
|
object.unbondingHeight = options.longs === String ? String(message.unbondingHeight) : message.unbondingHeight;
|
|
else
|
|
object.unbondingHeight = options.longs === String ? $util.Long.prototype.toString.call(message.unbondingHeight) : options.longs === Number ? new $util.LongBits(message.unbondingHeight.low >>> 0, message.unbondingHeight.high >>> 0).toNumber() : message.unbondingHeight;
|
|
if (message.unbondingTime != null && message.hasOwnProperty("unbondingTime"))
|
|
object.unbondingTime = $root.google.protobuf.Timestamp.toObject(message.unbondingTime, options);
|
|
if (message.commission != null && message.hasOwnProperty("commission"))
|
|
object.commission = $root.cosmos.staking.v1beta1.Commission.toObject(message.commission, options);
|
|
if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation"))
|
|
object.minSelfDelegation = message.minSelfDelegation;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Validator to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.Validator
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Validator.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Validator;
|
|
})(v1beta1.Validator || {});
|
|
|
|
/**
|
|
* BondStatus enum.
|
|
* @name cosmos.staking.v1beta1.BondStatus
|
|
* @enum {string}
|
|
* @property {number} BOND_STATUS_UNSPECIFIED=0 BOND_STATUS_UNSPECIFIED value
|
|
* @property {number} BOND_STATUS_UNBONDED=1 BOND_STATUS_UNBONDED value
|
|
* @property {number} BOND_STATUS_UNBONDING=2 BOND_STATUS_UNBONDING value
|
|
* @property {number} BOND_STATUS_BONDED=3 BOND_STATUS_BONDED value
|
|
*/
|
|
v1beta1.BondStatus = (function() {
|
|
var valuesById = {}, values = Object.create(valuesById);
|
|
values[valuesById[0] = "BOND_STATUS_UNSPECIFIED"] = 0;
|
|
values[valuesById[1] = "BOND_STATUS_UNBONDED"] = 1;
|
|
values[valuesById[2] = "BOND_STATUS_UNBONDING"] = 2;
|
|
values[valuesById[3] = "BOND_STATUS_BONDED"] = 3;
|
|
return values;
|
|
})();
|
|
|
|
v1beta1.ValAddresses = (function(ValAddresses) {
|
|
|
|
/**
|
|
* Properties of a ValAddresses.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IValAddresses
|
|
* @property {Array.<string>|null} [addresses] ValAddresses addresses
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new ValAddresses.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a ValAddresses.
|
|
* @implements IValAddresses
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IValAddresses=} [properties] Properties to set
|
|
*/
|
|
function ValAddresses(properties) {
|
|
this.addresses = [];
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* ValAddresses addresses.
|
|
* @member {Array.<string>} addresses
|
|
* @memberof cosmos.staking.v1beta1.ValAddresses
|
|
* @instance
|
|
*/
|
|
ValAddresses.prototype.addresses = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new ValAddresses instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.ValAddresses
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IValAddresses=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.ValAddresses} ValAddresses instance
|
|
*/
|
|
ValAddresses.create = function create(properties) {
|
|
return new ValAddresses(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified ValAddresses message. Does not implicitly {@link cosmos.staking.v1beta1.ValAddresses.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.ValAddresses
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IValAddresses} message ValAddresses message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
ValAddresses.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.addresses != null && message.addresses.length)
|
|
for (var i = 0; i < message.addresses.length; ++i)
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.addresses[i]);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified ValAddresses message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.ValAddresses.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.ValAddresses
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IValAddresses} message ValAddresses message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
ValAddresses.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a ValAddresses message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.ValAddresses
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.ValAddresses} ValAddresses
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
ValAddresses.decode = 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.staking.v1beta1.ValAddresses();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
if (!(message.addresses && message.addresses.length))
|
|
message.addresses = [];
|
|
message.addresses.push(reader.string());
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a ValAddresses message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.ValAddresses
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.ValAddresses} ValAddresses
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
ValAddresses.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a ValAddresses message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.ValAddresses
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
ValAddresses.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.addresses != null && message.hasOwnProperty("addresses")) {
|
|
if (!Array.isArray(message.addresses))
|
|
return "addresses: array expected";
|
|
for (var i = 0; i < message.addresses.length; ++i)
|
|
if (!$util.isString(message.addresses[i]))
|
|
return "addresses: string[] expected";
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a ValAddresses message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.ValAddresses
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.ValAddresses} ValAddresses
|
|
*/
|
|
ValAddresses.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.ValAddresses)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.ValAddresses();
|
|
if (object.addresses) {
|
|
if (!Array.isArray(object.addresses))
|
|
throw TypeError(".cosmos.staking.v1beta1.ValAddresses.addresses: array expected");
|
|
message.addresses = [];
|
|
for (var i = 0; i < object.addresses.length; ++i)
|
|
message.addresses[i] = String(object.addresses[i]);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a ValAddresses message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.ValAddresses
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.ValAddresses} message ValAddresses
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
ValAddresses.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.addresses = [];
|
|
if (message.addresses && message.addresses.length) {
|
|
object.addresses = [];
|
|
for (var j = 0; j < message.addresses.length; ++j)
|
|
object.addresses[j] = message.addresses[j];
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this ValAddresses to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.ValAddresses
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
ValAddresses.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ValAddresses;
|
|
})(v1beta1.ValAddresses || {});
|
|
|
|
v1beta1.DVPair = (function(DVPair) {
|
|
|
|
/**
|
|
* Properties of a DVPair.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IDVPair
|
|
* @property {string|null} [delegatorAddress] DVPair delegatorAddress
|
|
* @property {string|null} [validatorAddress] DVPair validatorAddress
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new DVPair.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a DVPair.
|
|
* @implements IDVPair
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IDVPair=} [properties] Properties to set
|
|
*/
|
|
function DVPair(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* DVPair delegatorAddress.
|
|
* @member {string} delegatorAddress
|
|
* @memberof cosmos.staking.v1beta1.DVPair
|
|
* @instance
|
|
*/
|
|
DVPair.prototype.delegatorAddress = "";
|
|
|
|
/**
|
|
* DVPair validatorAddress.
|
|
* @member {string} validatorAddress
|
|
* @memberof cosmos.staking.v1beta1.DVPair
|
|
* @instance
|
|
*/
|
|
DVPair.prototype.validatorAddress = "";
|
|
|
|
/**
|
|
* Creates a new DVPair instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.DVPair
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDVPair=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.DVPair} DVPair instance
|
|
*/
|
|
DVPair.create = function create(properties) {
|
|
return new DVPair(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified DVPair message. Does not implicitly {@link cosmos.staking.v1beta1.DVPair.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.DVPair
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDVPair} message DVPair message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
DVPair.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress);
|
|
if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified DVPair message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.DVPair.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.DVPair
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDVPair} message DVPair message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
DVPair.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a DVPair message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.DVPair
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.DVPair} DVPair
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
DVPair.decode = 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.staking.v1beta1.DVPair();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.delegatorAddress = reader.string();
|
|
break;
|
|
case 2:
|
|
message.validatorAddress = reader.string();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a DVPair message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.DVPair
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.DVPair} DVPair
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
DVPair.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a DVPair message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.DVPair
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
DVPair.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
if (!$util.isString(message.delegatorAddress))
|
|
return "delegatorAddress: string expected";
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
if (!$util.isString(message.validatorAddress))
|
|
return "validatorAddress: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a DVPair message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.DVPair
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.DVPair} DVPair
|
|
*/
|
|
DVPair.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.DVPair)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.DVPair();
|
|
if (object.delegatorAddress != null)
|
|
message.delegatorAddress = String(object.delegatorAddress);
|
|
if (object.validatorAddress != null)
|
|
message.validatorAddress = String(object.validatorAddress);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a DVPair message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.DVPair
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.DVPair} message DVPair
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
DVPair.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.delegatorAddress = "";
|
|
object.validatorAddress = "";
|
|
}
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
object.delegatorAddress = message.delegatorAddress;
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
object.validatorAddress = message.validatorAddress;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this DVPair to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.DVPair
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
DVPair.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return DVPair;
|
|
})(v1beta1.DVPair || {});
|
|
|
|
v1beta1.DVPairs = (function(DVPairs) {
|
|
|
|
/**
|
|
* Properties of a DVPairs.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IDVPairs
|
|
* @property {Array.<cosmos.staking.v1beta1.IDVPair>|null} [pairs] DVPairs pairs
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new DVPairs.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a DVPairs.
|
|
* @implements IDVPairs
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IDVPairs=} [properties] Properties to set
|
|
*/
|
|
function DVPairs(properties) {
|
|
this.pairs = [];
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* DVPairs pairs.
|
|
* @member {Array.<cosmos.staking.v1beta1.IDVPair>} pairs
|
|
* @memberof cosmos.staking.v1beta1.DVPairs
|
|
* @instance
|
|
*/
|
|
DVPairs.prototype.pairs = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new DVPairs instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.DVPairs
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDVPairs=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.DVPairs} DVPairs instance
|
|
*/
|
|
DVPairs.create = function create(properties) {
|
|
return new DVPairs(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified DVPairs message. Does not implicitly {@link cosmos.staking.v1beta1.DVPairs.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.DVPairs
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDVPairs} message DVPairs message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
DVPairs.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.pairs != null && message.pairs.length)
|
|
for (var i = 0; i < message.pairs.length; ++i)
|
|
$root.cosmos.staking.v1beta1.DVPair.encode(message.pairs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified DVPairs message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.DVPairs.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.DVPairs
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDVPairs} message DVPairs message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
DVPairs.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a DVPairs message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.DVPairs
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.DVPairs} DVPairs
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
DVPairs.decode = 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.staking.v1beta1.DVPairs();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
if (!(message.pairs && message.pairs.length))
|
|
message.pairs = [];
|
|
message.pairs.push($root.cosmos.staking.v1beta1.DVPair.decode(reader, reader.uint32()));
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a DVPairs message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.DVPairs
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.DVPairs} DVPairs
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
DVPairs.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a DVPairs message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.DVPairs
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
DVPairs.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.pairs != null && message.hasOwnProperty("pairs")) {
|
|
if (!Array.isArray(message.pairs))
|
|
return "pairs: array expected";
|
|
for (var i = 0; i < message.pairs.length; ++i) {
|
|
var error = $root.cosmos.staking.v1beta1.DVPair.verify(message.pairs[i]);
|
|
if (error)
|
|
return "pairs." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a DVPairs message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.DVPairs
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.DVPairs} DVPairs
|
|
*/
|
|
DVPairs.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.DVPairs)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.DVPairs();
|
|
if (object.pairs) {
|
|
if (!Array.isArray(object.pairs))
|
|
throw TypeError(".cosmos.staking.v1beta1.DVPairs.pairs: array expected");
|
|
message.pairs = [];
|
|
for (var i = 0; i < object.pairs.length; ++i) {
|
|
if (typeof object.pairs[i] !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.DVPairs.pairs: object expected");
|
|
message.pairs[i] = $root.cosmos.staking.v1beta1.DVPair.fromObject(object.pairs[i]);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a DVPairs message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.DVPairs
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.DVPairs} message DVPairs
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
DVPairs.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.pairs = [];
|
|
if (message.pairs && message.pairs.length) {
|
|
object.pairs = [];
|
|
for (var j = 0; j < message.pairs.length; ++j)
|
|
object.pairs[j] = $root.cosmos.staking.v1beta1.DVPair.toObject(message.pairs[j], options);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this DVPairs to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.DVPairs
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
DVPairs.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return DVPairs;
|
|
})(v1beta1.DVPairs || {});
|
|
|
|
v1beta1.DVVTriplet = (function(DVVTriplet) {
|
|
|
|
/**
|
|
* Properties of a DVVTriplet.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IDVVTriplet
|
|
* @property {string|null} [delegatorAddress] DVVTriplet delegatorAddress
|
|
* @property {string|null} [validatorSrcAddress] DVVTriplet validatorSrcAddress
|
|
* @property {string|null} [validatorDstAddress] DVVTriplet validatorDstAddress
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new DVVTriplet.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a DVVTriplet.
|
|
* @implements IDVVTriplet
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IDVVTriplet=} [properties] Properties to set
|
|
*/
|
|
function DVVTriplet(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* DVVTriplet delegatorAddress.
|
|
* @member {string} delegatorAddress
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplet
|
|
* @instance
|
|
*/
|
|
DVVTriplet.prototype.delegatorAddress = "";
|
|
|
|
/**
|
|
* DVVTriplet validatorSrcAddress.
|
|
* @member {string} validatorSrcAddress
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplet
|
|
* @instance
|
|
*/
|
|
DVVTriplet.prototype.validatorSrcAddress = "";
|
|
|
|
/**
|
|
* DVVTriplet validatorDstAddress.
|
|
* @member {string} validatorDstAddress
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplet
|
|
* @instance
|
|
*/
|
|
DVVTriplet.prototype.validatorDstAddress = "";
|
|
|
|
/**
|
|
* Creates a new DVVTriplet instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplet
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDVVTriplet=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.DVVTriplet} DVVTriplet instance
|
|
*/
|
|
DVVTriplet.create = function create(properties) {
|
|
return new DVVTriplet(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified DVVTriplet message. Does not implicitly {@link cosmos.staking.v1beta1.DVVTriplet.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplet
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDVVTriplet} message DVVTriplet message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
DVVTriplet.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress);
|
|
if (message.validatorSrcAddress != null && Object.hasOwnProperty.call(message, "validatorSrcAddress"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorSrcAddress);
|
|
if (message.validatorDstAddress != null && Object.hasOwnProperty.call(message, "validatorDstAddress"))
|
|
writer.uint32(/* id 3, wireType 2 =*/26).string(message.validatorDstAddress);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified DVVTriplet message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.DVVTriplet.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplet
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDVVTriplet} message DVVTriplet message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
DVVTriplet.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a DVVTriplet message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplet
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.DVVTriplet} DVVTriplet
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
DVVTriplet.decode = 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.staking.v1beta1.DVVTriplet();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.delegatorAddress = reader.string();
|
|
break;
|
|
case 2:
|
|
message.validatorSrcAddress = reader.string();
|
|
break;
|
|
case 3:
|
|
message.validatorDstAddress = reader.string();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a DVVTriplet message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplet
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.DVVTriplet} DVVTriplet
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
DVVTriplet.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a DVVTriplet message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplet
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
DVVTriplet.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
if (!$util.isString(message.delegatorAddress))
|
|
return "delegatorAddress: string expected";
|
|
if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress"))
|
|
if (!$util.isString(message.validatorSrcAddress))
|
|
return "validatorSrcAddress: string expected";
|
|
if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress"))
|
|
if (!$util.isString(message.validatorDstAddress))
|
|
return "validatorDstAddress: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a DVVTriplet message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplet
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.DVVTriplet} DVVTriplet
|
|
*/
|
|
DVVTriplet.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.DVVTriplet)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.DVVTriplet();
|
|
if (object.delegatorAddress != null)
|
|
message.delegatorAddress = String(object.delegatorAddress);
|
|
if (object.validatorSrcAddress != null)
|
|
message.validatorSrcAddress = String(object.validatorSrcAddress);
|
|
if (object.validatorDstAddress != null)
|
|
message.validatorDstAddress = String(object.validatorDstAddress);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a DVVTriplet message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplet
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.DVVTriplet} message DVVTriplet
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
DVVTriplet.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.delegatorAddress = "";
|
|
object.validatorSrcAddress = "";
|
|
object.validatorDstAddress = "";
|
|
}
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
object.delegatorAddress = message.delegatorAddress;
|
|
if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress"))
|
|
object.validatorSrcAddress = message.validatorSrcAddress;
|
|
if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress"))
|
|
object.validatorDstAddress = message.validatorDstAddress;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this DVVTriplet to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplet
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
DVVTriplet.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return DVVTriplet;
|
|
})(v1beta1.DVVTriplet || {});
|
|
|
|
v1beta1.DVVTriplets = (function(DVVTriplets) {
|
|
|
|
/**
|
|
* Properties of a DVVTriplets.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IDVVTriplets
|
|
* @property {Array.<cosmos.staking.v1beta1.IDVVTriplet>|null} [triplets] DVVTriplets triplets
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new DVVTriplets.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a DVVTriplets.
|
|
* @implements IDVVTriplets
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IDVVTriplets=} [properties] Properties to set
|
|
*/
|
|
function DVVTriplets(properties) {
|
|
this.triplets = [];
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* DVVTriplets triplets.
|
|
* @member {Array.<cosmos.staking.v1beta1.IDVVTriplet>} triplets
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplets
|
|
* @instance
|
|
*/
|
|
DVVTriplets.prototype.triplets = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new DVVTriplets instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplets
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDVVTriplets=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.DVVTriplets} DVVTriplets instance
|
|
*/
|
|
DVVTriplets.create = function create(properties) {
|
|
return new DVVTriplets(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified DVVTriplets message. Does not implicitly {@link cosmos.staking.v1beta1.DVVTriplets.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplets
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDVVTriplets} message DVVTriplets message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
DVVTriplets.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.triplets != null && message.triplets.length)
|
|
for (var i = 0; i < message.triplets.length; ++i)
|
|
$root.cosmos.staking.v1beta1.DVVTriplet.encode(message.triplets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified DVVTriplets message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.DVVTriplets.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplets
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDVVTriplets} message DVVTriplets message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
DVVTriplets.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a DVVTriplets message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplets
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.DVVTriplets} DVVTriplets
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
DVVTriplets.decode = 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.staking.v1beta1.DVVTriplets();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
if (!(message.triplets && message.triplets.length))
|
|
message.triplets = [];
|
|
message.triplets.push($root.cosmos.staking.v1beta1.DVVTriplet.decode(reader, reader.uint32()));
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a DVVTriplets message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplets
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.DVVTriplets} DVVTriplets
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
DVVTriplets.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a DVVTriplets message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplets
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
DVVTriplets.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.triplets != null && message.hasOwnProperty("triplets")) {
|
|
if (!Array.isArray(message.triplets))
|
|
return "triplets: array expected";
|
|
for (var i = 0; i < message.triplets.length; ++i) {
|
|
var error = $root.cosmos.staking.v1beta1.DVVTriplet.verify(message.triplets[i]);
|
|
if (error)
|
|
return "triplets." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a DVVTriplets message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplets
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.DVVTriplets} DVVTriplets
|
|
*/
|
|
DVVTriplets.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.DVVTriplets)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.DVVTriplets();
|
|
if (object.triplets) {
|
|
if (!Array.isArray(object.triplets))
|
|
throw TypeError(".cosmos.staking.v1beta1.DVVTriplets.triplets: array expected");
|
|
message.triplets = [];
|
|
for (var i = 0; i < object.triplets.length; ++i) {
|
|
if (typeof object.triplets[i] !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.DVVTriplets.triplets: object expected");
|
|
message.triplets[i] = $root.cosmos.staking.v1beta1.DVVTriplet.fromObject(object.triplets[i]);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a DVVTriplets message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplets
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.DVVTriplets} message DVVTriplets
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
DVVTriplets.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.triplets = [];
|
|
if (message.triplets && message.triplets.length) {
|
|
object.triplets = [];
|
|
for (var j = 0; j < message.triplets.length; ++j)
|
|
object.triplets[j] = $root.cosmos.staking.v1beta1.DVVTriplet.toObject(message.triplets[j], options);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this DVVTriplets to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.DVVTriplets
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
DVVTriplets.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return DVVTriplets;
|
|
})(v1beta1.DVVTriplets || {});
|
|
|
|
v1beta1.Delegation = (function(Delegation) {
|
|
|
|
/**
|
|
* Properties of a Delegation.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IDelegation
|
|
* @property {string|null} [delegatorAddress] Delegation delegatorAddress
|
|
* @property {string|null} [validatorAddress] Delegation validatorAddress
|
|
* @property {string|null} [shares] Delegation shares
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Delegation.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a Delegation.
|
|
* @implements IDelegation
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IDelegation=} [properties] Properties to set
|
|
*/
|
|
function Delegation(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Delegation delegatorAddress.
|
|
* @member {string} delegatorAddress
|
|
* @memberof cosmos.staking.v1beta1.Delegation
|
|
* @instance
|
|
*/
|
|
Delegation.prototype.delegatorAddress = "";
|
|
|
|
/**
|
|
* Delegation validatorAddress.
|
|
* @member {string} validatorAddress
|
|
* @memberof cosmos.staking.v1beta1.Delegation
|
|
* @instance
|
|
*/
|
|
Delegation.prototype.validatorAddress = "";
|
|
|
|
/**
|
|
* Delegation shares.
|
|
* @member {string} shares
|
|
* @memberof cosmos.staking.v1beta1.Delegation
|
|
* @instance
|
|
*/
|
|
Delegation.prototype.shares = "";
|
|
|
|
/**
|
|
* Creates a new Delegation instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.Delegation
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDelegation=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.Delegation} Delegation instance
|
|
*/
|
|
Delegation.create = function create(properties) {
|
|
return new Delegation(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Delegation message. Does not implicitly {@link cosmos.staking.v1beta1.Delegation.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.Delegation
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDelegation} message Delegation message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Delegation.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress);
|
|
if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress);
|
|
if (message.shares != null && Object.hasOwnProperty.call(message, "shares"))
|
|
writer.uint32(/* id 3, wireType 2 =*/26).string(message.shares);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Delegation message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Delegation.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.Delegation
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDelegation} message Delegation message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Delegation.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a Delegation message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.Delegation
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.Delegation} Delegation
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Delegation.decode = 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.staking.v1beta1.Delegation();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.delegatorAddress = reader.string();
|
|
break;
|
|
case 2:
|
|
message.validatorAddress = reader.string();
|
|
break;
|
|
case 3:
|
|
message.shares = reader.string();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a Delegation message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.Delegation
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.Delegation} Delegation
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Delegation.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a Delegation message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.Delegation
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
Delegation.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
if (!$util.isString(message.delegatorAddress))
|
|
return "delegatorAddress: string expected";
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
if (!$util.isString(message.validatorAddress))
|
|
return "validatorAddress: string expected";
|
|
if (message.shares != null && message.hasOwnProperty("shares"))
|
|
if (!$util.isString(message.shares))
|
|
return "shares: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a Delegation message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.Delegation
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.Delegation} Delegation
|
|
*/
|
|
Delegation.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.Delegation)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.Delegation();
|
|
if (object.delegatorAddress != null)
|
|
message.delegatorAddress = String(object.delegatorAddress);
|
|
if (object.validatorAddress != null)
|
|
message.validatorAddress = String(object.validatorAddress);
|
|
if (object.shares != null)
|
|
message.shares = String(object.shares);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a Delegation message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.Delegation
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.Delegation} message Delegation
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Delegation.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.delegatorAddress = "";
|
|
object.validatorAddress = "";
|
|
object.shares = "";
|
|
}
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
object.delegatorAddress = message.delegatorAddress;
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
object.validatorAddress = message.validatorAddress;
|
|
if (message.shares != null && message.hasOwnProperty("shares"))
|
|
object.shares = message.shares;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Delegation to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.Delegation
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Delegation.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Delegation;
|
|
})(v1beta1.Delegation || {});
|
|
|
|
v1beta1.UnbondingDelegation = (function(UnbondingDelegation) {
|
|
|
|
/**
|
|
* Properties of an UnbondingDelegation.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IUnbondingDelegation
|
|
* @property {string|null} [delegatorAddress] UnbondingDelegation delegatorAddress
|
|
* @property {string|null} [validatorAddress] UnbondingDelegation validatorAddress
|
|
* @property {Array.<cosmos.staking.v1beta1.IUnbondingDelegationEntry>|null} [entries] UnbondingDelegation entries
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new UnbondingDelegation.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents an UnbondingDelegation.
|
|
* @implements IUnbondingDelegation
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IUnbondingDelegation=} [properties] Properties to set
|
|
*/
|
|
function UnbondingDelegation(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]];
|
|
}
|
|
|
|
/**
|
|
* UnbondingDelegation delegatorAddress.
|
|
* @member {string} delegatorAddress
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegation
|
|
* @instance
|
|
*/
|
|
UnbondingDelegation.prototype.delegatorAddress = "";
|
|
|
|
/**
|
|
* UnbondingDelegation validatorAddress.
|
|
* @member {string} validatorAddress
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegation
|
|
* @instance
|
|
*/
|
|
UnbondingDelegation.prototype.validatorAddress = "";
|
|
|
|
/**
|
|
* UnbondingDelegation entries.
|
|
* @member {Array.<cosmos.staking.v1beta1.IUnbondingDelegationEntry>} entries
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegation
|
|
* @instance
|
|
*/
|
|
UnbondingDelegation.prototype.entries = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new UnbondingDelegation instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegation
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IUnbondingDelegation=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.UnbondingDelegation} UnbondingDelegation instance
|
|
*/
|
|
UnbondingDelegation.create = function create(properties) {
|
|
return new UnbondingDelegation(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified UnbondingDelegation message. Does not implicitly {@link cosmos.staking.v1beta1.UnbondingDelegation.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegation
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IUnbondingDelegation} message UnbondingDelegation message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
UnbondingDelegation.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress);
|
|
if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress);
|
|
if (message.entries != null && message.entries.length)
|
|
for (var i = 0; i < message.entries.length; ++i)
|
|
$root.cosmos.staking.v1beta1.UnbondingDelegationEntry.encode(message.entries[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified UnbondingDelegation message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.UnbondingDelegation.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegation
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IUnbondingDelegation} message UnbondingDelegation message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
UnbondingDelegation.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes an UnbondingDelegation message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegation
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.UnbondingDelegation} UnbondingDelegation
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
UnbondingDelegation.decode = 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.staking.v1beta1.UnbondingDelegation();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.delegatorAddress = reader.string();
|
|
break;
|
|
case 2:
|
|
message.validatorAddress = reader.string();
|
|
break;
|
|
case 3:
|
|
if (!(message.entries && message.entries.length))
|
|
message.entries = [];
|
|
message.entries.push($root.cosmos.staking.v1beta1.UnbondingDelegationEntry.decode(reader, reader.uint32()));
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes an UnbondingDelegation message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegation
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.UnbondingDelegation} UnbondingDelegation
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
UnbondingDelegation.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies an UnbondingDelegation message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegation
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
UnbondingDelegation.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
if (!$util.isString(message.delegatorAddress))
|
|
return "delegatorAddress: string expected";
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
if (!$util.isString(message.validatorAddress))
|
|
return "validatorAddress: string 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.cosmos.staking.v1beta1.UnbondingDelegationEntry.verify(message.entries[i]);
|
|
if (error)
|
|
return "entries." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates an UnbondingDelegation message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegation
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.UnbondingDelegation} UnbondingDelegation
|
|
*/
|
|
UnbondingDelegation.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.UnbondingDelegation)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.UnbondingDelegation();
|
|
if (object.delegatorAddress != null)
|
|
message.delegatorAddress = String(object.delegatorAddress);
|
|
if (object.validatorAddress != null)
|
|
message.validatorAddress = String(object.validatorAddress);
|
|
if (object.entries) {
|
|
if (!Array.isArray(object.entries))
|
|
throw TypeError(".cosmos.staking.v1beta1.UnbondingDelegation.entries: array expected");
|
|
message.entries = [];
|
|
for (var i = 0; i < object.entries.length; ++i) {
|
|
if (typeof object.entries[i] !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.UnbondingDelegation.entries: object expected");
|
|
message.entries[i] = $root.cosmos.staking.v1beta1.UnbondingDelegationEntry.fromObject(object.entries[i]);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from an UnbondingDelegation message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegation
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.UnbondingDelegation} message UnbondingDelegation
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
UnbondingDelegation.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.entries = [];
|
|
if (options.defaults) {
|
|
object.delegatorAddress = "";
|
|
object.validatorAddress = "";
|
|
}
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
object.delegatorAddress = message.delegatorAddress;
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
object.validatorAddress = message.validatorAddress;
|
|
if (message.entries && message.entries.length) {
|
|
object.entries = [];
|
|
for (var j = 0; j < message.entries.length; ++j)
|
|
object.entries[j] = $root.cosmos.staking.v1beta1.UnbondingDelegationEntry.toObject(message.entries[j], options);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this UnbondingDelegation to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegation
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
UnbondingDelegation.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return UnbondingDelegation;
|
|
})(v1beta1.UnbondingDelegation || {});
|
|
|
|
v1beta1.UnbondingDelegationEntry = (function(UnbondingDelegationEntry) {
|
|
|
|
/**
|
|
* Properties of an UnbondingDelegationEntry.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IUnbondingDelegationEntry
|
|
* @property {number|Long|null} [creationHeight] UnbondingDelegationEntry creationHeight
|
|
* @property {google.protobuf.ITimestamp|null} [completionTime] UnbondingDelegationEntry completionTime
|
|
* @property {string|null} [initialBalance] UnbondingDelegationEntry initialBalance
|
|
* @property {string|null} [balance] UnbondingDelegationEntry balance
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new UnbondingDelegationEntry.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents an UnbondingDelegationEntry.
|
|
* @implements IUnbondingDelegationEntry
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IUnbondingDelegationEntry=} [properties] Properties to set
|
|
*/
|
|
function UnbondingDelegationEntry(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* UnbondingDelegationEntry creationHeight.
|
|
* @member {number|Long} creationHeight
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry
|
|
* @instance
|
|
*/
|
|
UnbondingDelegationEntry.prototype.creationHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* UnbondingDelegationEntry completionTime.
|
|
* @member {google.protobuf.ITimestamp|null|undefined} completionTime
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry
|
|
* @instance
|
|
*/
|
|
UnbondingDelegationEntry.prototype.completionTime = null;
|
|
|
|
/**
|
|
* UnbondingDelegationEntry initialBalance.
|
|
* @member {string} initialBalance
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry
|
|
* @instance
|
|
*/
|
|
UnbondingDelegationEntry.prototype.initialBalance = "";
|
|
|
|
/**
|
|
* UnbondingDelegationEntry balance.
|
|
* @member {string} balance
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry
|
|
* @instance
|
|
*/
|
|
UnbondingDelegationEntry.prototype.balance = "";
|
|
|
|
/**
|
|
* Creates a new UnbondingDelegationEntry instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IUnbondingDelegationEntry=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.UnbondingDelegationEntry} UnbondingDelegationEntry instance
|
|
*/
|
|
UnbondingDelegationEntry.create = function create(properties) {
|
|
return new UnbondingDelegationEntry(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified UnbondingDelegationEntry message. Does not implicitly {@link cosmos.staking.v1beta1.UnbondingDelegationEntry.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IUnbondingDelegationEntry} message UnbondingDelegationEntry message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
UnbondingDelegationEntry.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.creationHeight != null && Object.hasOwnProperty.call(message, "creationHeight"))
|
|
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.creationHeight);
|
|
if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime"))
|
|
$root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
if (message.initialBalance != null && Object.hasOwnProperty.call(message, "initialBalance"))
|
|
writer.uint32(/* id 3, wireType 2 =*/26).string(message.initialBalance);
|
|
if (message.balance != null && Object.hasOwnProperty.call(message, "balance"))
|
|
writer.uint32(/* id 4, wireType 2 =*/34).string(message.balance);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified UnbondingDelegationEntry message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.UnbondingDelegationEntry.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IUnbondingDelegationEntry} message UnbondingDelegationEntry message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
UnbondingDelegationEntry.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes an UnbondingDelegationEntry message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.UnbondingDelegationEntry} UnbondingDelegationEntry
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
UnbondingDelegationEntry.decode = 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.staking.v1beta1.UnbondingDelegationEntry();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.creationHeight = reader.int64();
|
|
break;
|
|
case 2:
|
|
message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
|
break;
|
|
case 3:
|
|
message.initialBalance = reader.string();
|
|
break;
|
|
case 4:
|
|
message.balance = reader.string();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes an UnbondingDelegationEntry message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.UnbondingDelegationEntry} UnbondingDelegationEntry
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
UnbondingDelegationEntry.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies an UnbondingDelegationEntry message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
UnbondingDelegationEntry.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.creationHeight != null && message.hasOwnProperty("creationHeight"))
|
|
if (!$util.isInteger(message.creationHeight) && !(message.creationHeight && $util.isInteger(message.creationHeight.low) && $util.isInteger(message.creationHeight.high)))
|
|
return "creationHeight: integer|Long expected";
|
|
if (message.completionTime != null && message.hasOwnProperty("completionTime")) {
|
|
var error = $root.google.protobuf.Timestamp.verify(message.completionTime);
|
|
if (error)
|
|
return "completionTime." + error;
|
|
}
|
|
if (message.initialBalance != null && message.hasOwnProperty("initialBalance"))
|
|
if (!$util.isString(message.initialBalance))
|
|
return "initialBalance: string expected";
|
|
if (message.balance != null && message.hasOwnProperty("balance"))
|
|
if (!$util.isString(message.balance))
|
|
return "balance: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates an UnbondingDelegationEntry message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.UnbondingDelegationEntry} UnbondingDelegationEntry
|
|
*/
|
|
UnbondingDelegationEntry.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.UnbondingDelegationEntry)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.UnbondingDelegationEntry();
|
|
if (object.creationHeight != null)
|
|
if ($util.Long)
|
|
(message.creationHeight = $util.Long.fromValue(object.creationHeight)).unsigned = false;
|
|
else if (typeof object.creationHeight === "string")
|
|
message.creationHeight = parseInt(object.creationHeight, 10);
|
|
else if (typeof object.creationHeight === "number")
|
|
message.creationHeight = object.creationHeight;
|
|
else if (typeof object.creationHeight === "object")
|
|
message.creationHeight = new $util.LongBits(object.creationHeight.low >>> 0, object.creationHeight.high >>> 0).toNumber();
|
|
if (object.completionTime != null) {
|
|
if (typeof object.completionTime !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.UnbondingDelegationEntry.completionTime: object expected");
|
|
message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime);
|
|
}
|
|
if (object.initialBalance != null)
|
|
message.initialBalance = String(object.initialBalance);
|
|
if (object.balance != null)
|
|
message.balance = String(object.balance);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from an UnbondingDelegationEntry message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.UnbondingDelegationEntry} message UnbondingDelegationEntry
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
UnbondingDelegationEntry.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.creationHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.creationHeight = options.longs === String ? "0" : 0;
|
|
object.completionTime = null;
|
|
object.initialBalance = "";
|
|
object.balance = "";
|
|
}
|
|
if (message.creationHeight != null && message.hasOwnProperty("creationHeight"))
|
|
if (typeof message.creationHeight === "number")
|
|
object.creationHeight = options.longs === String ? String(message.creationHeight) : message.creationHeight;
|
|
else
|
|
object.creationHeight = options.longs === String ? $util.Long.prototype.toString.call(message.creationHeight) : options.longs === Number ? new $util.LongBits(message.creationHeight.low >>> 0, message.creationHeight.high >>> 0).toNumber() : message.creationHeight;
|
|
if (message.completionTime != null && message.hasOwnProperty("completionTime"))
|
|
object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options);
|
|
if (message.initialBalance != null && message.hasOwnProperty("initialBalance"))
|
|
object.initialBalance = message.initialBalance;
|
|
if (message.balance != null && message.hasOwnProperty("balance"))
|
|
object.balance = message.balance;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this UnbondingDelegationEntry to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.UnbondingDelegationEntry
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
UnbondingDelegationEntry.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return UnbondingDelegationEntry;
|
|
})(v1beta1.UnbondingDelegationEntry || {});
|
|
|
|
v1beta1.RedelegationEntry = (function(RedelegationEntry) {
|
|
|
|
/**
|
|
* Properties of a RedelegationEntry.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IRedelegationEntry
|
|
* @property {number|Long|null} [creationHeight] RedelegationEntry creationHeight
|
|
* @property {google.protobuf.ITimestamp|null} [completionTime] RedelegationEntry completionTime
|
|
* @property {string|null} [initialBalance] RedelegationEntry initialBalance
|
|
* @property {string|null} [sharesDst] RedelegationEntry sharesDst
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new RedelegationEntry.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a RedelegationEntry.
|
|
* @implements IRedelegationEntry
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IRedelegationEntry=} [properties] Properties to set
|
|
*/
|
|
function RedelegationEntry(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* RedelegationEntry creationHeight.
|
|
* @member {number|Long} creationHeight
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntry
|
|
* @instance
|
|
*/
|
|
RedelegationEntry.prototype.creationHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* RedelegationEntry completionTime.
|
|
* @member {google.protobuf.ITimestamp|null|undefined} completionTime
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntry
|
|
* @instance
|
|
*/
|
|
RedelegationEntry.prototype.completionTime = null;
|
|
|
|
/**
|
|
* RedelegationEntry initialBalance.
|
|
* @member {string} initialBalance
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntry
|
|
* @instance
|
|
*/
|
|
RedelegationEntry.prototype.initialBalance = "";
|
|
|
|
/**
|
|
* RedelegationEntry sharesDst.
|
|
* @member {string} sharesDst
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntry
|
|
* @instance
|
|
*/
|
|
RedelegationEntry.prototype.sharesDst = "";
|
|
|
|
/**
|
|
* Creates a new RedelegationEntry instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntry
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IRedelegationEntry=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.RedelegationEntry} RedelegationEntry instance
|
|
*/
|
|
RedelegationEntry.create = function create(properties) {
|
|
return new RedelegationEntry(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified RedelegationEntry message. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationEntry.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntry
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IRedelegationEntry} message RedelegationEntry message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
RedelegationEntry.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.creationHeight != null && Object.hasOwnProperty.call(message, "creationHeight"))
|
|
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.creationHeight);
|
|
if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime"))
|
|
$root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
if (message.initialBalance != null && Object.hasOwnProperty.call(message, "initialBalance"))
|
|
writer.uint32(/* id 3, wireType 2 =*/26).string(message.initialBalance);
|
|
if (message.sharesDst != null && Object.hasOwnProperty.call(message, "sharesDst"))
|
|
writer.uint32(/* id 4, wireType 2 =*/34).string(message.sharesDst);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified RedelegationEntry message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationEntry.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntry
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IRedelegationEntry} message RedelegationEntry message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
RedelegationEntry.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a RedelegationEntry message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntry
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.RedelegationEntry} RedelegationEntry
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
RedelegationEntry.decode = 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.staking.v1beta1.RedelegationEntry();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.creationHeight = reader.int64();
|
|
break;
|
|
case 2:
|
|
message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
|
break;
|
|
case 3:
|
|
message.initialBalance = reader.string();
|
|
break;
|
|
case 4:
|
|
message.sharesDst = reader.string();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a RedelegationEntry message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntry
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.RedelegationEntry} RedelegationEntry
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
RedelegationEntry.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a RedelegationEntry message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntry
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
RedelegationEntry.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.creationHeight != null && message.hasOwnProperty("creationHeight"))
|
|
if (!$util.isInteger(message.creationHeight) && !(message.creationHeight && $util.isInteger(message.creationHeight.low) && $util.isInteger(message.creationHeight.high)))
|
|
return "creationHeight: integer|Long expected";
|
|
if (message.completionTime != null && message.hasOwnProperty("completionTime")) {
|
|
var error = $root.google.protobuf.Timestamp.verify(message.completionTime);
|
|
if (error)
|
|
return "completionTime." + error;
|
|
}
|
|
if (message.initialBalance != null && message.hasOwnProperty("initialBalance"))
|
|
if (!$util.isString(message.initialBalance))
|
|
return "initialBalance: string expected";
|
|
if (message.sharesDst != null && message.hasOwnProperty("sharesDst"))
|
|
if (!$util.isString(message.sharesDst))
|
|
return "sharesDst: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a RedelegationEntry message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntry
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.RedelegationEntry} RedelegationEntry
|
|
*/
|
|
RedelegationEntry.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.RedelegationEntry)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.RedelegationEntry();
|
|
if (object.creationHeight != null)
|
|
if ($util.Long)
|
|
(message.creationHeight = $util.Long.fromValue(object.creationHeight)).unsigned = false;
|
|
else if (typeof object.creationHeight === "string")
|
|
message.creationHeight = parseInt(object.creationHeight, 10);
|
|
else if (typeof object.creationHeight === "number")
|
|
message.creationHeight = object.creationHeight;
|
|
else if (typeof object.creationHeight === "object")
|
|
message.creationHeight = new $util.LongBits(object.creationHeight.low >>> 0, object.creationHeight.high >>> 0).toNumber();
|
|
if (object.completionTime != null) {
|
|
if (typeof object.completionTime !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.RedelegationEntry.completionTime: object expected");
|
|
message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime);
|
|
}
|
|
if (object.initialBalance != null)
|
|
message.initialBalance = String(object.initialBalance);
|
|
if (object.sharesDst != null)
|
|
message.sharesDst = String(object.sharesDst);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a RedelegationEntry message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntry
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.RedelegationEntry} message RedelegationEntry
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
RedelegationEntry.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.creationHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.creationHeight = options.longs === String ? "0" : 0;
|
|
object.completionTime = null;
|
|
object.initialBalance = "";
|
|
object.sharesDst = "";
|
|
}
|
|
if (message.creationHeight != null && message.hasOwnProperty("creationHeight"))
|
|
if (typeof message.creationHeight === "number")
|
|
object.creationHeight = options.longs === String ? String(message.creationHeight) : message.creationHeight;
|
|
else
|
|
object.creationHeight = options.longs === String ? $util.Long.prototype.toString.call(message.creationHeight) : options.longs === Number ? new $util.LongBits(message.creationHeight.low >>> 0, message.creationHeight.high >>> 0).toNumber() : message.creationHeight;
|
|
if (message.completionTime != null && message.hasOwnProperty("completionTime"))
|
|
object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options);
|
|
if (message.initialBalance != null && message.hasOwnProperty("initialBalance"))
|
|
object.initialBalance = message.initialBalance;
|
|
if (message.sharesDst != null && message.hasOwnProperty("sharesDst"))
|
|
object.sharesDst = message.sharesDst;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this RedelegationEntry to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntry
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
RedelegationEntry.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return RedelegationEntry;
|
|
})(v1beta1.RedelegationEntry || {});
|
|
|
|
v1beta1.Redelegation = (function(Redelegation) {
|
|
|
|
/**
|
|
* Properties of a Redelegation.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IRedelegation
|
|
* @property {string|null} [delegatorAddress] Redelegation delegatorAddress
|
|
* @property {string|null} [validatorSrcAddress] Redelegation validatorSrcAddress
|
|
* @property {string|null} [validatorDstAddress] Redelegation validatorDstAddress
|
|
* @property {Array.<cosmos.staking.v1beta1.IRedelegationEntry>|null} [entries] Redelegation entries
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Redelegation.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a Redelegation.
|
|
* @implements IRedelegation
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IRedelegation=} [properties] Properties to set
|
|
*/
|
|
function Redelegation(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]];
|
|
}
|
|
|
|
/**
|
|
* Redelegation delegatorAddress.
|
|
* @member {string} delegatorAddress
|
|
* @memberof cosmos.staking.v1beta1.Redelegation
|
|
* @instance
|
|
*/
|
|
Redelegation.prototype.delegatorAddress = "";
|
|
|
|
/**
|
|
* Redelegation validatorSrcAddress.
|
|
* @member {string} validatorSrcAddress
|
|
* @memberof cosmos.staking.v1beta1.Redelegation
|
|
* @instance
|
|
*/
|
|
Redelegation.prototype.validatorSrcAddress = "";
|
|
|
|
/**
|
|
* Redelegation validatorDstAddress.
|
|
* @member {string} validatorDstAddress
|
|
* @memberof cosmos.staking.v1beta1.Redelegation
|
|
* @instance
|
|
*/
|
|
Redelegation.prototype.validatorDstAddress = "";
|
|
|
|
/**
|
|
* Redelegation entries.
|
|
* @member {Array.<cosmos.staking.v1beta1.IRedelegationEntry>} entries
|
|
* @memberof cosmos.staking.v1beta1.Redelegation
|
|
* @instance
|
|
*/
|
|
Redelegation.prototype.entries = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new Redelegation instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.Redelegation
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IRedelegation=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.Redelegation} Redelegation instance
|
|
*/
|
|
Redelegation.create = function create(properties) {
|
|
return new Redelegation(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Redelegation message. Does not implicitly {@link cosmos.staking.v1beta1.Redelegation.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.Redelegation
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IRedelegation} message Redelegation message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Redelegation.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress);
|
|
if (message.validatorSrcAddress != null && Object.hasOwnProperty.call(message, "validatorSrcAddress"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorSrcAddress);
|
|
if (message.validatorDstAddress != null && Object.hasOwnProperty.call(message, "validatorDstAddress"))
|
|
writer.uint32(/* id 3, wireType 2 =*/26).string(message.validatorDstAddress);
|
|
if (message.entries != null && message.entries.length)
|
|
for (var i = 0; i < message.entries.length; ++i)
|
|
$root.cosmos.staking.v1beta1.RedelegationEntry.encode(message.entries[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Redelegation message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Redelegation.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.Redelegation
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IRedelegation} message Redelegation message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Redelegation.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a Redelegation message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.Redelegation
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.Redelegation} Redelegation
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Redelegation.decode = 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.staking.v1beta1.Redelegation();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.delegatorAddress = reader.string();
|
|
break;
|
|
case 2:
|
|
message.validatorSrcAddress = reader.string();
|
|
break;
|
|
case 3:
|
|
message.validatorDstAddress = reader.string();
|
|
break;
|
|
case 4:
|
|
if (!(message.entries && message.entries.length))
|
|
message.entries = [];
|
|
message.entries.push($root.cosmos.staking.v1beta1.RedelegationEntry.decode(reader, reader.uint32()));
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a Redelegation message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.Redelegation
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.Redelegation} Redelegation
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Redelegation.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a Redelegation message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.Redelegation
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
Redelegation.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
if (!$util.isString(message.delegatorAddress))
|
|
return "delegatorAddress: string expected";
|
|
if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress"))
|
|
if (!$util.isString(message.validatorSrcAddress))
|
|
return "validatorSrcAddress: string expected";
|
|
if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress"))
|
|
if (!$util.isString(message.validatorDstAddress))
|
|
return "validatorDstAddress: string 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.cosmos.staking.v1beta1.RedelegationEntry.verify(message.entries[i]);
|
|
if (error)
|
|
return "entries." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a Redelegation message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.Redelegation
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.Redelegation} Redelegation
|
|
*/
|
|
Redelegation.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.Redelegation)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.Redelegation();
|
|
if (object.delegatorAddress != null)
|
|
message.delegatorAddress = String(object.delegatorAddress);
|
|
if (object.validatorSrcAddress != null)
|
|
message.validatorSrcAddress = String(object.validatorSrcAddress);
|
|
if (object.validatorDstAddress != null)
|
|
message.validatorDstAddress = String(object.validatorDstAddress);
|
|
if (object.entries) {
|
|
if (!Array.isArray(object.entries))
|
|
throw TypeError(".cosmos.staking.v1beta1.Redelegation.entries: array expected");
|
|
message.entries = [];
|
|
for (var i = 0; i < object.entries.length; ++i) {
|
|
if (typeof object.entries[i] !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.Redelegation.entries: object expected");
|
|
message.entries[i] = $root.cosmos.staking.v1beta1.RedelegationEntry.fromObject(object.entries[i]);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a Redelegation message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.Redelegation
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.Redelegation} message Redelegation
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Redelegation.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.entries = [];
|
|
if (options.defaults) {
|
|
object.delegatorAddress = "";
|
|
object.validatorSrcAddress = "";
|
|
object.validatorDstAddress = "";
|
|
}
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
object.delegatorAddress = message.delegatorAddress;
|
|
if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress"))
|
|
object.validatorSrcAddress = message.validatorSrcAddress;
|
|
if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress"))
|
|
object.validatorDstAddress = message.validatorDstAddress;
|
|
if (message.entries && message.entries.length) {
|
|
object.entries = [];
|
|
for (var j = 0; j < message.entries.length; ++j)
|
|
object.entries[j] = $root.cosmos.staking.v1beta1.RedelegationEntry.toObject(message.entries[j], options);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Redelegation to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.Redelegation
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Redelegation.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Redelegation;
|
|
})(v1beta1.Redelegation || {});
|
|
|
|
v1beta1.Params = (function(Params) {
|
|
|
|
/**
|
|
* Properties of a Params.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IParams
|
|
* @property {google.protobuf.IDuration|null} [unbondingTime] Params unbondingTime
|
|
* @property {number|null} [maxValidators] Params maxValidators
|
|
* @property {number|null} [maxEntries] Params maxEntries
|
|
* @property {number|null} [historicalEntries] Params historicalEntries
|
|
* @property {string|null} [bondDenom] Params bondDenom
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Params.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a Params.
|
|
* @implements IParams
|
|
* @constructor
|
|
* @param {cosmos.staking.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 unbondingTime.
|
|
* @member {google.protobuf.IDuration|null|undefined} unbondingTime
|
|
* @memberof cosmos.staking.v1beta1.Params
|
|
* @instance
|
|
*/
|
|
Params.prototype.unbondingTime = null;
|
|
|
|
/**
|
|
* Params maxValidators.
|
|
* @member {number} maxValidators
|
|
* @memberof cosmos.staking.v1beta1.Params
|
|
* @instance
|
|
*/
|
|
Params.prototype.maxValidators = 0;
|
|
|
|
/**
|
|
* Params maxEntries.
|
|
* @member {number} maxEntries
|
|
* @memberof cosmos.staking.v1beta1.Params
|
|
* @instance
|
|
*/
|
|
Params.prototype.maxEntries = 0;
|
|
|
|
/**
|
|
* Params historicalEntries.
|
|
* @member {number} historicalEntries
|
|
* @memberof cosmos.staking.v1beta1.Params
|
|
* @instance
|
|
*/
|
|
Params.prototype.historicalEntries = 0;
|
|
|
|
/**
|
|
* Params bondDenom.
|
|
* @member {string} bondDenom
|
|
* @memberof cosmos.staking.v1beta1.Params
|
|
* @instance
|
|
*/
|
|
Params.prototype.bondDenom = "";
|
|
|
|
/**
|
|
* Creates a new Params instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.Params
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IParams=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.Params} Params instance
|
|
*/
|
|
Params.create = function create(properties) {
|
|
return new Params(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Params message. Does not implicitly {@link cosmos.staking.v1beta1.Params.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.Params
|
|
* @static
|
|
* @param {cosmos.staking.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.unbondingTime != null && Object.hasOwnProperty.call(message, "unbondingTime"))
|
|
$root.google.protobuf.Duration.encode(message.unbondingTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.maxValidators != null && Object.hasOwnProperty.call(message, "maxValidators"))
|
|
writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.maxValidators);
|
|
if (message.maxEntries != null && Object.hasOwnProperty.call(message, "maxEntries"))
|
|
writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.maxEntries);
|
|
if (message.historicalEntries != null && Object.hasOwnProperty.call(message, "historicalEntries"))
|
|
writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.historicalEntries);
|
|
if (message.bondDenom != null && Object.hasOwnProperty.call(message, "bondDenom"))
|
|
writer.uint32(/* id 5, wireType 2 =*/42).string(message.bondDenom);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Params message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Params.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.Params
|
|
* @static
|
|
* @param {cosmos.staking.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.staking.v1beta1.Params
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.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.staking.v1beta1.Params();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.unbondingTime = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
message.maxValidators = reader.uint32();
|
|
break;
|
|
case 3:
|
|
message.maxEntries = reader.uint32();
|
|
break;
|
|
case 4:
|
|
message.historicalEntries = reader.uint32();
|
|
break;
|
|
case 5:
|
|
message.bondDenom = 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 cosmos.staking.v1beta1.Params
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.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.staking.v1beta1.Params
|
|
* @static
|
|
* @param {Object.<string,*>} 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.unbondingTime != null && message.hasOwnProperty("unbondingTime")) {
|
|
var error = $root.google.protobuf.Duration.verify(message.unbondingTime);
|
|
if (error)
|
|
return "unbondingTime." + error;
|
|
}
|
|
if (message.maxValidators != null && message.hasOwnProperty("maxValidators"))
|
|
if (!$util.isInteger(message.maxValidators))
|
|
return "maxValidators: integer expected";
|
|
if (message.maxEntries != null && message.hasOwnProperty("maxEntries"))
|
|
if (!$util.isInteger(message.maxEntries))
|
|
return "maxEntries: integer expected";
|
|
if (message.historicalEntries != null && message.hasOwnProperty("historicalEntries"))
|
|
if (!$util.isInteger(message.historicalEntries))
|
|
return "historicalEntries: integer expected";
|
|
if (message.bondDenom != null && message.hasOwnProperty("bondDenom"))
|
|
if (!$util.isString(message.bondDenom))
|
|
return "bondDenom: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a Params message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.Params
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.Params} Params
|
|
*/
|
|
Params.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.Params)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.Params();
|
|
if (object.unbondingTime != null) {
|
|
if (typeof object.unbondingTime !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.Params.unbondingTime: object expected");
|
|
message.unbondingTime = $root.google.protobuf.Duration.fromObject(object.unbondingTime);
|
|
}
|
|
if (object.maxValidators != null)
|
|
message.maxValidators = object.maxValidators >>> 0;
|
|
if (object.maxEntries != null)
|
|
message.maxEntries = object.maxEntries >>> 0;
|
|
if (object.historicalEntries != null)
|
|
message.historicalEntries = object.historicalEntries >>> 0;
|
|
if (object.bondDenom != null)
|
|
message.bondDenom = String(object.bondDenom);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a Params message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.Params
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.Params} message Params
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Params.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.unbondingTime = null;
|
|
object.maxValidators = 0;
|
|
object.maxEntries = 0;
|
|
object.historicalEntries = 0;
|
|
object.bondDenom = "";
|
|
}
|
|
if (message.unbondingTime != null && message.hasOwnProperty("unbondingTime"))
|
|
object.unbondingTime = $root.google.protobuf.Duration.toObject(message.unbondingTime, options);
|
|
if (message.maxValidators != null && message.hasOwnProperty("maxValidators"))
|
|
object.maxValidators = message.maxValidators;
|
|
if (message.maxEntries != null && message.hasOwnProperty("maxEntries"))
|
|
object.maxEntries = message.maxEntries;
|
|
if (message.historicalEntries != null && message.hasOwnProperty("historicalEntries"))
|
|
object.historicalEntries = message.historicalEntries;
|
|
if (message.bondDenom != null && message.hasOwnProperty("bondDenom"))
|
|
object.bondDenom = message.bondDenom;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Params to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.Params
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Params.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Params;
|
|
})(v1beta1.Params || {});
|
|
|
|
v1beta1.DelegationResponse = (function(DelegationResponse) {
|
|
|
|
/**
|
|
* Properties of a DelegationResponse.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IDelegationResponse
|
|
* @property {cosmos.staking.v1beta1.IDelegation|null} [delegation] DelegationResponse delegation
|
|
* @property {cosmos.base.v1beta1.ICoin|null} [balance] DelegationResponse balance
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new DelegationResponse.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a DelegationResponse.
|
|
* @implements IDelegationResponse
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IDelegationResponse=} [properties] Properties to set
|
|
*/
|
|
function DelegationResponse(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* DelegationResponse delegation.
|
|
* @member {cosmos.staking.v1beta1.IDelegation|null|undefined} delegation
|
|
* @memberof cosmos.staking.v1beta1.DelegationResponse
|
|
* @instance
|
|
*/
|
|
DelegationResponse.prototype.delegation = null;
|
|
|
|
/**
|
|
* DelegationResponse balance.
|
|
* @member {cosmos.base.v1beta1.ICoin|null|undefined} balance
|
|
* @memberof cosmos.staking.v1beta1.DelegationResponse
|
|
* @instance
|
|
*/
|
|
DelegationResponse.prototype.balance = null;
|
|
|
|
/**
|
|
* Creates a new DelegationResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.DelegationResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDelegationResponse=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.DelegationResponse} DelegationResponse instance
|
|
*/
|
|
DelegationResponse.create = function create(properties) {
|
|
return new DelegationResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified DelegationResponse message. Does not implicitly {@link cosmos.staking.v1beta1.DelegationResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.DelegationResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDelegationResponse} message DelegationResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
DelegationResponse.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.delegation != null && Object.hasOwnProperty.call(message, "delegation"))
|
|
$root.cosmos.staking.v1beta1.Delegation.encode(message.delegation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.balance != null && Object.hasOwnProperty.call(message, "balance"))
|
|
$root.cosmos.base.v1beta1.Coin.encode(message.balance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified DelegationResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.DelegationResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.DelegationResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IDelegationResponse} message DelegationResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
DelegationResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a DelegationResponse message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.DelegationResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.DelegationResponse} DelegationResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
DelegationResponse.decode = 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.staking.v1beta1.DelegationResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.delegation = $root.cosmos.staking.v1beta1.Delegation.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
message.balance = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32());
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a DelegationResponse message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.DelegationResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.DelegationResponse} DelegationResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
DelegationResponse.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a DelegationResponse message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.DelegationResponse
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
DelegationResponse.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.delegation != null && message.hasOwnProperty("delegation")) {
|
|
var error = $root.cosmos.staking.v1beta1.Delegation.verify(message.delegation);
|
|
if (error)
|
|
return "delegation." + error;
|
|
}
|
|
if (message.balance != null && message.hasOwnProperty("balance")) {
|
|
var error = $root.cosmos.base.v1beta1.Coin.verify(message.balance);
|
|
if (error)
|
|
return "balance." + error;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a DelegationResponse message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.DelegationResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.DelegationResponse} DelegationResponse
|
|
*/
|
|
DelegationResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.DelegationResponse)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.DelegationResponse();
|
|
if (object.delegation != null) {
|
|
if (typeof object.delegation !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.DelegationResponse.delegation: object expected");
|
|
message.delegation = $root.cosmos.staking.v1beta1.Delegation.fromObject(object.delegation);
|
|
}
|
|
if (object.balance != null) {
|
|
if (typeof object.balance !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.DelegationResponse.balance: object expected");
|
|
message.balance = $root.cosmos.base.v1beta1.Coin.fromObject(object.balance);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a DelegationResponse message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.DelegationResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.DelegationResponse} message DelegationResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
DelegationResponse.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.delegation = null;
|
|
object.balance = null;
|
|
}
|
|
if (message.delegation != null && message.hasOwnProperty("delegation"))
|
|
object.delegation = $root.cosmos.staking.v1beta1.Delegation.toObject(message.delegation, options);
|
|
if (message.balance != null && message.hasOwnProperty("balance"))
|
|
object.balance = $root.cosmos.base.v1beta1.Coin.toObject(message.balance, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this DelegationResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.DelegationResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
DelegationResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return DelegationResponse;
|
|
})(v1beta1.DelegationResponse || {});
|
|
|
|
v1beta1.RedelegationEntryResponse = (function(RedelegationEntryResponse) {
|
|
|
|
/**
|
|
* Properties of a RedelegationEntryResponse.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IRedelegationEntryResponse
|
|
* @property {cosmos.staking.v1beta1.IRedelegationEntry|null} [redelegationEntry] RedelegationEntryResponse redelegationEntry
|
|
* @property {string|null} [balance] RedelegationEntryResponse balance
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new RedelegationEntryResponse.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a RedelegationEntryResponse.
|
|
* @implements IRedelegationEntryResponse
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IRedelegationEntryResponse=} [properties] Properties to set
|
|
*/
|
|
function RedelegationEntryResponse(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* RedelegationEntryResponse redelegationEntry.
|
|
* @member {cosmos.staking.v1beta1.IRedelegationEntry|null|undefined} redelegationEntry
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntryResponse
|
|
* @instance
|
|
*/
|
|
RedelegationEntryResponse.prototype.redelegationEntry = null;
|
|
|
|
/**
|
|
* RedelegationEntryResponse balance.
|
|
* @member {string} balance
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntryResponse
|
|
* @instance
|
|
*/
|
|
RedelegationEntryResponse.prototype.balance = "";
|
|
|
|
/**
|
|
* Creates a new RedelegationEntryResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntryResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IRedelegationEntryResponse=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.RedelegationEntryResponse} RedelegationEntryResponse instance
|
|
*/
|
|
RedelegationEntryResponse.create = function create(properties) {
|
|
return new RedelegationEntryResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified RedelegationEntryResponse message. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationEntryResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntryResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IRedelegationEntryResponse} message RedelegationEntryResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
RedelegationEntryResponse.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.redelegationEntry != null && Object.hasOwnProperty.call(message, "redelegationEntry"))
|
|
$root.cosmos.staking.v1beta1.RedelegationEntry.encode(message.redelegationEntry, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.balance != null && Object.hasOwnProperty.call(message, "balance"))
|
|
writer.uint32(/* id 4, wireType 2 =*/34).string(message.balance);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified RedelegationEntryResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationEntryResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntryResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IRedelegationEntryResponse} message RedelegationEntryResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
RedelegationEntryResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a RedelegationEntryResponse message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntryResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.RedelegationEntryResponse} RedelegationEntryResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
RedelegationEntryResponse.decode = 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.staking.v1beta1.RedelegationEntryResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.redelegationEntry = $root.cosmos.staking.v1beta1.RedelegationEntry.decode(reader, reader.uint32());
|
|
break;
|
|
case 4:
|
|
message.balance = reader.string();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a RedelegationEntryResponse message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntryResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.RedelegationEntryResponse} RedelegationEntryResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
RedelegationEntryResponse.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a RedelegationEntryResponse message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntryResponse
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
RedelegationEntryResponse.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.redelegationEntry != null && message.hasOwnProperty("redelegationEntry")) {
|
|
var error = $root.cosmos.staking.v1beta1.RedelegationEntry.verify(message.redelegationEntry);
|
|
if (error)
|
|
return "redelegationEntry." + error;
|
|
}
|
|
if (message.balance != null && message.hasOwnProperty("balance"))
|
|
if (!$util.isString(message.balance))
|
|
return "balance: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a RedelegationEntryResponse message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntryResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.RedelegationEntryResponse} RedelegationEntryResponse
|
|
*/
|
|
RedelegationEntryResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.RedelegationEntryResponse)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.RedelegationEntryResponse();
|
|
if (object.redelegationEntry != null) {
|
|
if (typeof object.redelegationEntry !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.RedelegationEntryResponse.redelegationEntry: object expected");
|
|
message.redelegationEntry = $root.cosmos.staking.v1beta1.RedelegationEntry.fromObject(object.redelegationEntry);
|
|
}
|
|
if (object.balance != null)
|
|
message.balance = String(object.balance);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a RedelegationEntryResponse message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntryResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.RedelegationEntryResponse} message RedelegationEntryResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
RedelegationEntryResponse.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.redelegationEntry = null;
|
|
object.balance = "";
|
|
}
|
|
if (message.redelegationEntry != null && message.hasOwnProperty("redelegationEntry"))
|
|
object.redelegationEntry = $root.cosmos.staking.v1beta1.RedelegationEntry.toObject(message.redelegationEntry, options);
|
|
if (message.balance != null && message.hasOwnProperty("balance"))
|
|
object.balance = message.balance;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this RedelegationEntryResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.RedelegationEntryResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
RedelegationEntryResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return RedelegationEntryResponse;
|
|
})(v1beta1.RedelegationEntryResponse || {});
|
|
|
|
v1beta1.RedelegationResponse = (function(RedelegationResponse) {
|
|
|
|
/**
|
|
* Properties of a RedelegationResponse.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IRedelegationResponse
|
|
* @property {cosmos.staking.v1beta1.IRedelegation|null} [redelegation] RedelegationResponse redelegation
|
|
* @property {Array.<cosmos.staking.v1beta1.IRedelegationEntryResponse>|null} [entries] RedelegationResponse entries
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new RedelegationResponse.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a RedelegationResponse.
|
|
* @implements IRedelegationResponse
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IRedelegationResponse=} [properties] Properties to set
|
|
*/
|
|
function RedelegationResponse(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]];
|
|
}
|
|
|
|
/**
|
|
* RedelegationResponse redelegation.
|
|
* @member {cosmos.staking.v1beta1.IRedelegation|null|undefined} redelegation
|
|
* @memberof cosmos.staking.v1beta1.RedelegationResponse
|
|
* @instance
|
|
*/
|
|
RedelegationResponse.prototype.redelegation = null;
|
|
|
|
/**
|
|
* RedelegationResponse entries.
|
|
* @member {Array.<cosmos.staking.v1beta1.IRedelegationEntryResponse>} entries
|
|
* @memberof cosmos.staking.v1beta1.RedelegationResponse
|
|
* @instance
|
|
*/
|
|
RedelegationResponse.prototype.entries = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new RedelegationResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.RedelegationResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IRedelegationResponse=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.RedelegationResponse} RedelegationResponse instance
|
|
*/
|
|
RedelegationResponse.create = function create(properties) {
|
|
return new RedelegationResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified RedelegationResponse message. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.RedelegationResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IRedelegationResponse} message RedelegationResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
RedelegationResponse.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.redelegation != null && Object.hasOwnProperty.call(message, "redelegation"))
|
|
$root.cosmos.staking.v1beta1.Redelegation.encode(message.redelegation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.entries != null && message.entries.length)
|
|
for (var i = 0; i < message.entries.length; ++i)
|
|
$root.cosmos.staking.v1beta1.RedelegationEntryResponse.encode(message.entries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified RedelegationResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.RedelegationResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.RedelegationResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IRedelegationResponse} message RedelegationResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
RedelegationResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a RedelegationResponse message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.RedelegationResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.RedelegationResponse} RedelegationResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
RedelegationResponse.decode = 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.staking.v1beta1.RedelegationResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.redelegation = $root.cosmos.staking.v1beta1.Redelegation.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
if (!(message.entries && message.entries.length))
|
|
message.entries = [];
|
|
message.entries.push($root.cosmos.staking.v1beta1.RedelegationEntryResponse.decode(reader, reader.uint32()));
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a RedelegationResponse message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.RedelegationResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.RedelegationResponse} RedelegationResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
RedelegationResponse.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a RedelegationResponse message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.RedelegationResponse
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
RedelegationResponse.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.redelegation != null && message.hasOwnProperty("redelegation")) {
|
|
var error = $root.cosmos.staking.v1beta1.Redelegation.verify(message.redelegation);
|
|
if (error)
|
|
return "redelegation." + error;
|
|
}
|
|
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.cosmos.staking.v1beta1.RedelegationEntryResponse.verify(message.entries[i]);
|
|
if (error)
|
|
return "entries." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a RedelegationResponse message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.RedelegationResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.RedelegationResponse} RedelegationResponse
|
|
*/
|
|
RedelegationResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.RedelegationResponse)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.RedelegationResponse();
|
|
if (object.redelegation != null) {
|
|
if (typeof object.redelegation !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.RedelegationResponse.redelegation: object expected");
|
|
message.redelegation = $root.cosmos.staking.v1beta1.Redelegation.fromObject(object.redelegation);
|
|
}
|
|
if (object.entries) {
|
|
if (!Array.isArray(object.entries))
|
|
throw TypeError(".cosmos.staking.v1beta1.RedelegationResponse.entries: array expected");
|
|
message.entries = [];
|
|
for (var i = 0; i < object.entries.length; ++i) {
|
|
if (typeof object.entries[i] !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.RedelegationResponse.entries: object expected");
|
|
message.entries[i] = $root.cosmos.staking.v1beta1.RedelegationEntryResponse.fromObject(object.entries[i]);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a RedelegationResponse message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.RedelegationResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.RedelegationResponse} message RedelegationResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
RedelegationResponse.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.entries = [];
|
|
if (options.defaults)
|
|
object.redelegation = null;
|
|
if (message.redelegation != null && message.hasOwnProperty("redelegation"))
|
|
object.redelegation = $root.cosmos.staking.v1beta1.Redelegation.toObject(message.redelegation, options);
|
|
if (message.entries && message.entries.length) {
|
|
object.entries = [];
|
|
for (var j = 0; j < message.entries.length; ++j)
|
|
object.entries[j] = $root.cosmos.staking.v1beta1.RedelegationEntryResponse.toObject(message.entries[j], options);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this RedelegationResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.RedelegationResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
RedelegationResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return RedelegationResponse;
|
|
})(v1beta1.RedelegationResponse || {});
|
|
|
|
v1beta1.Pool = (function(Pool) {
|
|
|
|
/**
|
|
* Properties of a Pool.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IPool
|
|
* @property {string|null} [notBondedTokens] Pool notBondedTokens
|
|
* @property {string|null} [bondedTokens] Pool bondedTokens
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Pool.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a Pool.
|
|
* @implements IPool
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IPool=} [properties] Properties to set
|
|
*/
|
|
function Pool(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Pool notBondedTokens.
|
|
* @member {string} notBondedTokens
|
|
* @memberof cosmos.staking.v1beta1.Pool
|
|
* @instance
|
|
*/
|
|
Pool.prototype.notBondedTokens = "";
|
|
|
|
/**
|
|
* Pool bondedTokens.
|
|
* @member {string} bondedTokens
|
|
* @memberof cosmos.staking.v1beta1.Pool
|
|
* @instance
|
|
*/
|
|
Pool.prototype.bondedTokens = "";
|
|
|
|
/**
|
|
* Creates a new Pool instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.Pool
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IPool=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.Pool} Pool instance
|
|
*/
|
|
Pool.create = function create(properties) {
|
|
return new Pool(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Pool message. Does not implicitly {@link cosmos.staking.v1beta1.Pool.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.Pool
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IPool} message Pool message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Pool.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.notBondedTokens != null && Object.hasOwnProperty.call(message, "notBondedTokens"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.notBondedTokens);
|
|
if (message.bondedTokens != null && Object.hasOwnProperty.call(message, "bondedTokens"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.bondedTokens);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Pool message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.Pool.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.Pool
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IPool} message Pool message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Pool.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a Pool message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.Pool
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.Pool} Pool
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Pool.decode = 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.staking.v1beta1.Pool();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.notBondedTokens = reader.string();
|
|
break;
|
|
case 2:
|
|
message.bondedTokens = reader.string();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a Pool message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.Pool
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.Pool} Pool
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Pool.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a Pool message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.Pool
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
Pool.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.notBondedTokens != null && message.hasOwnProperty("notBondedTokens"))
|
|
if (!$util.isString(message.notBondedTokens))
|
|
return "notBondedTokens: string expected";
|
|
if (message.bondedTokens != null && message.hasOwnProperty("bondedTokens"))
|
|
if (!$util.isString(message.bondedTokens))
|
|
return "bondedTokens: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a Pool message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.Pool
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.Pool} Pool
|
|
*/
|
|
Pool.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.Pool)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.Pool();
|
|
if (object.notBondedTokens != null)
|
|
message.notBondedTokens = String(object.notBondedTokens);
|
|
if (object.bondedTokens != null)
|
|
message.bondedTokens = String(object.bondedTokens);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a Pool message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.Pool
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.Pool} message Pool
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Pool.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.notBondedTokens = "";
|
|
object.bondedTokens = "";
|
|
}
|
|
if (message.notBondedTokens != null && message.hasOwnProperty("notBondedTokens"))
|
|
object.notBondedTokens = message.notBondedTokens;
|
|
if (message.bondedTokens != null && message.hasOwnProperty("bondedTokens"))
|
|
object.bondedTokens = message.bondedTokens;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Pool to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.Pool
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Pool.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Pool;
|
|
})(v1beta1.Pool || {});
|
|
|
|
v1beta1.Msg = (function(Msg) {
|
|
|
|
/**
|
|
* Constructs a new Msg service.
|
|
* @memberof cosmos.staking.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;
|
|
|
|
/**
|
|
* Creates new Msg service using the specified rpc implementation.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.Msg
|
|
* @static
|
|
* @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
|
* @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
|
* @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
|
* @returns {Msg} RPC service. Useful where requests and/or responses are streamed.
|
|
*/
|
|
Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
|
return new this(rpcImpl, requestDelimited, responseDelimited);
|
|
};
|
|
|
|
/**
|
|
* Callback as used by {@link cosmos.staking.v1beta1.Msg#createValidator}.
|
|
* @memberof cosmos.staking.v1beta1.Msg
|
|
* @typedef CreateValidatorCallback
|
|
* @type {function}
|
|
* @param {Error|null} error Error, if any
|
|
* @param {cosmos.staking.v1beta1.IMsgCreateValidatorResponse} [response] MsgCreateValidatorResponse
|
|
*/
|
|
|
|
/**
|
|
* Calls CreateValidator.
|
|
* @function createValidator
|
|
* @memberof cosmos.staking.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.staking.v1beta1.IMsgCreateValidator} request MsgCreateValidator message or plain object
|
|
* @param {cosmos.staking.v1beta1.Msg.CreateValidatorCallback} callback Node-style callback called with the error, if any, and MsgCreateValidatorResponse
|
|
* @returns {undefined}
|
|
* @variation 1
|
|
*/
|
|
Object.defineProperty(Msg.prototype.createValidator = function createValidator(request, callback) {
|
|
return this.rpcCall(createValidator, $root.cosmos.staking.v1beta1.MsgCreateValidator, $root.cosmos.staking.v1beta1.MsgCreateValidatorResponse, request, callback);
|
|
}, "name", { value: "CreateValidator" });
|
|
|
|
/**
|
|
* Calls CreateValidator.
|
|
* @function createValidator
|
|
* @memberof cosmos.staking.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.staking.v1beta1.IMsgCreateValidator} request MsgCreateValidator message or plain object
|
|
* @returns {Promise<cosmos.staking.v1beta1.IMsgCreateValidatorResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
/**
|
|
* Callback as used by {@link cosmos.staking.v1beta1.Msg#editValidator}.
|
|
* @memberof cosmos.staking.v1beta1.Msg
|
|
* @typedef EditValidatorCallback
|
|
* @type {function}
|
|
* @param {Error|null} error Error, if any
|
|
* @param {cosmos.staking.v1beta1.IMsgEditValidatorResponse} [response] MsgEditValidatorResponse
|
|
*/
|
|
|
|
/**
|
|
* Calls EditValidator.
|
|
* @function editValidator
|
|
* @memberof cosmos.staking.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.staking.v1beta1.IMsgEditValidator} request MsgEditValidator message or plain object
|
|
* @param {cosmos.staking.v1beta1.Msg.EditValidatorCallback} callback Node-style callback called with the error, if any, and MsgEditValidatorResponse
|
|
* @returns {undefined}
|
|
* @variation 1
|
|
*/
|
|
Object.defineProperty(Msg.prototype.editValidator = function editValidator(request, callback) {
|
|
return this.rpcCall(editValidator, $root.cosmos.staking.v1beta1.MsgEditValidator, $root.cosmos.staking.v1beta1.MsgEditValidatorResponse, request, callback);
|
|
}, "name", { value: "EditValidator" });
|
|
|
|
/**
|
|
* Calls EditValidator.
|
|
* @function editValidator
|
|
* @memberof cosmos.staking.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.staking.v1beta1.IMsgEditValidator} request MsgEditValidator message or plain object
|
|
* @returns {Promise<cosmos.staking.v1beta1.IMsgEditValidatorResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
/**
|
|
* Callback as used by {@link cosmos.staking.v1beta1.Msg#delegate}.
|
|
* @memberof cosmos.staking.v1beta1.Msg
|
|
* @typedef DelegateCallback
|
|
* @type {function}
|
|
* @param {Error|null} error Error, if any
|
|
* @param {cosmos.staking.v1beta1.IMsgDelegateResponse} [response] MsgDelegateResponse
|
|
*/
|
|
|
|
/**
|
|
* Calls Delegate.
|
|
* @function delegate
|
|
* @memberof cosmos.staking.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.staking.v1beta1.IMsgDelegate} request MsgDelegate message or plain object
|
|
* @param {cosmos.staking.v1beta1.Msg.DelegateCallback} callback Node-style callback called with the error, if any, and MsgDelegateResponse
|
|
* @returns {undefined}
|
|
* @variation 1
|
|
*/
|
|
Object.defineProperty(Msg.prototype.delegate = function delegate(request, callback) {
|
|
return this.rpcCall(delegate, $root.cosmos.staking.v1beta1.MsgDelegate, $root.cosmos.staking.v1beta1.MsgDelegateResponse, request, callback);
|
|
}, "name", { value: "Delegate" });
|
|
|
|
/**
|
|
* Calls Delegate.
|
|
* @function delegate
|
|
* @memberof cosmos.staking.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.staking.v1beta1.IMsgDelegate} request MsgDelegate message or plain object
|
|
* @returns {Promise<cosmos.staking.v1beta1.IMsgDelegateResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
/**
|
|
* Callback as used by {@link cosmos.staking.v1beta1.Msg#beginRedelegate}.
|
|
* @memberof cosmos.staking.v1beta1.Msg
|
|
* @typedef BeginRedelegateCallback
|
|
* @type {function}
|
|
* @param {Error|null} error Error, if any
|
|
* @param {cosmos.staking.v1beta1.IMsgBeginRedelegateResponse} [response] MsgBeginRedelegateResponse
|
|
*/
|
|
|
|
/**
|
|
* Calls BeginRedelegate.
|
|
* @function beginRedelegate
|
|
* @memberof cosmos.staking.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.staking.v1beta1.IMsgBeginRedelegate} request MsgBeginRedelegate message or plain object
|
|
* @param {cosmos.staking.v1beta1.Msg.BeginRedelegateCallback} callback Node-style callback called with the error, if any, and MsgBeginRedelegateResponse
|
|
* @returns {undefined}
|
|
* @variation 1
|
|
*/
|
|
Object.defineProperty(Msg.prototype.beginRedelegate = function beginRedelegate(request, callback) {
|
|
return this.rpcCall(beginRedelegate, $root.cosmos.staking.v1beta1.MsgBeginRedelegate, $root.cosmos.staking.v1beta1.MsgBeginRedelegateResponse, request, callback);
|
|
}, "name", { value: "BeginRedelegate" });
|
|
|
|
/**
|
|
* Calls BeginRedelegate.
|
|
* @function beginRedelegate
|
|
* @memberof cosmos.staking.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.staking.v1beta1.IMsgBeginRedelegate} request MsgBeginRedelegate message or plain object
|
|
* @returns {Promise<cosmos.staking.v1beta1.IMsgBeginRedelegateResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
/**
|
|
* Callback as used by {@link cosmos.staking.v1beta1.Msg#undelegate}.
|
|
* @memberof cosmos.staking.v1beta1.Msg
|
|
* @typedef UndelegateCallback
|
|
* @type {function}
|
|
* @param {Error|null} error Error, if any
|
|
* @param {cosmos.staking.v1beta1.IMsgUndelegateResponse} [response] MsgUndelegateResponse
|
|
*/
|
|
|
|
/**
|
|
* Calls Undelegate.
|
|
* @function undelegate
|
|
* @memberof cosmos.staking.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.staking.v1beta1.IMsgUndelegate} request MsgUndelegate message or plain object
|
|
* @param {cosmos.staking.v1beta1.Msg.UndelegateCallback} callback Node-style callback called with the error, if any, and MsgUndelegateResponse
|
|
* @returns {undefined}
|
|
* @variation 1
|
|
*/
|
|
Object.defineProperty(Msg.prototype.undelegate = function undelegate(request, callback) {
|
|
return this.rpcCall(undelegate, $root.cosmos.staking.v1beta1.MsgUndelegate, $root.cosmos.staking.v1beta1.MsgUndelegateResponse, request, callback);
|
|
}, "name", { value: "Undelegate" });
|
|
|
|
/**
|
|
* Calls Undelegate.
|
|
* @function undelegate
|
|
* @memberof cosmos.staking.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.staking.v1beta1.IMsgUndelegate} request MsgUndelegate message or plain object
|
|
* @returns {Promise<cosmos.staking.v1beta1.IMsgUndelegateResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
return Msg;
|
|
})(v1beta1.Msg || {});
|
|
|
|
v1beta1.MsgCreateValidator = (function(MsgCreateValidator) {
|
|
|
|
/**
|
|
* Properties of a MsgCreateValidator.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IMsgCreateValidator
|
|
* @property {cosmos.staking.v1beta1.IDescription|null} [description] MsgCreateValidator description
|
|
* @property {cosmos.staking.v1beta1.ICommissionRates|null} [commission] MsgCreateValidator commission
|
|
* @property {string|null} [minSelfDelegation] MsgCreateValidator minSelfDelegation
|
|
* @property {string|null} [delegatorAddress] MsgCreateValidator delegatorAddress
|
|
* @property {string|null} [validatorAddress] MsgCreateValidator validatorAddress
|
|
* @property {google.protobuf.IAny|null} [pubkey] MsgCreateValidator pubkey
|
|
* @property {cosmos.base.v1beta1.ICoin|null} [value] MsgCreateValidator value
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgCreateValidator.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a MsgCreateValidator.
|
|
* @implements IMsgCreateValidator
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IMsgCreateValidator=} [properties] Properties to set
|
|
*/
|
|
function MsgCreateValidator(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* MsgCreateValidator description.
|
|
* @member {cosmos.staking.v1beta1.IDescription|null|undefined} description
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidator
|
|
* @instance
|
|
*/
|
|
MsgCreateValidator.prototype.description = null;
|
|
|
|
/**
|
|
* MsgCreateValidator commission.
|
|
* @member {cosmos.staking.v1beta1.ICommissionRates|null|undefined} commission
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidator
|
|
* @instance
|
|
*/
|
|
MsgCreateValidator.prototype.commission = null;
|
|
|
|
/**
|
|
* MsgCreateValidator minSelfDelegation.
|
|
* @member {string} minSelfDelegation
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidator
|
|
* @instance
|
|
*/
|
|
MsgCreateValidator.prototype.minSelfDelegation = "";
|
|
|
|
/**
|
|
* MsgCreateValidator delegatorAddress.
|
|
* @member {string} delegatorAddress
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidator
|
|
* @instance
|
|
*/
|
|
MsgCreateValidator.prototype.delegatorAddress = "";
|
|
|
|
/**
|
|
* MsgCreateValidator validatorAddress.
|
|
* @member {string} validatorAddress
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidator
|
|
* @instance
|
|
*/
|
|
MsgCreateValidator.prototype.validatorAddress = "";
|
|
|
|
/**
|
|
* MsgCreateValidator pubkey.
|
|
* @member {google.protobuf.IAny|null|undefined} pubkey
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidator
|
|
* @instance
|
|
*/
|
|
MsgCreateValidator.prototype.pubkey = null;
|
|
|
|
/**
|
|
* MsgCreateValidator value.
|
|
* @member {cosmos.base.v1beta1.ICoin|null|undefined} value
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidator
|
|
* @instance
|
|
*/
|
|
MsgCreateValidator.prototype.value = null;
|
|
|
|
/**
|
|
* Creates a new MsgCreateValidator instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidator
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgCreateValidator=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.MsgCreateValidator} MsgCreateValidator instance
|
|
*/
|
|
MsgCreateValidator.create = function create(properties) {
|
|
return new MsgCreateValidator(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgCreateValidator message. Does not implicitly {@link cosmos.staking.v1beta1.MsgCreateValidator.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidator
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgCreateValidator} message MsgCreateValidator message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgCreateValidator.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.description != null && Object.hasOwnProperty.call(message, "description"))
|
|
$root.cosmos.staking.v1beta1.Description.encode(message.description, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.commission != null && Object.hasOwnProperty.call(message, "commission"))
|
|
$root.cosmos.staking.v1beta1.CommissionRates.encode(message.commission, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
if (message.minSelfDelegation != null && Object.hasOwnProperty.call(message, "minSelfDelegation"))
|
|
writer.uint32(/* id 3, wireType 2 =*/26).string(message.minSelfDelegation);
|
|
if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress"))
|
|
writer.uint32(/* id 4, wireType 2 =*/34).string(message.delegatorAddress);
|
|
if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress"))
|
|
writer.uint32(/* id 5, wireType 2 =*/42).string(message.validatorAddress);
|
|
if (message.pubkey != null && Object.hasOwnProperty.call(message, "pubkey"))
|
|
$root.google.protobuf.Any.encode(message.pubkey, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
|
if (message.value != null && Object.hasOwnProperty.call(message, "value"))
|
|
$root.cosmos.base.v1beta1.Coin.encode(message.value, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgCreateValidator message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgCreateValidator.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidator
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgCreateValidator} message MsgCreateValidator message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgCreateValidator.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgCreateValidator message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidator
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.MsgCreateValidator} MsgCreateValidator
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgCreateValidator.decode = 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.staking.v1beta1.MsgCreateValidator();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.description = $root.cosmos.staking.v1beta1.Description.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
message.commission = $root.cosmos.staking.v1beta1.CommissionRates.decode(reader, reader.uint32());
|
|
break;
|
|
case 3:
|
|
message.minSelfDelegation = reader.string();
|
|
break;
|
|
case 4:
|
|
message.delegatorAddress = reader.string();
|
|
break;
|
|
case 5:
|
|
message.validatorAddress = reader.string();
|
|
break;
|
|
case 6:
|
|
message.pubkey = $root.google.protobuf.Any.decode(reader, reader.uint32());
|
|
break;
|
|
case 7:
|
|
message.value = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32());
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgCreateValidator message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidator
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.MsgCreateValidator} MsgCreateValidator
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgCreateValidator.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgCreateValidator message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidator
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgCreateValidator.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.description != null && message.hasOwnProperty("description")) {
|
|
var error = $root.cosmos.staking.v1beta1.Description.verify(message.description);
|
|
if (error)
|
|
return "description." + error;
|
|
}
|
|
if (message.commission != null && message.hasOwnProperty("commission")) {
|
|
var error = $root.cosmos.staking.v1beta1.CommissionRates.verify(message.commission);
|
|
if (error)
|
|
return "commission." + error;
|
|
}
|
|
if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation"))
|
|
if (!$util.isString(message.minSelfDelegation))
|
|
return "minSelfDelegation: string expected";
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
if (!$util.isString(message.delegatorAddress))
|
|
return "delegatorAddress: string expected";
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
if (!$util.isString(message.validatorAddress))
|
|
return "validatorAddress: string expected";
|
|
if (message.pubkey != null && message.hasOwnProperty("pubkey")) {
|
|
var error = $root.google.protobuf.Any.verify(message.pubkey);
|
|
if (error)
|
|
return "pubkey." + error;
|
|
}
|
|
if (message.value != null && message.hasOwnProperty("value")) {
|
|
var error = $root.cosmos.base.v1beta1.Coin.verify(message.value);
|
|
if (error)
|
|
return "value." + error;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgCreateValidator message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidator
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.MsgCreateValidator} MsgCreateValidator
|
|
*/
|
|
MsgCreateValidator.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.MsgCreateValidator)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.MsgCreateValidator();
|
|
if (object.description != null) {
|
|
if (typeof object.description !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.MsgCreateValidator.description: object expected");
|
|
message.description = $root.cosmos.staking.v1beta1.Description.fromObject(object.description);
|
|
}
|
|
if (object.commission != null) {
|
|
if (typeof object.commission !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.MsgCreateValidator.commission: object expected");
|
|
message.commission = $root.cosmos.staking.v1beta1.CommissionRates.fromObject(object.commission);
|
|
}
|
|
if (object.minSelfDelegation != null)
|
|
message.minSelfDelegation = String(object.minSelfDelegation);
|
|
if (object.delegatorAddress != null)
|
|
message.delegatorAddress = String(object.delegatorAddress);
|
|
if (object.validatorAddress != null)
|
|
message.validatorAddress = String(object.validatorAddress);
|
|
if (object.pubkey != null) {
|
|
if (typeof object.pubkey !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.MsgCreateValidator.pubkey: object expected");
|
|
message.pubkey = $root.google.protobuf.Any.fromObject(object.pubkey);
|
|
}
|
|
if (object.value != null) {
|
|
if (typeof object.value !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.MsgCreateValidator.value: object expected");
|
|
message.value = $root.cosmos.base.v1beta1.Coin.fromObject(object.value);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgCreateValidator message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidator
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.MsgCreateValidator} message MsgCreateValidator
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgCreateValidator.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.description = null;
|
|
object.commission = null;
|
|
object.minSelfDelegation = "";
|
|
object.delegatorAddress = "";
|
|
object.validatorAddress = "";
|
|
object.pubkey = null;
|
|
object.value = null;
|
|
}
|
|
if (message.description != null && message.hasOwnProperty("description"))
|
|
object.description = $root.cosmos.staking.v1beta1.Description.toObject(message.description, options);
|
|
if (message.commission != null && message.hasOwnProperty("commission"))
|
|
object.commission = $root.cosmos.staking.v1beta1.CommissionRates.toObject(message.commission, options);
|
|
if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation"))
|
|
object.minSelfDelegation = message.minSelfDelegation;
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
object.delegatorAddress = message.delegatorAddress;
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
object.validatorAddress = message.validatorAddress;
|
|
if (message.pubkey != null && message.hasOwnProperty("pubkey"))
|
|
object.pubkey = $root.google.protobuf.Any.toObject(message.pubkey, options);
|
|
if (message.value != null && message.hasOwnProperty("value"))
|
|
object.value = $root.cosmos.base.v1beta1.Coin.toObject(message.value, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgCreateValidator to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidator
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgCreateValidator.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgCreateValidator;
|
|
})(v1beta1.MsgCreateValidator || {});
|
|
|
|
v1beta1.MsgCreateValidatorResponse = (function(MsgCreateValidatorResponse) {
|
|
|
|
/**
|
|
* Properties of a MsgCreateValidatorResponse.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IMsgCreateValidatorResponse
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgCreateValidatorResponse.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a MsgCreateValidatorResponse.
|
|
* @implements IMsgCreateValidatorResponse
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IMsgCreateValidatorResponse=} [properties] Properties to set
|
|
*/
|
|
function MsgCreateValidatorResponse(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new MsgCreateValidatorResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgCreateValidatorResponse=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.MsgCreateValidatorResponse} MsgCreateValidatorResponse instance
|
|
*/
|
|
MsgCreateValidatorResponse.create = function create(properties) {
|
|
return new MsgCreateValidatorResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgCreateValidatorResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgCreateValidatorResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgCreateValidatorResponse} message MsgCreateValidatorResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgCreateValidatorResponse.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgCreateValidatorResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgCreateValidatorResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgCreateValidatorResponse} message MsgCreateValidatorResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgCreateValidatorResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgCreateValidatorResponse message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.MsgCreateValidatorResponse} MsgCreateValidatorResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgCreateValidatorResponse.decode = 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.staking.v1beta1.MsgCreateValidatorResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgCreateValidatorResponse message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.MsgCreateValidatorResponse} MsgCreateValidatorResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgCreateValidatorResponse.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgCreateValidatorResponse message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgCreateValidatorResponse.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgCreateValidatorResponse message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.MsgCreateValidatorResponse} MsgCreateValidatorResponse
|
|
*/
|
|
MsgCreateValidatorResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.MsgCreateValidatorResponse)
|
|
return object;
|
|
return new $root.cosmos.staking.v1beta1.MsgCreateValidatorResponse();
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgCreateValidatorResponse message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.MsgCreateValidatorResponse} message MsgCreateValidatorResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgCreateValidatorResponse.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgCreateValidatorResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.MsgCreateValidatorResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgCreateValidatorResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgCreateValidatorResponse;
|
|
})(v1beta1.MsgCreateValidatorResponse || {});
|
|
|
|
v1beta1.MsgEditValidator = (function(MsgEditValidator) {
|
|
|
|
/**
|
|
* Properties of a MsgEditValidator.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IMsgEditValidator
|
|
* @property {cosmos.staking.v1beta1.IDescription|null} [description] MsgEditValidator description
|
|
* @property {string|null} [validatorAddress] MsgEditValidator validatorAddress
|
|
* @property {string|null} [commissionRate] MsgEditValidator commissionRate
|
|
* @property {string|null} [minSelfDelegation] MsgEditValidator minSelfDelegation
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgEditValidator.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a MsgEditValidator.
|
|
* @implements IMsgEditValidator
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IMsgEditValidator=} [properties] Properties to set
|
|
*/
|
|
function MsgEditValidator(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* MsgEditValidator description.
|
|
* @member {cosmos.staking.v1beta1.IDescription|null|undefined} description
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidator
|
|
* @instance
|
|
*/
|
|
MsgEditValidator.prototype.description = null;
|
|
|
|
/**
|
|
* MsgEditValidator validatorAddress.
|
|
* @member {string} validatorAddress
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidator
|
|
* @instance
|
|
*/
|
|
MsgEditValidator.prototype.validatorAddress = "";
|
|
|
|
/**
|
|
* MsgEditValidator commissionRate.
|
|
* @member {string} commissionRate
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidator
|
|
* @instance
|
|
*/
|
|
MsgEditValidator.prototype.commissionRate = "";
|
|
|
|
/**
|
|
* MsgEditValidator minSelfDelegation.
|
|
* @member {string} minSelfDelegation
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidator
|
|
* @instance
|
|
*/
|
|
MsgEditValidator.prototype.minSelfDelegation = "";
|
|
|
|
/**
|
|
* Creates a new MsgEditValidator instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidator
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgEditValidator=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.MsgEditValidator} MsgEditValidator instance
|
|
*/
|
|
MsgEditValidator.create = function create(properties) {
|
|
return new MsgEditValidator(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgEditValidator message. Does not implicitly {@link cosmos.staking.v1beta1.MsgEditValidator.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidator
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgEditValidator} message MsgEditValidator message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgEditValidator.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.description != null && Object.hasOwnProperty.call(message, "description"))
|
|
$root.cosmos.staking.v1beta1.Description.encode(message.description, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress);
|
|
if (message.commissionRate != null && Object.hasOwnProperty.call(message, "commissionRate"))
|
|
writer.uint32(/* id 3, wireType 2 =*/26).string(message.commissionRate);
|
|
if (message.minSelfDelegation != null && Object.hasOwnProperty.call(message, "minSelfDelegation"))
|
|
writer.uint32(/* id 4, wireType 2 =*/34).string(message.minSelfDelegation);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgEditValidator message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgEditValidator.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidator
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgEditValidator} message MsgEditValidator message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgEditValidator.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgEditValidator message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidator
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.MsgEditValidator} MsgEditValidator
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgEditValidator.decode = 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.staking.v1beta1.MsgEditValidator();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.description = $root.cosmos.staking.v1beta1.Description.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
message.validatorAddress = reader.string();
|
|
break;
|
|
case 3:
|
|
message.commissionRate = reader.string();
|
|
break;
|
|
case 4:
|
|
message.minSelfDelegation = reader.string();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgEditValidator message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidator
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.MsgEditValidator} MsgEditValidator
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgEditValidator.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgEditValidator message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidator
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgEditValidator.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.description != null && message.hasOwnProperty("description")) {
|
|
var error = $root.cosmos.staking.v1beta1.Description.verify(message.description);
|
|
if (error)
|
|
return "description." + error;
|
|
}
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
if (!$util.isString(message.validatorAddress))
|
|
return "validatorAddress: string expected";
|
|
if (message.commissionRate != null && message.hasOwnProperty("commissionRate"))
|
|
if (!$util.isString(message.commissionRate))
|
|
return "commissionRate: string expected";
|
|
if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation"))
|
|
if (!$util.isString(message.minSelfDelegation))
|
|
return "minSelfDelegation: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgEditValidator message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidator
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.MsgEditValidator} MsgEditValidator
|
|
*/
|
|
MsgEditValidator.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.MsgEditValidator)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.MsgEditValidator();
|
|
if (object.description != null) {
|
|
if (typeof object.description !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.MsgEditValidator.description: object expected");
|
|
message.description = $root.cosmos.staking.v1beta1.Description.fromObject(object.description);
|
|
}
|
|
if (object.validatorAddress != null)
|
|
message.validatorAddress = String(object.validatorAddress);
|
|
if (object.commissionRate != null)
|
|
message.commissionRate = String(object.commissionRate);
|
|
if (object.minSelfDelegation != null)
|
|
message.minSelfDelegation = String(object.minSelfDelegation);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgEditValidator message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidator
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.MsgEditValidator} message MsgEditValidator
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgEditValidator.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.description = null;
|
|
object.validatorAddress = "";
|
|
object.commissionRate = "";
|
|
object.minSelfDelegation = "";
|
|
}
|
|
if (message.description != null && message.hasOwnProperty("description"))
|
|
object.description = $root.cosmos.staking.v1beta1.Description.toObject(message.description, options);
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
object.validatorAddress = message.validatorAddress;
|
|
if (message.commissionRate != null && message.hasOwnProperty("commissionRate"))
|
|
object.commissionRate = message.commissionRate;
|
|
if (message.minSelfDelegation != null && message.hasOwnProperty("minSelfDelegation"))
|
|
object.minSelfDelegation = message.minSelfDelegation;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgEditValidator to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidator
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgEditValidator.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgEditValidator;
|
|
})(v1beta1.MsgEditValidator || {});
|
|
|
|
v1beta1.MsgEditValidatorResponse = (function(MsgEditValidatorResponse) {
|
|
|
|
/**
|
|
* Properties of a MsgEditValidatorResponse.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IMsgEditValidatorResponse
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgEditValidatorResponse.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a MsgEditValidatorResponse.
|
|
* @implements IMsgEditValidatorResponse
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IMsgEditValidatorResponse=} [properties] Properties to set
|
|
*/
|
|
function MsgEditValidatorResponse(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new MsgEditValidatorResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgEditValidatorResponse=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.MsgEditValidatorResponse} MsgEditValidatorResponse instance
|
|
*/
|
|
MsgEditValidatorResponse.create = function create(properties) {
|
|
return new MsgEditValidatorResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgEditValidatorResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgEditValidatorResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgEditValidatorResponse} message MsgEditValidatorResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgEditValidatorResponse.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgEditValidatorResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgEditValidatorResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgEditValidatorResponse} message MsgEditValidatorResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgEditValidatorResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgEditValidatorResponse message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.MsgEditValidatorResponse} MsgEditValidatorResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgEditValidatorResponse.decode = 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.staking.v1beta1.MsgEditValidatorResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgEditValidatorResponse message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.MsgEditValidatorResponse} MsgEditValidatorResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgEditValidatorResponse.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgEditValidatorResponse message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgEditValidatorResponse.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgEditValidatorResponse message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.MsgEditValidatorResponse} MsgEditValidatorResponse
|
|
*/
|
|
MsgEditValidatorResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.MsgEditValidatorResponse)
|
|
return object;
|
|
return new $root.cosmos.staking.v1beta1.MsgEditValidatorResponse();
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgEditValidatorResponse message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.MsgEditValidatorResponse} message MsgEditValidatorResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgEditValidatorResponse.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgEditValidatorResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.MsgEditValidatorResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgEditValidatorResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgEditValidatorResponse;
|
|
})(v1beta1.MsgEditValidatorResponse || {});
|
|
|
|
v1beta1.MsgDelegate = (function(MsgDelegate) {
|
|
|
|
/**
|
|
* Properties of a MsgDelegate.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IMsgDelegate
|
|
* @property {string|null} [delegatorAddress] MsgDelegate delegatorAddress
|
|
* @property {string|null} [validatorAddress] MsgDelegate validatorAddress
|
|
* @property {cosmos.base.v1beta1.ICoin|null} [amount] MsgDelegate amount
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgDelegate.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a MsgDelegate.
|
|
* @implements IMsgDelegate
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IMsgDelegate=} [properties] Properties to set
|
|
*/
|
|
function MsgDelegate(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* MsgDelegate delegatorAddress.
|
|
* @member {string} delegatorAddress
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegate
|
|
* @instance
|
|
*/
|
|
MsgDelegate.prototype.delegatorAddress = "";
|
|
|
|
/**
|
|
* MsgDelegate validatorAddress.
|
|
* @member {string} validatorAddress
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegate
|
|
* @instance
|
|
*/
|
|
MsgDelegate.prototype.validatorAddress = "";
|
|
|
|
/**
|
|
* MsgDelegate amount.
|
|
* @member {cosmos.base.v1beta1.ICoin|null|undefined} amount
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegate
|
|
* @instance
|
|
*/
|
|
MsgDelegate.prototype.amount = null;
|
|
|
|
/**
|
|
* Creates a new MsgDelegate instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegate
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgDelegate=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.MsgDelegate} MsgDelegate instance
|
|
*/
|
|
MsgDelegate.create = function create(properties) {
|
|
return new MsgDelegate(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgDelegate message. Does not implicitly {@link cosmos.staking.v1beta1.MsgDelegate.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegate
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgDelegate} message MsgDelegate message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgDelegate.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress);
|
|
if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress);
|
|
if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
|
|
$root.cosmos.base.v1beta1.Coin.encode(message.amount, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgDelegate message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgDelegate.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegate
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgDelegate} message MsgDelegate message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgDelegate.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgDelegate message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegate
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.MsgDelegate} MsgDelegate
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgDelegate.decode = 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.staking.v1beta1.MsgDelegate();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.delegatorAddress = reader.string();
|
|
break;
|
|
case 2:
|
|
message.validatorAddress = reader.string();
|
|
break;
|
|
case 3:
|
|
message.amount = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32());
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgDelegate message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegate
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.MsgDelegate} MsgDelegate
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgDelegate.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgDelegate message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegate
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgDelegate.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
if (!$util.isString(message.delegatorAddress))
|
|
return "delegatorAddress: string expected";
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
if (!$util.isString(message.validatorAddress))
|
|
return "validatorAddress: 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 MsgDelegate message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegate
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.MsgDelegate} MsgDelegate
|
|
*/
|
|
MsgDelegate.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.MsgDelegate)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.MsgDelegate();
|
|
if (object.delegatorAddress != null)
|
|
message.delegatorAddress = String(object.delegatorAddress);
|
|
if (object.validatorAddress != null)
|
|
message.validatorAddress = String(object.validatorAddress);
|
|
if (object.amount != null) {
|
|
if (typeof object.amount !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.MsgDelegate.amount: object expected");
|
|
message.amount = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgDelegate message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegate
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.MsgDelegate} message MsgDelegate
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgDelegate.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.delegatorAddress = "";
|
|
object.validatorAddress = "";
|
|
object.amount = null;
|
|
}
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
object.delegatorAddress = message.delegatorAddress;
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
object.validatorAddress = message.validatorAddress;
|
|
if (message.amount != null && message.hasOwnProperty("amount"))
|
|
object.amount = $root.cosmos.base.v1beta1.Coin.toObject(message.amount, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgDelegate to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegate
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgDelegate.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgDelegate;
|
|
})(v1beta1.MsgDelegate || {});
|
|
|
|
v1beta1.MsgDelegateResponse = (function(MsgDelegateResponse) {
|
|
|
|
/**
|
|
* Properties of a MsgDelegateResponse.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IMsgDelegateResponse
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgDelegateResponse.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a MsgDelegateResponse.
|
|
* @implements IMsgDelegateResponse
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IMsgDelegateResponse=} [properties] Properties to set
|
|
*/
|
|
function MsgDelegateResponse(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new MsgDelegateResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegateResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgDelegateResponse=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.MsgDelegateResponse} MsgDelegateResponse instance
|
|
*/
|
|
MsgDelegateResponse.create = function create(properties) {
|
|
return new MsgDelegateResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgDelegateResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgDelegateResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegateResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgDelegateResponse} message MsgDelegateResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgDelegateResponse.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgDelegateResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgDelegateResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegateResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgDelegateResponse} message MsgDelegateResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgDelegateResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgDelegateResponse message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegateResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.MsgDelegateResponse} MsgDelegateResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgDelegateResponse.decode = 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.staking.v1beta1.MsgDelegateResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgDelegateResponse message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegateResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.MsgDelegateResponse} MsgDelegateResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgDelegateResponse.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgDelegateResponse message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegateResponse
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgDelegateResponse.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgDelegateResponse message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegateResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.MsgDelegateResponse} MsgDelegateResponse
|
|
*/
|
|
MsgDelegateResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.MsgDelegateResponse)
|
|
return object;
|
|
return new $root.cosmos.staking.v1beta1.MsgDelegateResponse();
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgDelegateResponse message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegateResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.MsgDelegateResponse} message MsgDelegateResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgDelegateResponse.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgDelegateResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.MsgDelegateResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgDelegateResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgDelegateResponse;
|
|
})(v1beta1.MsgDelegateResponse || {});
|
|
|
|
v1beta1.MsgBeginRedelegate = (function(MsgBeginRedelegate) {
|
|
|
|
/**
|
|
* Properties of a MsgBeginRedelegate.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IMsgBeginRedelegate
|
|
* @property {string|null} [delegatorAddress] MsgBeginRedelegate delegatorAddress
|
|
* @property {string|null} [validatorSrcAddress] MsgBeginRedelegate validatorSrcAddress
|
|
* @property {string|null} [validatorDstAddress] MsgBeginRedelegate validatorDstAddress
|
|
* @property {cosmos.base.v1beta1.ICoin|null} [amount] MsgBeginRedelegate amount
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgBeginRedelegate.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a MsgBeginRedelegate.
|
|
* @implements IMsgBeginRedelegate
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IMsgBeginRedelegate=} [properties] Properties to set
|
|
*/
|
|
function MsgBeginRedelegate(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* MsgBeginRedelegate delegatorAddress.
|
|
* @member {string} delegatorAddress
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegate
|
|
* @instance
|
|
*/
|
|
MsgBeginRedelegate.prototype.delegatorAddress = "";
|
|
|
|
/**
|
|
* MsgBeginRedelegate validatorSrcAddress.
|
|
* @member {string} validatorSrcAddress
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegate
|
|
* @instance
|
|
*/
|
|
MsgBeginRedelegate.prototype.validatorSrcAddress = "";
|
|
|
|
/**
|
|
* MsgBeginRedelegate validatorDstAddress.
|
|
* @member {string} validatorDstAddress
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegate
|
|
* @instance
|
|
*/
|
|
MsgBeginRedelegate.prototype.validatorDstAddress = "";
|
|
|
|
/**
|
|
* MsgBeginRedelegate amount.
|
|
* @member {cosmos.base.v1beta1.ICoin|null|undefined} amount
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegate
|
|
* @instance
|
|
*/
|
|
MsgBeginRedelegate.prototype.amount = null;
|
|
|
|
/**
|
|
* Creates a new MsgBeginRedelegate instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegate
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgBeginRedelegate=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.MsgBeginRedelegate} MsgBeginRedelegate instance
|
|
*/
|
|
MsgBeginRedelegate.create = function create(properties) {
|
|
return new MsgBeginRedelegate(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgBeginRedelegate message. Does not implicitly {@link cosmos.staking.v1beta1.MsgBeginRedelegate.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegate
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgBeginRedelegate} message MsgBeginRedelegate message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgBeginRedelegate.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress);
|
|
if (message.validatorSrcAddress != null && Object.hasOwnProperty.call(message, "validatorSrcAddress"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorSrcAddress);
|
|
if (message.validatorDstAddress != null && Object.hasOwnProperty.call(message, "validatorDstAddress"))
|
|
writer.uint32(/* id 3, wireType 2 =*/26).string(message.validatorDstAddress);
|
|
if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
|
|
$root.cosmos.base.v1beta1.Coin.encode(message.amount, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgBeginRedelegate message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgBeginRedelegate.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegate
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgBeginRedelegate} message MsgBeginRedelegate message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgBeginRedelegate.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgBeginRedelegate message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegate
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.MsgBeginRedelegate} MsgBeginRedelegate
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgBeginRedelegate.decode = 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.staking.v1beta1.MsgBeginRedelegate();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.delegatorAddress = reader.string();
|
|
break;
|
|
case 2:
|
|
message.validatorSrcAddress = reader.string();
|
|
break;
|
|
case 3:
|
|
message.validatorDstAddress = reader.string();
|
|
break;
|
|
case 4:
|
|
message.amount = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32());
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgBeginRedelegate message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegate
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.MsgBeginRedelegate} MsgBeginRedelegate
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgBeginRedelegate.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgBeginRedelegate message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegate
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgBeginRedelegate.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
if (!$util.isString(message.delegatorAddress))
|
|
return "delegatorAddress: string expected";
|
|
if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress"))
|
|
if (!$util.isString(message.validatorSrcAddress))
|
|
return "validatorSrcAddress: string expected";
|
|
if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress"))
|
|
if (!$util.isString(message.validatorDstAddress))
|
|
return "validatorDstAddress: 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 MsgBeginRedelegate message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegate
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.MsgBeginRedelegate} MsgBeginRedelegate
|
|
*/
|
|
MsgBeginRedelegate.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.MsgBeginRedelegate)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.MsgBeginRedelegate();
|
|
if (object.delegatorAddress != null)
|
|
message.delegatorAddress = String(object.delegatorAddress);
|
|
if (object.validatorSrcAddress != null)
|
|
message.validatorSrcAddress = String(object.validatorSrcAddress);
|
|
if (object.validatorDstAddress != null)
|
|
message.validatorDstAddress = String(object.validatorDstAddress);
|
|
if (object.amount != null) {
|
|
if (typeof object.amount !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.MsgBeginRedelegate.amount: object expected");
|
|
message.amount = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgBeginRedelegate message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegate
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.MsgBeginRedelegate} message MsgBeginRedelegate
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgBeginRedelegate.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.delegatorAddress = "";
|
|
object.validatorSrcAddress = "";
|
|
object.validatorDstAddress = "";
|
|
object.amount = null;
|
|
}
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
object.delegatorAddress = message.delegatorAddress;
|
|
if (message.validatorSrcAddress != null && message.hasOwnProperty("validatorSrcAddress"))
|
|
object.validatorSrcAddress = message.validatorSrcAddress;
|
|
if (message.validatorDstAddress != null && message.hasOwnProperty("validatorDstAddress"))
|
|
object.validatorDstAddress = message.validatorDstAddress;
|
|
if (message.amount != null && message.hasOwnProperty("amount"))
|
|
object.amount = $root.cosmos.base.v1beta1.Coin.toObject(message.amount, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgBeginRedelegate to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegate
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgBeginRedelegate.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgBeginRedelegate;
|
|
})(v1beta1.MsgBeginRedelegate || {});
|
|
|
|
v1beta1.MsgBeginRedelegateResponse = (function(MsgBeginRedelegateResponse) {
|
|
|
|
/**
|
|
* Properties of a MsgBeginRedelegateResponse.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IMsgBeginRedelegateResponse
|
|
* @property {google.protobuf.ITimestamp|null} [completionTime] MsgBeginRedelegateResponse completionTime
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgBeginRedelegateResponse.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a MsgBeginRedelegateResponse.
|
|
* @implements IMsgBeginRedelegateResponse
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IMsgBeginRedelegateResponse=} [properties] Properties to set
|
|
*/
|
|
function MsgBeginRedelegateResponse(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* MsgBeginRedelegateResponse completionTime.
|
|
* @member {google.protobuf.ITimestamp|null|undefined} completionTime
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse
|
|
* @instance
|
|
*/
|
|
MsgBeginRedelegateResponse.prototype.completionTime = null;
|
|
|
|
/**
|
|
* Creates a new MsgBeginRedelegateResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgBeginRedelegateResponse=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.MsgBeginRedelegateResponse} MsgBeginRedelegateResponse instance
|
|
*/
|
|
MsgBeginRedelegateResponse.create = function create(properties) {
|
|
return new MsgBeginRedelegateResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgBeginRedelegateResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgBeginRedelegateResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgBeginRedelegateResponse} message MsgBeginRedelegateResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgBeginRedelegateResponse.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime"))
|
|
$root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgBeginRedelegateResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgBeginRedelegateResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgBeginRedelegateResponse} message MsgBeginRedelegateResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgBeginRedelegateResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgBeginRedelegateResponse message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.MsgBeginRedelegateResponse} MsgBeginRedelegateResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgBeginRedelegateResponse.decode = 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.staking.v1beta1.MsgBeginRedelegateResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgBeginRedelegateResponse message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.MsgBeginRedelegateResponse} MsgBeginRedelegateResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgBeginRedelegateResponse.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgBeginRedelegateResponse message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgBeginRedelegateResponse.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.completionTime != null && message.hasOwnProperty("completionTime")) {
|
|
var error = $root.google.protobuf.Timestamp.verify(message.completionTime);
|
|
if (error)
|
|
return "completionTime." + error;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgBeginRedelegateResponse message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.MsgBeginRedelegateResponse} MsgBeginRedelegateResponse
|
|
*/
|
|
MsgBeginRedelegateResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.MsgBeginRedelegateResponse)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.MsgBeginRedelegateResponse();
|
|
if (object.completionTime != null) {
|
|
if (typeof object.completionTime !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.MsgBeginRedelegateResponse.completionTime: object expected");
|
|
message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgBeginRedelegateResponse message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.MsgBeginRedelegateResponse} message MsgBeginRedelegateResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgBeginRedelegateResponse.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults)
|
|
object.completionTime = null;
|
|
if (message.completionTime != null && message.hasOwnProperty("completionTime"))
|
|
object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgBeginRedelegateResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.MsgBeginRedelegateResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgBeginRedelegateResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgBeginRedelegateResponse;
|
|
})(v1beta1.MsgBeginRedelegateResponse || {});
|
|
|
|
v1beta1.MsgUndelegate = (function(MsgUndelegate) {
|
|
|
|
/**
|
|
* Properties of a MsgUndelegate.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IMsgUndelegate
|
|
* @property {string|null} [delegatorAddress] MsgUndelegate delegatorAddress
|
|
* @property {string|null} [validatorAddress] MsgUndelegate validatorAddress
|
|
* @property {cosmos.base.v1beta1.ICoin|null} [amount] MsgUndelegate amount
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgUndelegate.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a MsgUndelegate.
|
|
* @implements IMsgUndelegate
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IMsgUndelegate=} [properties] Properties to set
|
|
*/
|
|
function MsgUndelegate(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* MsgUndelegate delegatorAddress.
|
|
* @member {string} delegatorAddress
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegate
|
|
* @instance
|
|
*/
|
|
MsgUndelegate.prototype.delegatorAddress = "";
|
|
|
|
/**
|
|
* MsgUndelegate validatorAddress.
|
|
* @member {string} validatorAddress
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegate
|
|
* @instance
|
|
*/
|
|
MsgUndelegate.prototype.validatorAddress = "";
|
|
|
|
/**
|
|
* MsgUndelegate amount.
|
|
* @member {cosmos.base.v1beta1.ICoin|null|undefined} amount
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegate
|
|
* @instance
|
|
*/
|
|
MsgUndelegate.prototype.amount = null;
|
|
|
|
/**
|
|
* Creates a new MsgUndelegate instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegate
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgUndelegate=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.MsgUndelegate} MsgUndelegate instance
|
|
*/
|
|
MsgUndelegate.create = function create(properties) {
|
|
return new MsgUndelegate(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgUndelegate message. Does not implicitly {@link cosmos.staking.v1beta1.MsgUndelegate.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegate
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgUndelegate} message MsgUndelegate message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgUndelegate.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress);
|
|
if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress);
|
|
if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
|
|
$root.cosmos.base.v1beta1.Coin.encode(message.amount, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgUndelegate message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgUndelegate.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegate
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgUndelegate} message MsgUndelegate message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgUndelegate.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgUndelegate message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegate
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.MsgUndelegate} MsgUndelegate
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgUndelegate.decode = 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.staking.v1beta1.MsgUndelegate();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.delegatorAddress = reader.string();
|
|
break;
|
|
case 2:
|
|
message.validatorAddress = reader.string();
|
|
break;
|
|
case 3:
|
|
message.amount = $root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32());
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgUndelegate message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegate
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.MsgUndelegate} MsgUndelegate
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgUndelegate.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgUndelegate message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegate
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgUndelegate.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
if (!$util.isString(message.delegatorAddress))
|
|
return "delegatorAddress: string expected";
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
if (!$util.isString(message.validatorAddress))
|
|
return "validatorAddress: 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 MsgUndelegate message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegate
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.MsgUndelegate} MsgUndelegate
|
|
*/
|
|
MsgUndelegate.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.MsgUndelegate)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.MsgUndelegate();
|
|
if (object.delegatorAddress != null)
|
|
message.delegatorAddress = String(object.delegatorAddress);
|
|
if (object.validatorAddress != null)
|
|
message.validatorAddress = String(object.validatorAddress);
|
|
if (object.amount != null) {
|
|
if (typeof object.amount !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.MsgUndelegate.amount: object expected");
|
|
message.amount = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgUndelegate message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegate
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.MsgUndelegate} message MsgUndelegate
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgUndelegate.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.delegatorAddress = "";
|
|
object.validatorAddress = "";
|
|
object.amount = null;
|
|
}
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
object.delegatorAddress = message.delegatorAddress;
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
object.validatorAddress = message.validatorAddress;
|
|
if (message.amount != null && message.hasOwnProperty("amount"))
|
|
object.amount = $root.cosmos.base.v1beta1.Coin.toObject(message.amount, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgUndelegate to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegate
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgUndelegate.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgUndelegate;
|
|
})(v1beta1.MsgUndelegate || {});
|
|
|
|
v1beta1.MsgUndelegateResponse = (function(MsgUndelegateResponse) {
|
|
|
|
/**
|
|
* Properties of a MsgUndelegateResponse.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @interface IMsgUndelegateResponse
|
|
* @property {google.protobuf.ITimestamp|null} [completionTime] MsgUndelegateResponse completionTime
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgUndelegateResponse.
|
|
* @memberof cosmos.staking.v1beta1
|
|
* @classdesc Represents a MsgUndelegateResponse.
|
|
* @implements IMsgUndelegateResponse
|
|
* @constructor
|
|
* @param {cosmos.staking.v1beta1.IMsgUndelegateResponse=} [properties] Properties to set
|
|
*/
|
|
function MsgUndelegateResponse(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* MsgUndelegateResponse completionTime.
|
|
* @member {google.protobuf.ITimestamp|null|undefined} completionTime
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegateResponse
|
|
* @instance
|
|
*/
|
|
MsgUndelegateResponse.prototype.completionTime = null;
|
|
|
|
/**
|
|
* Creates a new MsgUndelegateResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegateResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgUndelegateResponse=} [properties] Properties to set
|
|
* @returns {cosmos.staking.v1beta1.MsgUndelegateResponse} MsgUndelegateResponse instance
|
|
*/
|
|
MsgUndelegateResponse.create = function create(properties) {
|
|
return new MsgUndelegateResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgUndelegateResponse message. Does not implicitly {@link cosmos.staking.v1beta1.MsgUndelegateResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegateResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgUndelegateResponse} message MsgUndelegateResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgUndelegateResponse.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.completionTime != null && Object.hasOwnProperty.call(message, "completionTime"))
|
|
$root.google.protobuf.Timestamp.encode(message.completionTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgUndelegateResponse message, length delimited. Does not implicitly {@link cosmos.staking.v1beta1.MsgUndelegateResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegateResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.IMsgUndelegateResponse} message MsgUndelegateResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgUndelegateResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgUndelegateResponse message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegateResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.staking.v1beta1.MsgUndelegateResponse} MsgUndelegateResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgUndelegateResponse.decode = 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.staking.v1beta1.MsgUndelegateResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.completionTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgUndelegateResponse message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegateResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.staking.v1beta1.MsgUndelegateResponse} MsgUndelegateResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgUndelegateResponse.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgUndelegateResponse message.
|
|
* @function verify
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegateResponse
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgUndelegateResponse.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.completionTime != null && message.hasOwnProperty("completionTime")) {
|
|
var error = $root.google.protobuf.Timestamp.verify(message.completionTime);
|
|
if (error)
|
|
return "completionTime." + error;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgUndelegateResponse message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegateResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.staking.v1beta1.MsgUndelegateResponse} MsgUndelegateResponse
|
|
*/
|
|
MsgUndelegateResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.staking.v1beta1.MsgUndelegateResponse)
|
|
return object;
|
|
var message = new $root.cosmos.staking.v1beta1.MsgUndelegateResponse();
|
|
if (object.completionTime != null) {
|
|
if (typeof object.completionTime !== "object")
|
|
throw TypeError(".cosmos.staking.v1beta1.MsgUndelegateResponse.completionTime: object expected");
|
|
message.completionTime = $root.google.protobuf.Timestamp.fromObject(object.completionTime);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgUndelegateResponse message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegateResponse
|
|
* @static
|
|
* @param {cosmos.staking.v1beta1.MsgUndelegateResponse} message MsgUndelegateResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgUndelegateResponse.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults)
|
|
object.completionTime = null;
|
|
if (message.completionTime != null && message.hasOwnProperty("completionTime"))
|
|
object.completionTime = $root.google.protobuf.Timestamp.toObject(message.completionTime, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgUndelegateResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.staking.v1beta1.MsgUndelegateResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgUndelegateResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgUndelegateResponse;
|
|
})(v1beta1.MsgUndelegateResponse || {});
|
|
|
|
return v1beta1;
|
|
})(staking.v1beta1 || {});
|
|
|
|
return staking;
|
|
})(cosmos.staking || {});
|
|
|
|
/**
|
|
* Namespace crypto.
|
|
* @memberof cosmos
|
|
* @namespace
|
|
*/
|
|
|
|
cosmos.crypto = (function(crypto) {
|
|
|
|
/**
|
|
* Namespace multisig.
|
|
* @memberof cosmos.crypto
|
|
* @namespace
|
|
*/
|
|
|
|
crypto.multisig = (function(multisig) {
|
|
|
|
/**
|
|
* Namespace v1beta1.
|
|
* @memberof cosmos.crypto.multisig
|
|
* @namespace
|
|
*/
|
|
|
|
multisig.v1beta1 = (function(v1beta1) {
|
|
|
|
v1beta1.MultiSignature = (function(MultiSignature) {
|
|
|
|
/**
|
|
* Properties of a MultiSignature.
|
|
* @memberof cosmos.crypto.multisig.v1beta1
|
|
* @interface IMultiSignature
|
|
* @property {Array.<Uint8Array>|null} [signatures] MultiSignature signatures
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MultiSignature.
|
|
* @memberof cosmos.crypto.multisig.v1beta1
|
|
* @classdesc Represents a MultiSignature.
|
|
* @implements IMultiSignature
|
|
* @constructor
|
|
* @param {cosmos.crypto.multisig.v1beta1.IMultiSignature=} [properties] Properties to set
|
|
*/
|
|
function MultiSignature(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]];
|
|
}
|
|
|
|
/**
|
|
* MultiSignature signatures.
|
|
* @member {Array.<Uint8Array>} signatures
|
|
* @memberof cosmos.crypto.multisig.v1beta1.MultiSignature
|
|
* @instance
|
|
*/
|
|
MultiSignature.prototype.signatures = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new MultiSignature instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.crypto.multisig.v1beta1.MultiSignature
|
|
* @static
|
|
* @param {cosmos.crypto.multisig.v1beta1.IMultiSignature=} [properties] Properties to set
|
|
* @returns {cosmos.crypto.multisig.v1beta1.MultiSignature} MultiSignature instance
|
|
*/
|
|
MultiSignature.create = function create(properties) {
|
|
return new MultiSignature(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MultiSignature message. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.MultiSignature.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.crypto.multisig.v1beta1.MultiSignature
|
|
* @static
|
|
* @param {cosmos.crypto.multisig.v1beta1.IMultiSignature} message MultiSignature message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MultiSignature.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.signatures != null && message.signatures.length)
|
|
for (var i = 0; i < message.signatures.length; ++i)
|
|
writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signatures[i]);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MultiSignature message, length delimited. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.MultiSignature.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.crypto.multisig.v1beta1.MultiSignature
|
|
* @static
|
|
* @param {cosmos.crypto.multisig.v1beta1.IMultiSignature} message MultiSignature message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MultiSignature.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MultiSignature message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.crypto.multisig.v1beta1.MultiSignature
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.crypto.multisig.v1beta1.MultiSignature} MultiSignature
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MultiSignature.decode = 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.crypto.multisig.v1beta1.MultiSignature();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
if (!(message.signatures && message.signatures.length))
|
|
message.signatures = [];
|
|
message.signatures.push(reader.bytes());
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MultiSignature message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.crypto.multisig.v1beta1.MultiSignature
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.crypto.multisig.v1beta1.MultiSignature} MultiSignature
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MultiSignature.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MultiSignature message.
|
|
* @function verify
|
|
* @memberof cosmos.crypto.multisig.v1beta1.MultiSignature
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MultiSignature.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
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)
|
|
if (!(message.signatures[i] && typeof message.signatures[i].length === "number" || $util.isString(message.signatures[i])))
|
|
return "signatures: buffer[] expected";
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MultiSignature message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.crypto.multisig.v1beta1.MultiSignature
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.crypto.multisig.v1beta1.MultiSignature} MultiSignature
|
|
*/
|
|
MultiSignature.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.crypto.multisig.v1beta1.MultiSignature)
|
|
return object;
|
|
var message = new $root.cosmos.crypto.multisig.v1beta1.MultiSignature();
|
|
if (object.signatures) {
|
|
if (!Array.isArray(object.signatures))
|
|
throw TypeError(".cosmos.crypto.multisig.v1beta1.MultiSignature.signatures: array expected");
|
|
message.signatures = [];
|
|
for (var i = 0; i < object.signatures.length; ++i)
|
|
if (typeof object.signatures[i] === "string")
|
|
$util.base64.decode(object.signatures[i], message.signatures[i] = $util.newBuffer($util.base64.length(object.signatures[i])), 0);
|
|
else if (object.signatures[i].length)
|
|
message.signatures[i] = object.signatures[i];
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MultiSignature message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.crypto.multisig.v1beta1.MultiSignature
|
|
* @static
|
|
* @param {cosmos.crypto.multisig.v1beta1.MultiSignature} message MultiSignature
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MultiSignature.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.signatures = [];
|
|
if (message.signatures && message.signatures.length) {
|
|
object.signatures = [];
|
|
for (var j = 0; j < message.signatures.length; ++j)
|
|
object.signatures[j] = options.bytes === String ? $util.base64.encode(message.signatures[j], 0, message.signatures[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.signatures[j]) : message.signatures[j];
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MultiSignature to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.crypto.multisig.v1beta1.MultiSignature
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MultiSignature.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MultiSignature;
|
|
})(v1beta1.MultiSignature || {});
|
|
|
|
v1beta1.CompactBitArray = (function(CompactBitArray) {
|
|
|
|
/**
|
|
* Properties of a CompactBitArray.
|
|
* @memberof cosmos.crypto.multisig.v1beta1
|
|
* @interface ICompactBitArray
|
|
* @property {number|null} [extraBitsStored] CompactBitArray extraBitsStored
|
|
* @property {Uint8Array|null} [elems] CompactBitArray elems
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new CompactBitArray.
|
|
* @memberof cosmos.crypto.multisig.v1beta1
|
|
* @classdesc Represents a CompactBitArray.
|
|
* @implements ICompactBitArray
|
|
* @constructor
|
|
* @param {cosmos.crypto.multisig.v1beta1.ICompactBitArray=} [properties] Properties to set
|
|
*/
|
|
function CompactBitArray(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* CompactBitArray extraBitsStored.
|
|
* @member {number} extraBitsStored
|
|
* @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray
|
|
* @instance
|
|
*/
|
|
CompactBitArray.prototype.extraBitsStored = 0;
|
|
|
|
/**
|
|
* CompactBitArray elems.
|
|
* @member {Uint8Array} elems
|
|
* @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray
|
|
* @instance
|
|
*/
|
|
CompactBitArray.prototype.elems = $util.newBuffer([]);
|
|
|
|
/**
|
|
* Creates a new CompactBitArray instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray
|
|
* @static
|
|
* @param {cosmos.crypto.multisig.v1beta1.ICompactBitArray=} [properties] Properties to set
|
|
* @returns {cosmos.crypto.multisig.v1beta1.CompactBitArray} CompactBitArray instance
|
|
*/
|
|
CompactBitArray.create = function create(properties) {
|
|
return new CompactBitArray(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified CompactBitArray message. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.CompactBitArray.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray
|
|
* @static
|
|
* @param {cosmos.crypto.multisig.v1beta1.ICompactBitArray} message CompactBitArray message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
CompactBitArray.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.extraBitsStored != null && Object.hasOwnProperty.call(message, "extraBitsStored"))
|
|
writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.extraBitsStored);
|
|
if (message.elems != null && Object.hasOwnProperty.call(message, "elems"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.elems);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified CompactBitArray message, length delimited. Does not implicitly {@link cosmos.crypto.multisig.v1beta1.CompactBitArray.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray
|
|
* @static
|
|
* @param {cosmos.crypto.multisig.v1beta1.ICompactBitArray} message CompactBitArray message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
CompactBitArray.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a CompactBitArray message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.crypto.multisig.v1beta1.CompactBitArray} CompactBitArray
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
CompactBitArray.decode = 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.crypto.multisig.v1beta1.CompactBitArray();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.extraBitsStored = reader.uint32();
|
|
break;
|
|
case 2:
|
|
message.elems = reader.bytes();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a CompactBitArray message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.crypto.multisig.v1beta1.CompactBitArray} CompactBitArray
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
CompactBitArray.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a CompactBitArray message.
|
|
* @function verify
|
|
* @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
CompactBitArray.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.extraBitsStored != null && message.hasOwnProperty("extraBitsStored"))
|
|
if (!$util.isInteger(message.extraBitsStored))
|
|
return "extraBitsStored: integer expected";
|
|
if (message.elems != null && message.hasOwnProperty("elems"))
|
|
if (!(message.elems && typeof message.elems.length === "number" || $util.isString(message.elems)))
|
|
return "elems: buffer expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a CompactBitArray message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.crypto.multisig.v1beta1.CompactBitArray} CompactBitArray
|
|
*/
|
|
CompactBitArray.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.crypto.multisig.v1beta1.CompactBitArray)
|
|
return object;
|
|
var message = new $root.cosmos.crypto.multisig.v1beta1.CompactBitArray();
|
|
if (object.extraBitsStored != null)
|
|
message.extraBitsStored = object.extraBitsStored >>> 0;
|
|
if (object.elems != null)
|
|
if (typeof object.elems === "string")
|
|
$util.base64.decode(object.elems, message.elems = $util.newBuffer($util.base64.length(object.elems)), 0);
|
|
else if (object.elems.length)
|
|
message.elems = object.elems;
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a CompactBitArray message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray
|
|
* @static
|
|
* @param {cosmos.crypto.multisig.v1beta1.CompactBitArray} message CompactBitArray
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
CompactBitArray.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.extraBitsStored = 0;
|
|
if (options.bytes === String)
|
|
object.elems = "";
|
|
else {
|
|
object.elems = [];
|
|
if (options.bytes !== Array)
|
|
object.elems = $util.newBuffer(object.elems);
|
|
}
|
|
}
|
|
if (message.extraBitsStored != null && message.hasOwnProperty("extraBitsStored"))
|
|
object.extraBitsStored = message.extraBitsStored;
|
|
if (message.elems != null && message.hasOwnProperty("elems"))
|
|
object.elems = options.bytes === String ? $util.base64.encode(message.elems, 0, message.elems.length) : options.bytes === Array ? Array.prototype.slice.call(message.elems) : message.elems;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this CompactBitArray to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.crypto.multisig.v1beta1.CompactBitArray
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
CompactBitArray.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return CompactBitArray;
|
|
})(v1beta1.CompactBitArray || {});
|
|
|
|
return v1beta1;
|
|
})(multisig.v1beta1 || {});
|
|
|
|
return multisig;
|
|
})(crypto.multisig || {});
|
|
|
|
return crypto;
|
|
})(cosmos.crypto || {});
|
|
|
|
/**
|
|
* Namespace tx.
|
|
* @memberof cosmos
|
|
* @namespace
|
|
*/
|
|
|
|
cosmos.tx = (function(tx) {
|
|
|
|
/**
|
|
* Namespace signing.
|
|
* @memberof cosmos.tx
|
|
* @namespace
|
|
*/
|
|
|
|
tx.signing = (function(signing) {
|
|
|
|
/**
|
|
* Namespace v1beta1.
|
|
* @memberof cosmos.tx.signing
|
|
* @namespace
|
|
*/
|
|
|
|
signing.v1beta1 = (function(v1beta1) {
|
|
|
|
/**
|
|
* SignMode enum.
|
|
* @name cosmos.tx.signing.v1beta1.SignMode
|
|
* @enum {string}
|
|
* @property {number} SIGN_MODE_UNSPECIFIED=0 SIGN_MODE_UNSPECIFIED value
|
|
* @property {number} SIGN_MODE_DIRECT=1 SIGN_MODE_DIRECT value
|
|
* @property {number} SIGN_MODE_TEXTUAL=2 SIGN_MODE_TEXTUAL value
|
|
* @property {number} SIGN_MODE_LEGACY_AMINO_JSON=127 SIGN_MODE_LEGACY_AMINO_JSON value
|
|
*/
|
|
v1beta1.SignMode = (function() {
|
|
var valuesById = {}, values = Object.create(valuesById);
|
|
values[valuesById[0] = "SIGN_MODE_UNSPECIFIED"] = 0;
|
|
values[valuesById[1] = "SIGN_MODE_DIRECT"] = 1;
|
|
values[valuesById[2] = "SIGN_MODE_TEXTUAL"] = 2;
|
|
values[valuesById[127] = "SIGN_MODE_LEGACY_AMINO_JSON"] = 127;
|
|
return values;
|
|
})();
|
|
|
|
v1beta1.SignatureDescriptors = (function(SignatureDescriptors) {
|
|
|
|
/**
|
|
* Properties of a SignatureDescriptors.
|
|
* @memberof cosmos.tx.signing.v1beta1
|
|
* @interface ISignatureDescriptors
|
|
* @property {Array.<cosmos.tx.signing.v1beta1.ISignatureDescriptor>|null} [signatures] SignatureDescriptors signatures
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new SignatureDescriptors.
|
|
* @memberof cosmos.tx.signing.v1beta1
|
|
* @classdesc Represents a SignatureDescriptors.
|
|
* @implements ISignatureDescriptors
|
|
* @constructor
|
|
* @param {cosmos.tx.signing.v1beta1.ISignatureDescriptors=} [properties] Properties to set
|
|
*/
|
|
function SignatureDescriptors(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]];
|
|
}
|
|
|
|
/**
|
|
* SignatureDescriptors signatures.
|
|
* @member {Array.<cosmos.tx.signing.v1beta1.ISignatureDescriptor>} signatures
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors
|
|
* @instance
|
|
*/
|
|
SignatureDescriptors.prototype.signatures = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new SignatureDescriptors instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors
|
|
* @static
|
|
* @param {cosmos.tx.signing.v1beta1.ISignatureDescriptors=} [properties] Properties to set
|
|
* @returns {cosmos.tx.signing.v1beta1.SignatureDescriptors} SignatureDescriptors instance
|
|
*/
|
|
SignatureDescriptors.create = function create(properties) {
|
|
return new SignatureDescriptors(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified SignatureDescriptors message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptors.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors
|
|
* @static
|
|
* @param {cosmos.tx.signing.v1beta1.ISignatureDescriptors} message SignatureDescriptors message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
SignatureDescriptors.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.signatures != null && message.signatures.length)
|
|
for (var i = 0; i < message.signatures.length; ++i)
|
|
$root.cosmos.tx.signing.v1beta1.SignatureDescriptor.encode(message.signatures[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified SignatureDescriptors message, length delimited. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptors.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors
|
|
* @static
|
|
* @param {cosmos.tx.signing.v1beta1.ISignatureDescriptors} message SignatureDescriptors message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
SignatureDescriptors.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a SignatureDescriptors message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.tx.signing.v1beta1.SignatureDescriptors} SignatureDescriptors
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
SignatureDescriptors.decode = 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.tx.signing.v1beta1.SignatureDescriptors();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
if (!(message.signatures && message.signatures.length))
|
|
message.signatures = [];
|
|
message.signatures.push($root.cosmos.tx.signing.v1beta1.SignatureDescriptor.decode(reader, reader.uint32()));
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a SignatureDescriptors message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.tx.signing.v1beta1.SignatureDescriptors} SignatureDescriptors
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
SignatureDescriptors.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a SignatureDescriptors message.
|
|
* @function verify
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
SignatureDescriptors.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
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.cosmos.tx.signing.v1beta1.SignatureDescriptor.verify(message.signatures[i]);
|
|
if (error)
|
|
return "signatures." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a SignatureDescriptors message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.tx.signing.v1beta1.SignatureDescriptors} SignatureDescriptors
|
|
*/
|
|
SignatureDescriptors.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.tx.signing.v1beta1.SignatureDescriptors)
|
|
return object;
|
|
var message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptors();
|
|
if (object.signatures) {
|
|
if (!Array.isArray(object.signatures))
|
|
throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptors.signatures: array expected");
|
|
message.signatures = [];
|
|
for (var i = 0; i < object.signatures.length; ++i) {
|
|
if (typeof object.signatures[i] !== "object")
|
|
throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptors.signatures: object expected");
|
|
message.signatures[i] = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.fromObject(object.signatures[i]);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a SignatureDescriptors message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors
|
|
* @static
|
|
* @param {cosmos.tx.signing.v1beta1.SignatureDescriptors} message SignatureDescriptors
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
SignatureDescriptors.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.signatures = [];
|
|
if (message.signatures && message.signatures.length) {
|
|
object.signatures = [];
|
|
for (var j = 0; j < message.signatures.length; ++j)
|
|
object.signatures[j] = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.toObject(message.signatures[j], options);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this SignatureDescriptors to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptors
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
SignatureDescriptors.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return SignatureDescriptors;
|
|
})(v1beta1.SignatureDescriptors || {});
|
|
|
|
v1beta1.SignatureDescriptor = (function(SignatureDescriptor) {
|
|
|
|
/**
|
|
* Properties of a SignatureDescriptor.
|
|
* @memberof cosmos.tx.signing.v1beta1
|
|
* @interface ISignatureDescriptor
|
|
* @property {google.protobuf.IAny|null} [publicKey] SignatureDescriptor publicKey
|
|
* @property {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData|null} [data] SignatureDescriptor data
|
|
* @property {number|Long|null} [sequence] SignatureDescriptor sequence
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new SignatureDescriptor.
|
|
* @memberof cosmos.tx.signing.v1beta1
|
|
* @classdesc Represents a SignatureDescriptor.
|
|
* @implements ISignatureDescriptor
|
|
* @constructor
|
|
* @param {cosmos.tx.signing.v1beta1.ISignatureDescriptor=} [properties] Properties to set
|
|
*/
|
|
function SignatureDescriptor(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* SignatureDescriptor publicKey.
|
|
* @member {google.protobuf.IAny|null|undefined} publicKey
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor
|
|
* @instance
|
|
*/
|
|
SignatureDescriptor.prototype.publicKey = null;
|
|
|
|
/**
|
|
* SignatureDescriptor data.
|
|
* @member {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData|null|undefined} data
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor
|
|
* @instance
|
|
*/
|
|
SignatureDescriptor.prototype.data = null;
|
|
|
|
/**
|
|
* SignatureDescriptor sequence.
|
|
* @member {number|Long} sequence
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor
|
|
* @instance
|
|
*/
|
|
SignatureDescriptor.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* Creates a new SignatureDescriptor instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor
|
|
* @static
|
|
* @param {cosmos.tx.signing.v1beta1.ISignatureDescriptor=} [properties] Properties to set
|
|
* @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor} SignatureDescriptor instance
|
|
*/
|
|
SignatureDescriptor.create = function create(properties) {
|
|
return new SignatureDescriptor(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified SignatureDescriptor message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor
|
|
* @static
|
|
* @param {cosmos.tx.signing.v1beta1.ISignatureDescriptor} message SignatureDescriptor message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
SignatureDescriptor.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey"))
|
|
$root.google.protobuf.Any.encode(message.publicKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.data != null && Object.hasOwnProperty.call(message, "data"))
|
|
$root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.encode(message.data, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence"))
|
|
writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified SignatureDescriptor message, length delimited. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor
|
|
* @static
|
|
* @param {cosmos.tx.signing.v1beta1.ISignatureDescriptor} message SignatureDescriptor message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
SignatureDescriptor.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a SignatureDescriptor message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor} SignatureDescriptor
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
SignatureDescriptor.decode = 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.tx.signing.v1beta1.SignatureDescriptor();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.publicKey = $root.google.protobuf.Any.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
message.data = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.decode(reader, reader.uint32());
|
|
break;
|
|
case 3:
|
|
message.sequence = reader.uint64();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a SignatureDescriptor message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor} SignatureDescriptor
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
SignatureDescriptor.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a SignatureDescriptor message.
|
|
* @function verify
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
SignatureDescriptor.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.publicKey != null && message.hasOwnProperty("publicKey")) {
|
|
var error = $root.google.protobuf.Any.verify(message.publicKey);
|
|
if (error)
|
|
return "publicKey." + error;
|
|
}
|
|
if (message.data != null && message.hasOwnProperty("data")) {
|
|
var error = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.verify(message.data);
|
|
if (error)
|
|
return "data." + error;
|
|
}
|
|
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 SignatureDescriptor message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor} SignatureDescriptor
|
|
*/
|
|
SignatureDescriptor.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.tx.signing.v1beta1.SignatureDescriptor)
|
|
return object;
|
|
var message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor();
|
|
if (object.publicKey != null) {
|
|
if (typeof object.publicKey !== "object")
|
|
throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.publicKey: object expected");
|
|
message.publicKey = $root.google.protobuf.Any.fromObject(object.publicKey);
|
|
}
|
|
if (object.data != null) {
|
|
if (typeof object.data !== "object")
|
|
throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.data: object expected");
|
|
message.data = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.fromObject(object.data);
|
|
}
|
|
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 SignatureDescriptor message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor
|
|
* @static
|
|
* @param {cosmos.tx.signing.v1beta1.SignatureDescriptor} message SignatureDescriptor
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
SignatureDescriptor.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.publicKey = null;
|
|
object.data = null;
|
|
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.publicKey != null && message.hasOwnProperty("publicKey"))
|
|
object.publicKey = $root.google.protobuf.Any.toObject(message.publicKey, options);
|
|
if (message.data != null && message.hasOwnProperty("data"))
|
|
object.data = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.toObject(message.data, options);
|
|
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 SignatureDescriptor to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
SignatureDescriptor.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
SignatureDescriptor.Data = (function(Data) {
|
|
|
|
/**
|
|
* Properties of a Data.
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor
|
|
* @interface IData
|
|
* @property {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle|null} [single] Data single
|
|
* @property {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti|null} [multi] Data multi
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Data.
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor
|
|
* @classdesc Represents a Data.
|
|
* @implements IData
|
|
* @constructor
|
|
* @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData=} [properties] Properties to set
|
|
*/
|
|
function Data(properties) {
|
|
if (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 single.
|
|
* @member {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle|null|undefined} single
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data
|
|
* @instance
|
|
*/
|
|
Data.prototype.single = null;
|
|
|
|
/**
|
|
* Data multi.
|
|
* @member {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti|null|undefined} multi
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data
|
|
* @instance
|
|
*/
|
|
Data.prototype.multi = null;
|
|
|
|
// OneOf field names bound to virtual getters and setters
|
|
var $oneOfFields;
|
|
|
|
/**
|
|
* Data sum.
|
|
* @member {"single"|"multi"|undefined} sum
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data
|
|
* @instance
|
|
*/
|
|
Object.defineProperty(Data.prototype, "sum", {
|
|
get: $util.oneOfGetter($oneOfFields = ["single", "multi"]),
|
|
set: $util.oneOfSetter($oneOfFields)
|
|
});
|
|
|
|
/**
|
|
* Creates a new Data instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data
|
|
* @static
|
|
* @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.IData=} [properties] Properties to set
|
|
* @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data} Data instance
|
|
*/
|
|
Data.create = function create(properties) {
|
|
return new Data(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Data message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data
|
|
* @static
|
|
* @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.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.single != null && Object.hasOwnProperty.call(message, "single"))
|
|
$root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.encode(message.single, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.multi != null && Object.hasOwnProperty.call(message, "multi"))
|
|
$root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.encode(message.multi, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Data message, length delimited. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data
|
|
* @static
|
|
* @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.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 cosmos.tx.signing.v1beta1.SignatureDescriptor.Data
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.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.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.single = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
message.multi = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.decode(reader, reader.uint32());
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a Data message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.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 cosmos.tx.signing.v1beta1.SignatureDescriptor.Data
|
|
* @static
|
|
* @param {Object.<string,*>} 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";
|
|
var properties = {};
|
|
if (message.single != null && message.hasOwnProperty("single")) {
|
|
properties.sum = 1;
|
|
{
|
|
var error = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.verify(message.single);
|
|
if (error)
|
|
return "single." + error;
|
|
}
|
|
}
|
|
if (message.multi != null && message.hasOwnProperty("multi")) {
|
|
if (properties.sum === 1)
|
|
return "sum: multiple values";
|
|
properties.sum = 1;
|
|
{
|
|
var error = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.verify(message.multi);
|
|
if (error)
|
|
return "multi." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a Data message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data} Data
|
|
*/
|
|
Data.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data)
|
|
return object;
|
|
var message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data();
|
|
if (object.single != null) {
|
|
if (typeof object.single !== "object")
|
|
throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.single: object expected");
|
|
message.single = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.fromObject(object.single);
|
|
}
|
|
if (object.multi != null) {
|
|
if (typeof object.multi !== "object")
|
|
throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.multi: object expected");
|
|
message.multi = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.fromObject(object.multi);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a Data message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data
|
|
* @static
|
|
* @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data} message Data
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Data.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (message.single != null && message.hasOwnProperty("single")) {
|
|
object.single = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.toObject(message.single, options);
|
|
if (options.oneofs)
|
|
object.sum = "single";
|
|
}
|
|
if (message.multi != null && message.hasOwnProperty("multi")) {
|
|
object.multi = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.toObject(message.multi, options);
|
|
if (options.oneofs)
|
|
object.sum = "multi";
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Data to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Data.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
Data.Single = (function(Single) {
|
|
|
|
/**
|
|
* Properties of a Single.
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data
|
|
* @interface ISingle
|
|
* @property {cosmos.tx.signing.v1beta1.SignMode|null} [mode] Single mode
|
|
* @property {Uint8Array|null} [signature] Single signature
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Single.
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data
|
|
* @classdesc Represents a Single.
|
|
* @implements ISingle
|
|
* @constructor
|
|
* @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle=} [properties] Properties to set
|
|
*/
|
|
function Single(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Single mode.
|
|
* @member {cosmos.tx.signing.v1beta1.SignMode} mode
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single
|
|
* @instance
|
|
*/
|
|
Single.prototype.mode = 0;
|
|
|
|
/**
|
|
* Single signature.
|
|
* @member {Uint8Array} signature
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single
|
|
* @instance
|
|
*/
|
|
Single.prototype.signature = $util.newBuffer([]);
|
|
|
|
/**
|
|
* Creates a new Single instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single
|
|
* @static
|
|
* @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle=} [properties] Properties to set
|
|
* @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single} Single instance
|
|
*/
|
|
Single.create = function create(properties) {
|
|
return new Single(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Single message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single
|
|
* @static
|
|
* @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle} message Single message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Single.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.mode != null && Object.hasOwnProperty.call(message, "mode"))
|
|
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode);
|
|
if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.signature);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Single message, length delimited. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single
|
|
* @static
|
|
* @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.ISingle} message Single message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Single.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a Single message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single} Single
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Single.decode = 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.tx.signing.v1beta1.SignatureDescriptor.Data.Single();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.mode = reader.int32();
|
|
break;
|
|
case 2:
|
|
message.signature = reader.bytes();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a Single message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single} Single
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Single.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a Single message.
|
|
* @function verify
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
Single.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.mode != null && message.hasOwnProperty("mode"))
|
|
switch (message.mode) {
|
|
default:
|
|
return "mode: enum value expected";
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
case 127:
|
|
break;
|
|
}
|
|
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 Single message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single} Single
|
|
*/
|
|
Single.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single)
|
|
return object;
|
|
var message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single();
|
|
switch (object.mode) {
|
|
case "SIGN_MODE_UNSPECIFIED":
|
|
case 0:
|
|
message.mode = 0;
|
|
break;
|
|
case "SIGN_MODE_DIRECT":
|
|
case 1:
|
|
message.mode = 1;
|
|
break;
|
|
case "SIGN_MODE_TEXTUAL":
|
|
case 2:
|
|
message.mode = 2;
|
|
break;
|
|
case "SIGN_MODE_LEGACY_AMINO_JSON":
|
|
case 127:
|
|
message.mode = 127;
|
|
break;
|
|
}
|
|
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 Single message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single
|
|
* @static
|
|
* @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single} message Single
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Single.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.mode = options.enums === String ? "SIGN_MODE_UNSPECIFIED" : 0;
|
|
if (options.bytes === String)
|
|
object.signature = "";
|
|
else {
|
|
object.signature = [];
|
|
if (options.bytes !== Array)
|
|
object.signature = $util.newBuffer(object.signature);
|
|
}
|
|
}
|
|
if (message.mode != null && message.hasOwnProperty("mode"))
|
|
object.mode = options.enums === String ? $root.cosmos.tx.signing.v1beta1.SignMode[message.mode] : message.mode;
|
|
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 Single to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Single.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Single;
|
|
})(Data.Single || {});
|
|
|
|
Data.Multi = (function(Multi) {
|
|
|
|
/**
|
|
* Properties of a Multi.
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data
|
|
* @interface IMulti
|
|
* @property {cosmos.crypto.multisig.v1beta1.ICompactBitArray|null} [bitarray] Multi bitarray
|
|
* @property {Array.<cosmos.tx.signing.v1beta1.SignatureDescriptor.IData>|null} [signatures] Multi signatures
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Multi.
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data
|
|
* @classdesc Represents a Multi.
|
|
* @implements IMulti
|
|
* @constructor
|
|
* @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti=} [properties] Properties to set
|
|
*/
|
|
function Multi(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]];
|
|
}
|
|
|
|
/**
|
|
* Multi bitarray.
|
|
* @member {cosmos.crypto.multisig.v1beta1.ICompactBitArray|null|undefined} bitarray
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi
|
|
* @instance
|
|
*/
|
|
Multi.prototype.bitarray = null;
|
|
|
|
/**
|
|
* Multi signatures.
|
|
* @member {Array.<cosmos.tx.signing.v1beta1.SignatureDescriptor.IData>} signatures
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi
|
|
* @instance
|
|
*/
|
|
Multi.prototype.signatures = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new Multi instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi
|
|
* @static
|
|
* @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti=} [properties] Properties to set
|
|
* @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi} Multi instance
|
|
*/
|
|
Multi.create = function create(properties) {
|
|
return new Multi(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Multi message. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi
|
|
* @static
|
|
* @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti} message Multi message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Multi.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.bitarray != null && Object.hasOwnProperty.call(message, "bitarray"))
|
|
$root.cosmos.crypto.multisig.v1beta1.CompactBitArray.encode(message.bitarray, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.signatures != null && message.signatures.length)
|
|
for (var i = 0; i < message.signatures.length; ++i)
|
|
$root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.encode(message.signatures[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Multi message, length delimited. Does not implicitly {@link cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi
|
|
* @static
|
|
* @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.IMulti} message Multi message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Multi.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a Multi message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi} Multi
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Multi.decode = 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.tx.signing.v1beta1.SignatureDescriptor.Data.Multi();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
if (!(message.signatures && message.signatures.length))
|
|
message.signatures = [];
|
|
message.signatures.push($root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.decode(reader, reader.uint32()));
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a Multi message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi} Multi
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Multi.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a Multi message.
|
|
* @function verify
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
Multi.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.bitarray != null && message.hasOwnProperty("bitarray")) {
|
|
var error = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.verify(message.bitarray);
|
|
if (error)
|
|
return "bitarray." + 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.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.verify(message.signatures[i]);
|
|
if (error)
|
|
return "signatures." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a Multi message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi} Multi
|
|
*/
|
|
Multi.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi)
|
|
return object;
|
|
var message = new $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi();
|
|
if (object.bitarray != null) {
|
|
if (typeof object.bitarray !== "object")
|
|
throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.bitarray: object expected");
|
|
message.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.fromObject(object.bitarray);
|
|
}
|
|
if (object.signatures) {
|
|
if (!Array.isArray(object.signatures))
|
|
throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.signatures: array expected");
|
|
message.signatures = [];
|
|
for (var i = 0; i < object.signatures.length; ++i) {
|
|
if (typeof object.signatures[i] !== "object")
|
|
throw TypeError(".cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi.signatures: object expected");
|
|
message.signatures[i] = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.fromObject(object.signatures[i]);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a Multi message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi
|
|
* @static
|
|
* @param {cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi} message Multi
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Multi.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.signatures = [];
|
|
if (options.defaults)
|
|
object.bitarray = null;
|
|
if (message.bitarray != null && message.hasOwnProperty("bitarray"))
|
|
object.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.toObject(message.bitarray, options);
|
|
if (message.signatures && message.signatures.length) {
|
|
object.signatures = [];
|
|
for (var j = 0; j < message.signatures.length; ++j)
|
|
object.signatures[j] = $root.cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.toObject(message.signatures[j], options);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Multi to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Multi.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Multi;
|
|
})(Data.Multi || {});
|
|
|
|
return Data;
|
|
})(SignatureDescriptor.Data || {});
|
|
|
|
return SignatureDescriptor;
|
|
})(v1beta1.SignatureDescriptor || {});
|
|
|
|
return v1beta1;
|
|
})(signing.v1beta1 || {});
|
|
|
|
return signing;
|
|
})(tx.signing || {});
|
|
|
|
/**
|
|
* Namespace v1beta1.
|
|
* @memberof cosmos.tx
|
|
* @namespace
|
|
*/
|
|
|
|
tx.v1beta1 = (function(v1beta1) {
|
|
|
|
v1beta1.Tx = (function(Tx) {
|
|
|
|
/**
|
|
* Properties of a Tx.
|
|
* @memberof cosmos.tx.v1beta1
|
|
* @interface ITx
|
|
* @property {cosmos.tx.v1beta1.ITxBody|null} [body] Tx body
|
|
* @property {cosmos.tx.v1beta1.IAuthInfo|null} [authInfo] Tx authInfo
|
|
* @property {Array.<Uint8Array>|null} [signatures] Tx signatures
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Tx.
|
|
* @memberof cosmos.tx.v1beta1
|
|
* @classdesc Represents a Tx.
|
|
* @implements ITx
|
|
* @constructor
|
|
* @param {cosmos.tx.v1beta1.ITx=} [properties] Properties to set
|
|
*/
|
|
function Tx(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]];
|
|
}
|
|
|
|
/**
|
|
* Tx body.
|
|
* @member {cosmos.tx.v1beta1.ITxBody|null|undefined} body
|
|
* @memberof cosmos.tx.v1beta1.Tx
|
|
* @instance
|
|
*/
|
|
Tx.prototype.body = null;
|
|
|
|
/**
|
|
* Tx authInfo.
|
|
* @member {cosmos.tx.v1beta1.IAuthInfo|null|undefined} authInfo
|
|
* @memberof cosmos.tx.v1beta1.Tx
|
|
* @instance
|
|
*/
|
|
Tx.prototype.authInfo = null;
|
|
|
|
/**
|
|
* Tx signatures.
|
|
* @member {Array.<Uint8Array>} signatures
|
|
* @memberof cosmos.tx.v1beta1.Tx
|
|
* @instance
|
|
*/
|
|
Tx.prototype.signatures = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new Tx instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.tx.v1beta1.Tx
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ITx=} [properties] Properties to set
|
|
* @returns {cosmos.tx.v1beta1.Tx} Tx instance
|
|
*/
|
|
Tx.create = function create(properties) {
|
|
return new Tx(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Tx message. Does not implicitly {@link cosmos.tx.v1beta1.Tx.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.tx.v1beta1.Tx
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ITx} message Tx message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Tx.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.body != null && Object.hasOwnProperty.call(message, "body"))
|
|
$root.cosmos.tx.v1beta1.TxBody.encode(message.body, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.authInfo != null && Object.hasOwnProperty.call(message, "authInfo"))
|
|
$root.cosmos.tx.v1beta1.AuthInfo.encode(message.authInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
if (message.signatures != null && message.signatures.length)
|
|
for (var i = 0; i < message.signatures.length; ++i)
|
|
writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signatures[i]);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Tx message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.Tx.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.tx.v1beta1.Tx
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ITx} message Tx message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Tx.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a Tx message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.tx.v1beta1.Tx
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.tx.v1beta1.Tx} Tx
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Tx.decode = 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.tx.v1beta1.Tx();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.body = $root.cosmos.tx.v1beta1.TxBody.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
message.authInfo = $root.cosmos.tx.v1beta1.AuthInfo.decode(reader, reader.uint32());
|
|
break;
|
|
case 3:
|
|
if (!(message.signatures && message.signatures.length))
|
|
message.signatures = [];
|
|
message.signatures.push(reader.bytes());
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a Tx message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.tx.v1beta1.Tx
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.tx.v1beta1.Tx} Tx
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Tx.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a Tx message.
|
|
* @function verify
|
|
* @memberof cosmos.tx.v1beta1.Tx
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
Tx.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.body != null && message.hasOwnProperty("body")) {
|
|
var error = $root.cosmos.tx.v1beta1.TxBody.verify(message.body);
|
|
if (error)
|
|
return "body." + error;
|
|
}
|
|
if (message.authInfo != null && message.hasOwnProperty("authInfo")) {
|
|
var error = $root.cosmos.tx.v1beta1.AuthInfo.verify(message.authInfo);
|
|
if (error)
|
|
return "authInfo." + 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)
|
|
if (!(message.signatures[i] && typeof message.signatures[i].length === "number" || $util.isString(message.signatures[i])))
|
|
return "signatures: buffer[] expected";
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a Tx message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.tx.v1beta1.Tx
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.tx.v1beta1.Tx} Tx
|
|
*/
|
|
Tx.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.tx.v1beta1.Tx)
|
|
return object;
|
|
var message = new $root.cosmos.tx.v1beta1.Tx();
|
|
if (object.body != null) {
|
|
if (typeof object.body !== "object")
|
|
throw TypeError(".cosmos.tx.v1beta1.Tx.body: object expected");
|
|
message.body = $root.cosmos.tx.v1beta1.TxBody.fromObject(object.body);
|
|
}
|
|
if (object.authInfo != null) {
|
|
if (typeof object.authInfo !== "object")
|
|
throw TypeError(".cosmos.tx.v1beta1.Tx.authInfo: object expected");
|
|
message.authInfo = $root.cosmos.tx.v1beta1.AuthInfo.fromObject(object.authInfo);
|
|
}
|
|
if (object.signatures) {
|
|
if (!Array.isArray(object.signatures))
|
|
throw TypeError(".cosmos.tx.v1beta1.Tx.signatures: array expected");
|
|
message.signatures = [];
|
|
for (var i = 0; i < object.signatures.length; ++i)
|
|
if (typeof object.signatures[i] === "string")
|
|
$util.base64.decode(object.signatures[i], message.signatures[i] = $util.newBuffer($util.base64.length(object.signatures[i])), 0);
|
|
else if (object.signatures[i].length)
|
|
message.signatures[i] = object.signatures[i];
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a Tx message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.tx.v1beta1.Tx
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.Tx} message Tx
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Tx.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.signatures = [];
|
|
if (options.defaults) {
|
|
object.body = null;
|
|
object.authInfo = null;
|
|
}
|
|
if (message.body != null && message.hasOwnProperty("body"))
|
|
object.body = $root.cosmos.tx.v1beta1.TxBody.toObject(message.body, options);
|
|
if (message.authInfo != null && message.hasOwnProperty("authInfo"))
|
|
object.authInfo = $root.cosmos.tx.v1beta1.AuthInfo.toObject(message.authInfo, options);
|
|
if (message.signatures && message.signatures.length) {
|
|
object.signatures = [];
|
|
for (var j = 0; j < message.signatures.length; ++j)
|
|
object.signatures[j] = options.bytes === String ? $util.base64.encode(message.signatures[j], 0, message.signatures[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.signatures[j]) : message.signatures[j];
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Tx to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.tx.v1beta1.Tx
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Tx.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Tx;
|
|
})(v1beta1.Tx || {});
|
|
|
|
v1beta1.TxRaw = (function(TxRaw) {
|
|
|
|
/**
|
|
* Properties of a TxRaw.
|
|
* @memberof cosmos.tx.v1beta1
|
|
* @interface ITxRaw
|
|
* @property {Uint8Array|null} [bodyBytes] TxRaw bodyBytes
|
|
* @property {Uint8Array|null} [authInfoBytes] TxRaw authInfoBytes
|
|
* @property {Array.<Uint8Array>|null} [signatures] TxRaw signatures
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new TxRaw.
|
|
* @memberof cosmos.tx.v1beta1
|
|
* @classdesc Represents a TxRaw.
|
|
* @implements ITxRaw
|
|
* @constructor
|
|
* @param {cosmos.tx.v1beta1.ITxRaw=} [properties] Properties to set
|
|
*/
|
|
function TxRaw(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]];
|
|
}
|
|
|
|
/**
|
|
* TxRaw bodyBytes.
|
|
* @member {Uint8Array} bodyBytes
|
|
* @memberof cosmos.tx.v1beta1.TxRaw
|
|
* @instance
|
|
*/
|
|
TxRaw.prototype.bodyBytes = $util.newBuffer([]);
|
|
|
|
/**
|
|
* TxRaw authInfoBytes.
|
|
* @member {Uint8Array} authInfoBytes
|
|
* @memberof cosmos.tx.v1beta1.TxRaw
|
|
* @instance
|
|
*/
|
|
TxRaw.prototype.authInfoBytes = $util.newBuffer([]);
|
|
|
|
/**
|
|
* TxRaw signatures.
|
|
* @member {Array.<Uint8Array>} signatures
|
|
* @memberof cosmos.tx.v1beta1.TxRaw
|
|
* @instance
|
|
*/
|
|
TxRaw.prototype.signatures = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new TxRaw instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.tx.v1beta1.TxRaw
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ITxRaw=} [properties] Properties to set
|
|
* @returns {cosmos.tx.v1beta1.TxRaw} TxRaw instance
|
|
*/
|
|
TxRaw.create = function create(properties) {
|
|
return new TxRaw(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified TxRaw message. Does not implicitly {@link cosmos.tx.v1beta1.TxRaw.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.tx.v1beta1.TxRaw
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ITxRaw} message TxRaw message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
TxRaw.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.bodyBytes != null && Object.hasOwnProperty.call(message, "bodyBytes"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.bodyBytes);
|
|
if (message.authInfoBytes != null && Object.hasOwnProperty.call(message, "authInfoBytes"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.authInfoBytes);
|
|
if (message.signatures != null && message.signatures.length)
|
|
for (var i = 0; i < message.signatures.length; ++i)
|
|
writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signatures[i]);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified TxRaw message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.TxRaw.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.tx.v1beta1.TxRaw
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ITxRaw} message TxRaw message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
TxRaw.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a TxRaw message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.tx.v1beta1.TxRaw
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.tx.v1beta1.TxRaw} TxRaw
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
TxRaw.decode = 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.tx.v1beta1.TxRaw();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.bodyBytes = reader.bytes();
|
|
break;
|
|
case 2:
|
|
message.authInfoBytes = reader.bytes();
|
|
break;
|
|
case 3:
|
|
if (!(message.signatures && message.signatures.length))
|
|
message.signatures = [];
|
|
message.signatures.push(reader.bytes());
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a TxRaw message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.tx.v1beta1.TxRaw
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.tx.v1beta1.TxRaw} TxRaw
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
TxRaw.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a TxRaw message.
|
|
* @function verify
|
|
* @memberof cosmos.tx.v1beta1.TxRaw
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
TxRaw.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.bodyBytes != null && message.hasOwnProperty("bodyBytes"))
|
|
if (!(message.bodyBytes && typeof message.bodyBytes.length === "number" || $util.isString(message.bodyBytes)))
|
|
return "bodyBytes: buffer expected";
|
|
if (message.authInfoBytes != null && message.hasOwnProperty("authInfoBytes"))
|
|
if (!(message.authInfoBytes && typeof message.authInfoBytes.length === "number" || $util.isString(message.authInfoBytes)))
|
|
return "authInfoBytes: buffer expected";
|
|
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)
|
|
if (!(message.signatures[i] && typeof message.signatures[i].length === "number" || $util.isString(message.signatures[i])))
|
|
return "signatures: buffer[] expected";
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a TxRaw message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.tx.v1beta1.TxRaw
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.tx.v1beta1.TxRaw} TxRaw
|
|
*/
|
|
TxRaw.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.tx.v1beta1.TxRaw)
|
|
return object;
|
|
var message = new $root.cosmos.tx.v1beta1.TxRaw();
|
|
if (object.bodyBytes != null)
|
|
if (typeof object.bodyBytes === "string")
|
|
$util.base64.decode(object.bodyBytes, message.bodyBytes = $util.newBuffer($util.base64.length(object.bodyBytes)), 0);
|
|
else if (object.bodyBytes.length)
|
|
message.bodyBytes = object.bodyBytes;
|
|
if (object.authInfoBytes != null)
|
|
if (typeof object.authInfoBytes === "string")
|
|
$util.base64.decode(object.authInfoBytes, message.authInfoBytes = $util.newBuffer($util.base64.length(object.authInfoBytes)), 0);
|
|
else if (object.authInfoBytes.length)
|
|
message.authInfoBytes = object.authInfoBytes;
|
|
if (object.signatures) {
|
|
if (!Array.isArray(object.signatures))
|
|
throw TypeError(".cosmos.tx.v1beta1.TxRaw.signatures: array expected");
|
|
message.signatures = [];
|
|
for (var i = 0; i < object.signatures.length; ++i)
|
|
if (typeof object.signatures[i] === "string")
|
|
$util.base64.decode(object.signatures[i], message.signatures[i] = $util.newBuffer($util.base64.length(object.signatures[i])), 0);
|
|
else if (object.signatures[i].length)
|
|
message.signatures[i] = object.signatures[i];
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a TxRaw message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.tx.v1beta1.TxRaw
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.TxRaw} message TxRaw
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
TxRaw.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.signatures = [];
|
|
if (options.defaults) {
|
|
if (options.bytes === String)
|
|
object.bodyBytes = "";
|
|
else {
|
|
object.bodyBytes = [];
|
|
if (options.bytes !== Array)
|
|
object.bodyBytes = $util.newBuffer(object.bodyBytes);
|
|
}
|
|
if (options.bytes === String)
|
|
object.authInfoBytes = "";
|
|
else {
|
|
object.authInfoBytes = [];
|
|
if (options.bytes !== Array)
|
|
object.authInfoBytes = $util.newBuffer(object.authInfoBytes);
|
|
}
|
|
}
|
|
if (message.bodyBytes != null && message.hasOwnProperty("bodyBytes"))
|
|
object.bodyBytes = options.bytes === String ? $util.base64.encode(message.bodyBytes, 0, message.bodyBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.bodyBytes) : message.bodyBytes;
|
|
if (message.authInfoBytes != null && message.hasOwnProperty("authInfoBytes"))
|
|
object.authInfoBytes = options.bytes === String ? $util.base64.encode(message.authInfoBytes, 0, message.authInfoBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.authInfoBytes) : message.authInfoBytes;
|
|
if (message.signatures && message.signatures.length) {
|
|
object.signatures = [];
|
|
for (var j = 0; j < message.signatures.length; ++j)
|
|
object.signatures[j] = options.bytes === String ? $util.base64.encode(message.signatures[j], 0, message.signatures[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.signatures[j]) : message.signatures[j];
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this TxRaw to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.tx.v1beta1.TxRaw
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
TxRaw.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return TxRaw;
|
|
})(v1beta1.TxRaw || {});
|
|
|
|
v1beta1.SignDoc = (function(SignDoc) {
|
|
|
|
/**
|
|
* Properties of a SignDoc.
|
|
* @memberof cosmos.tx.v1beta1
|
|
* @interface ISignDoc
|
|
* @property {Uint8Array|null} [bodyBytes] SignDoc bodyBytes
|
|
* @property {Uint8Array|null} [authInfoBytes] SignDoc authInfoBytes
|
|
* @property {string|null} [chainId] SignDoc chainId
|
|
* @property {number|Long|null} [accountNumber] SignDoc accountNumber
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new SignDoc.
|
|
* @memberof cosmos.tx.v1beta1
|
|
* @classdesc Represents a SignDoc.
|
|
* @implements ISignDoc
|
|
* @constructor
|
|
* @param {cosmos.tx.v1beta1.ISignDoc=} [properties] Properties to set
|
|
*/
|
|
function SignDoc(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* SignDoc bodyBytes.
|
|
* @member {Uint8Array} bodyBytes
|
|
* @memberof cosmos.tx.v1beta1.SignDoc
|
|
* @instance
|
|
*/
|
|
SignDoc.prototype.bodyBytes = $util.newBuffer([]);
|
|
|
|
/**
|
|
* SignDoc authInfoBytes.
|
|
* @member {Uint8Array} authInfoBytes
|
|
* @memberof cosmos.tx.v1beta1.SignDoc
|
|
* @instance
|
|
*/
|
|
SignDoc.prototype.authInfoBytes = $util.newBuffer([]);
|
|
|
|
/**
|
|
* SignDoc chainId.
|
|
* @member {string} chainId
|
|
* @memberof cosmos.tx.v1beta1.SignDoc
|
|
* @instance
|
|
*/
|
|
SignDoc.prototype.chainId = "";
|
|
|
|
/**
|
|
* SignDoc accountNumber.
|
|
* @member {number|Long} accountNumber
|
|
* @memberof cosmos.tx.v1beta1.SignDoc
|
|
* @instance
|
|
*/
|
|
SignDoc.prototype.accountNumber = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* Creates a new SignDoc instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.tx.v1beta1.SignDoc
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ISignDoc=} [properties] Properties to set
|
|
* @returns {cosmos.tx.v1beta1.SignDoc} SignDoc instance
|
|
*/
|
|
SignDoc.create = function create(properties) {
|
|
return new SignDoc(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified SignDoc message. Does not implicitly {@link cosmos.tx.v1beta1.SignDoc.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.tx.v1beta1.SignDoc
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ISignDoc} message SignDoc message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
SignDoc.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.bodyBytes != null && Object.hasOwnProperty.call(message, "bodyBytes"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.bodyBytes);
|
|
if (message.authInfoBytes != null && Object.hasOwnProperty.call(message, "authInfoBytes"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.authInfoBytes);
|
|
if (message.chainId != null && Object.hasOwnProperty.call(message, "chainId"))
|
|
writer.uint32(/* id 3, wireType 2 =*/26).string(message.chainId);
|
|
if (message.accountNumber != null && Object.hasOwnProperty.call(message, "accountNumber"))
|
|
writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.accountNumber);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified SignDoc message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.SignDoc.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.tx.v1beta1.SignDoc
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ISignDoc} message SignDoc message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
SignDoc.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a SignDoc message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.tx.v1beta1.SignDoc
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.tx.v1beta1.SignDoc} SignDoc
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
SignDoc.decode = 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.tx.v1beta1.SignDoc();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.bodyBytes = reader.bytes();
|
|
break;
|
|
case 2:
|
|
message.authInfoBytes = reader.bytes();
|
|
break;
|
|
case 3:
|
|
message.chainId = reader.string();
|
|
break;
|
|
case 4:
|
|
message.accountNumber = reader.uint64();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a SignDoc message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.tx.v1beta1.SignDoc
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.tx.v1beta1.SignDoc} SignDoc
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
SignDoc.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a SignDoc message.
|
|
* @function verify
|
|
* @memberof cosmos.tx.v1beta1.SignDoc
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
SignDoc.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.bodyBytes != null && message.hasOwnProperty("bodyBytes"))
|
|
if (!(message.bodyBytes && typeof message.bodyBytes.length === "number" || $util.isString(message.bodyBytes)))
|
|
return "bodyBytes: buffer expected";
|
|
if (message.authInfoBytes != null && message.hasOwnProperty("authInfoBytes"))
|
|
if (!(message.authInfoBytes && typeof message.authInfoBytes.length === "number" || $util.isString(message.authInfoBytes)))
|
|
return "authInfoBytes: buffer expected";
|
|
if (message.chainId != null && message.hasOwnProperty("chainId"))
|
|
if (!$util.isString(message.chainId))
|
|
return "chainId: string expected";
|
|
if (message.accountNumber != null && message.hasOwnProperty("accountNumber"))
|
|
if (!$util.isInteger(message.accountNumber) && !(message.accountNumber && $util.isInteger(message.accountNumber.low) && $util.isInteger(message.accountNumber.high)))
|
|
return "accountNumber: integer|Long expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a SignDoc message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.tx.v1beta1.SignDoc
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.tx.v1beta1.SignDoc} SignDoc
|
|
*/
|
|
SignDoc.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.tx.v1beta1.SignDoc)
|
|
return object;
|
|
var message = new $root.cosmos.tx.v1beta1.SignDoc();
|
|
if (object.bodyBytes != null)
|
|
if (typeof object.bodyBytes === "string")
|
|
$util.base64.decode(object.bodyBytes, message.bodyBytes = $util.newBuffer($util.base64.length(object.bodyBytes)), 0);
|
|
else if (object.bodyBytes.length)
|
|
message.bodyBytes = object.bodyBytes;
|
|
if (object.authInfoBytes != null)
|
|
if (typeof object.authInfoBytes === "string")
|
|
$util.base64.decode(object.authInfoBytes, message.authInfoBytes = $util.newBuffer($util.base64.length(object.authInfoBytes)), 0);
|
|
else if (object.authInfoBytes.length)
|
|
message.authInfoBytes = object.authInfoBytes;
|
|
if (object.chainId != null)
|
|
message.chainId = String(object.chainId);
|
|
if (object.accountNumber != null)
|
|
if ($util.Long)
|
|
(message.accountNumber = $util.Long.fromValue(object.accountNumber)).unsigned = true;
|
|
else if (typeof object.accountNumber === "string")
|
|
message.accountNumber = parseInt(object.accountNumber, 10);
|
|
else if (typeof object.accountNumber === "number")
|
|
message.accountNumber = object.accountNumber;
|
|
else if (typeof object.accountNumber === "object")
|
|
message.accountNumber = new $util.LongBits(object.accountNumber.low >>> 0, object.accountNumber.high >>> 0).toNumber(true);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a SignDoc message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.tx.v1beta1.SignDoc
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.SignDoc} message SignDoc
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
SignDoc.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
if (options.bytes === String)
|
|
object.bodyBytes = "";
|
|
else {
|
|
object.bodyBytes = [];
|
|
if (options.bytes !== Array)
|
|
object.bodyBytes = $util.newBuffer(object.bodyBytes);
|
|
}
|
|
if (options.bytes === String)
|
|
object.authInfoBytes = "";
|
|
else {
|
|
object.authInfoBytes = [];
|
|
if (options.bytes !== Array)
|
|
object.authInfoBytes = $util.newBuffer(object.authInfoBytes);
|
|
}
|
|
object.chainId = "";
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, true);
|
|
object.accountNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.accountNumber = options.longs === String ? "0" : 0;
|
|
}
|
|
if (message.bodyBytes != null && message.hasOwnProperty("bodyBytes"))
|
|
object.bodyBytes = options.bytes === String ? $util.base64.encode(message.bodyBytes, 0, message.bodyBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.bodyBytes) : message.bodyBytes;
|
|
if (message.authInfoBytes != null && message.hasOwnProperty("authInfoBytes"))
|
|
object.authInfoBytes = options.bytes === String ? $util.base64.encode(message.authInfoBytes, 0, message.authInfoBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.authInfoBytes) : message.authInfoBytes;
|
|
if (message.chainId != null && message.hasOwnProperty("chainId"))
|
|
object.chainId = message.chainId;
|
|
if (message.accountNumber != null && message.hasOwnProperty("accountNumber"))
|
|
if (typeof message.accountNumber === "number")
|
|
object.accountNumber = options.longs === String ? String(message.accountNumber) : message.accountNumber;
|
|
else
|
|
object.accountNumber = options.longs === String ? $util.Long.prototype.toString.call(message.accountNumber) : options.longs === Number ? new $util.LongBits(message.accountNumber.low >>> 0, message.accountNumber.high >>> 0).toNumber(true) : message.accountNumber;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this SignDoc to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.tx.v1beta1.SignDoc
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
SignDoc.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return SignDoc;
|
|
})(v1beta1.SignDoc || {});
|
|
|
|
v1beta1.TxBody = (function(TxBody) {
|
|
|
|
/**
|
|
* Properties of a TxBody.
|
|
* @memberof cosmos.tx.v1beta1
|
|
* @interface ITxBody
|
|
* @property {Array.<google.protobuf.IAny>|null} [messages] TxBody messages
|
|
* @property {string|null} [memo] TxBody memo
|
|
* @property {number|Long|null} [timeoutHeight] TxBody timeoutHeight
|
|
* @property {Array.<google.protobuf.IAny>|null} [extensionOptions] TxBody extensionOptions
|
|
* @property {Array.<google.protobuf.IAny>|null} [nonCriticalExtensionOptions] TxBody nonCriticalExtensionOptions
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new TxBody.
|
|
* @memberof cosmos.tx.v1beta1
|
|
* @classdesc Represents a TxBody.
|
|
* @implements ITxBody
|
|
* @constructor
|
|
* @param {cosmos.tx.v1beta1.ITxBody=} [properties] Properties to set
|
|
*/
|
|
function TxBody(properties) {
|
|
this.messages = [];
|
|
this.extensionOptions = [];
|
|
this.nonCriticalExtensionOptions = [];
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* TxBody messages.
|
|
* @member {Array.<google.protobuf.IAny>} messages
|
|
* @memberof cosmos.tx.v1beta1.TxBody
|
|
* @instance
|
|
*/
|
|
TxBody.prototype.messages = $util.emptyArray;
|
|
|
|
/**
|
|
* TxBody memo.
|
|
* @member {string} memo
|
|
* @memberof cosmos.tx.v1beta1.TxBody
|
|
* @instance
|
|
*/
|
|
TxBody.prototype.memo = "";
|
|
|
|
/**
|
|
* TxBody timeoutHeight.
|
|
* @member {number|Long} timeoutHeight
|
|
* @memberof cosmos.tx.v1beta1.TxBody
|
|
* @instance
|
|
*/
|
|
TxBody.prototype.timeoutHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* TxBody extensionOptions.
|
|
* @member {Array.<google.protobuf.IAny>} extensionOptions
|
|
* @memberof cosmos.tx.v1beta1.TxBody
|
|
* @instance
|
|
*/
|
|
TxBody.prototype.extensionOptions = $util.emptyArray;
|
|
|
|
/**
|
|
* TxBody nonCriticalExtensionOptions.
|
|
* @member {Array.<google.protobuf.IAny>} nonCriticalExtensionOptions
|
|
* @memberof cosmos.tx.v1beta1.TxBody
|
|
* @instance
|
|
*/
|
|
TxBody.prototype.nonCriticalExtensionOptions = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new TxBody instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.tx.v1beta1.TxBody
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ITxBody=} [properties] Properties to set
|
|
* @returns {cosmos.tx.v1beta1.TxBody} TxBody instance
|
|
*/
|
|
TxBody.create = function create(properties) {
|
|
return new TxBody(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified TxBody message. Does not implicitly {@link cosmos.tx.v1beta1.TxBody.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.tx.v1beta1.TxBody
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ITxBody} message TxBody message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
TxBody.encode = function encode(message, writer) {
|
|
console.log('encoding: ', message)
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.messages != null && message.messages.length)
|
|
for (var i = 0; i < message.messages.length; ++i)
|
|
message.messages[i].constructor.encode(message.messages[i].value, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim()
|
|
// $root.google.protobuf.Any.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.memo != null && Object.hasOwnProperty.call(message, "memo"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.memo);
|
|
if (message.timeoutHeight != null && Object.hasOwnProperty.call(message, "timeoutHeight"))
|
|
writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.timeoutHeight);
|
|
if (message.extensionOptions != null && message.extensionOptions.length)
|
|
for (var i = 0; i < message.extensionOptions.length; ++i)
|
|
$root.google.protobuf.Any.encode(message.extensionOptions[i], writer.uint32(/* id 1023, wireType 2 =*/8186).fork()).ldelim();
|
|
if (message.nonCriticalExtensionOptions != null && message.nonCriticalExtensionOptions.length)
|
|
for (var i = 0; i < message.nonCriticalExtensionOptions.length; ++i)
|
|
$root.google.protobuf.Any.encode(message.nonCriticalExtensionOptions[i], writer.uint32(/* id 2047, wireType 2 =*/16378).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified TxBody message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.TxBody.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.tx.v1beta1.TxBody
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ITxBody} message TxBody message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
TxBody.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a TxBody message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.tx.v1beta1.TxBody
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.tx.v1beta1.TxBody} TxBody
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
TxBody.decode = 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.tx.v1beta1.TxBody();
|
|
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;
|
|
case 2:
|
|
message.memo = reader.string();
|
|
break;
|
|
case 3:
|
|
message.timeoutHeight = reader.uint64();
|
|
break;
|
|
case 1023:
|
|
if (!(message.extensionOptions && message.extensionOptions.length))
|
|
message.extensionOptions = [];
|
|
message.extensionOptions.push($root.google.protobuf.Any.decode(reader, reader.uint32()));
|
|
break;
|
|
case 2047:
|
|
if (!(message.nonCriticalExtensionOptions && message.nonCriticalExtensionOptions.length))
|
|
message.nonCriticalExtensionOptions = [];
|
|
message.nonCriticalExtensionOptions.push($root.google.protobuf.Any.decode(reader, reader.uint32()));
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a TxBody message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.tx.v1beta1.TxBody
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.tx.v1beta1.TxBody} TxBody
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
TxBody.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a TxBody message.
|
|
* @function verify
|
|
* @memberof cosmos.tx.v1beta1.TxBody
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
TxBody.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;
|
|
}
|
|
}
|
|
if (message.memo != null && message.hasOwnProperty("memo"))
|
|
if (!$util.isString(message.memo))
|
|
return "memo: string expected";
|
|
if (message.timeoutHeight != null && message.hasOwnProperty("timeoutHeight"))
|
|
if (!$util.isInteger(message.timeoutHeight) && !(message.timeoutHeight && $util.isInteger(message.timeoutHeight.low) && $util.isInteger(message.timeoutHeight.high)))
|
|
return "timeoutHeight: integer|Long expected";
|
|
if (message.extensionOptions != null && message.hasOwnProperty("extensionOptions")) {
|
|
if (!Array.isArray(message.extensionOptions))
|
|
return "extensionOptions: array expected";
|
|
for (var i = 0; i < message.extensionOptions.length; ++i) {
|
|
var error = $root.google.protobuf.Any.verify(message.extensionOptions[i]);
|
|
if (error)
|
|
return "extensionOptions." + error;
|
|
}
|
|
}
|
|
if (message.nonCriticalExtensionOptions != null && message.hasOwnProperty("nonCriticalExtensionOptions")) {
|
|
if (!Array.isArray(message.nonCriticalExtensionOptions))
|
|
return "nonCriticalExtensionOptions: array expected";
|
|
for (var i = 0; i < message.nonCriticalExtensionOptions.length; ++i) {
|
|
var error = $root.google.protobuf.Any.verify(message.nonCriticalExtensionOptions[i]);
|
|
if (error)
|
|
return "nonCriticalExtensionOptions." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a TxBody message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.tx.v1beta1.TxBody
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.tx.v1beta1.TxBody} TxBody
|
|
*/
|
|
TxBody.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.tx.v1beta1.TxBody)
|
|
return object;
|
|
var message = new $root.cosmos.tx.v1beta1.TxBody();
|
|
if (object.messages) {
|
|
if (!Array.isArray(object.messages))
|
|
throw TypeError(".cosmos.tx.v1beta1.TxBody.messages: array expected");
|
|
message.messages = [];
|
|
for (var i = 0; i < object.messages.length; ++i) {
|
|
if (typeof object.messages[i] !== "object")
|
|
throw TypeError(".cosmos.tx.v1beta1.TxBody.messages: object expected");
|
|
message.messages[i] = $root.google.protobuf.Any.fromObject(object.messages[i]);
|
|
}
|
|
}
|
|
if (object.memo != null)
|
|
message.memo = String(object.memo);
|
|
if (object.timeoutHeight != null)
|
|
if ($util.Long)
|
|
(message.timeoutHeight = $util.Long.fromValue(object.timeoutHeight)).unsigned = true;
|
|
else if (typeof object.timeoutHeight === "string")
|
|
message.timeoutHeight = parseInt(object.timeoutHeight, 10);
|
|
else if (typeof object.timeoutHeight === "number")
|
|
message.timeoutHeight = object.timeoutHeight;
|
|
else if (typeof object.timeoutHeight === "object")
|
|
message.timeoutHeight = new $util.LongBits(object.timeoutHeight.low >>> 0, object.timeoutHeight.high >>> 0).toNumber(true);
|
|
if (object.extensionOptions) {
|
|
if (!Array.isArray(object.extensionOptions))
|
|
throw TypeError(".cosmos.tx.v1beta1.TxBody.extensionOptions: array expected");
|
|
message.extensionOptions = [];
|
|
for (var i = 0; i < object.extensionOptions.length; ++i) {
|
|
if (typeof object.extensionOptions[i] !== "object")
|
|
throw TypeError(".cosmos.tx.v1beta1.TxBody.extensionOptions: object expected");
|
|
message.extensionOptions[i] = $root.google.protobuf.Any.fromObject(object.extensionOptions[i]);
|
|
}
|
|
}
|
|
if (object.nonCriticalExtensionOptions) {
|
|
if (!Array.isArray(object.nonCriticalExtensionOptions))
|
|
throw TypeError(".cosmos.tx.v1beta1.TxBody.nonCriticalExtensionOptions: array expected");
|
|
message.nonCriticalExtensionOptions = [];
|
|
for (var i = 0; i < object.nonCriticalExtensionOptions.length; ++i) {
|
|
if (typeof object.nonCriticalExtensionOptions[i] !== "object")
|
|
throw TypeError(".cosmos.tx.v1beta1.TxBody.nonCriticalExtensionOptions: object expected");
|
|
message.nonCriticalExtensionOptions[i] = $root.google.protobuf.Any.fromObject(object.nonCriticalExtensionOptions[i]);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a TxBody message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.tx.v1beta1.TxBody
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.TxBody} message TxBody
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
TxBody.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) {
|
|
object.messages = [];
|
|
object.extensionOptions = [];
|
|
object.nonCriticalExtensionOptions = [];
|
|
}
|
|
if (options.defaults) {
|
|
object.memo = "";
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, true);
|
|
object.timeoutHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.timeoutHeight = options.longs === String ? "0" : 0;
|
|
}
|
|
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);
|
|
}
|
|
if (message.memo != null && message.hasOwnProperty("memo"))
|
|
object.memo = message.memo;
|
|
if (message.timeoutHeight != null && message.hasOwnProperty("timeoutHeight"))
|
|
if (typeof message.timeoutHeight === "number")
|
|
object.timeoutHeight = options.longs === String ? String(message.timeoutHeight) : message.timeoutHeight;
|
|
else
|
|
object.timeoutHeight = options.longs === String ? $util.Long.prototype.toString.call(message.timeoutHeight) : options.longs === Number ? new $util.LongBits(message.timeoutHeight.low >>> 0, message.timeoutHeight.high >>> 0).toNumber(true) : message.timeoutHeight;
|
|
if (message.extensionOptions && message.extensionOptions.length) {
|
|
object.extensionOptions = [];
|
|
for (var j = 0; j < message.extensionOptions.length; ++j)
|
|
object.extensionOptions[j] = $root.google.protobuf.Any.toObject(message.extensionOptions[j], options);
|
|
}
|
|
if (message.nonCriticalExtensionOptions && message.nonCriticalExtensionOptions.length) {
|
|
object.nonCriticalExtensionOptions = [];
|
|
for (var j = 0; j < message.nonCriticalExtensionOptions.length; ++j)
|
|
object.nonCriticalExtensionOptions[j] = $root.google.protobuf.Any.toObject(message.nonCriticalExtensionOptions[j], options);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this TxBody to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.tx.v1beta1.TxBody
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
TxBody.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return TxBody;
|
|
})(v1beta1.TxBody || {});
|
|
|
|
v1beta1.AuthInfo = (function(AuthInfo) {
|
|
|
|
/**
|
|
* Properties of an AuthInfo.
|
|
* @memberof cosmos.tx.v1beta1
|
|
* @interface IAuthInfo
|
|
* @property {Array.<cosmos.tx.v1beta1.ISignerInfo>|null} [signerInfos] AuthInfo signerInfos
|
|
* @property {cosmos.tx.v1beta1.IFee|null} [fee] AuthInfo fee
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new AuthInfo.
|
|
* @memberof cosmos.tx.v1beta1
|
|
* @classdesc Represents an AuthInfo.
|
|
* @implements IAuthInfo
|
|
* @constructor
|
|
* @param {cosmos.tx.v1beta1.IAuthInfo=} [properties] Properties to set
|
|
*/
|
|
function AuthInfo(properties) {
|
|
this.signerInfos = [];
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* AuthInfo signerInfos.
|
|
* @member {Array.<cosmos.tx.v1beta1.ISignerInfo>} signerInfos
|
|
* @memberof cosmos.tx.v1beta1.AuthInfo
|
|
* @instance
|
|
*/
|
|
AuthInfo.prototype.signerInfos = $util.emptyArray;
|
|
|
|
/**
|
|
* AuthInfo fee.
|
|
* @member {cosmos.tx.v1beta1.IFee|null|undefined} fee
|
|
* @memberof cosmos.tx.v1beta1.AuthInfo
|
|
* @instance
|
|
*/
|
|
AuthInfo.prototype.fee = null;
|
|
|
|
/**
|
|
* Creates a new AuthInfo instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.tx.v1beta1.AuthInfo
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.IAuthInfo=} [properties] Properties to set
|
|
* @returns {cosmos.tx.v1beta1.AuthInfo} AuthInfo instance
|
|
*/
|
|
AuthInfo.create = function create(properties) {
|
|
return new AuthInfo(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified AuthInfo message. Does not implicitly {@link cosmos.tx.v1beta1.AuthInfo.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.tx.v1beta1.AuthInfo
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.IAuthInfo} message AuthInfo message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
AuthInfo.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.signerInfos != null && message.signerInfos.length)
|
|
for (var i = 0; i < message.signerInfos.length; ++i)
|
|
$root.cosmos.tx.v1beta1.SignerInfo.encode(message.signerInfos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.fee != null && Object.hasOwnProperty.call(message, "fee"))
|
|
$root.cosmos.tx.v1beta1.Fee.encode(message.fee, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified AuthInfo message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.AuthInfo.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.tx.v1beta1.AuthInfo
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.IAuthInfo} message AuthInfo message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
AuthInfo.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes an AuthInfo message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.tx.v1beta1.AuthInfo
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.tx.v1beta1.AuthInfo} AuthInfo
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
AuthInfo.decode = 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.tx.v1beta1.AuthInfo();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
if (!(message.signerInfos && message.signerInfos.length))
|
|
message.signerInfos = [];
|
|
message.signerInfos.push($root.cosmos.tx.v1beta1.SignerInfo.decode(reader, reader.uint32()));
|
|
break;
|
|
case 2:
|
|
message.fee = $root.cosmos.tx.v1beta1.Fee.decode(reader, reader.uint32());
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes an AuthInfo message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.tx.v1beta1.AuthInfo
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.tx.v1beta1.AuthInfo} AuthInfo
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
AuthInfo.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies an AuthInfo message.
|
|
* @function verify
|
|
* @memberof cosmos.tx.v1beta1.AuthInfo
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
AuthInfo.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.signerInfos != null && message.hasOwnProperty("signerInfos")) {
|
|
if (!Array.isArray(message.signerInfos))
|
|
return "signerInfos: array expected";
|
|
for (var i = 0; i < message.signerInfos.length; ++i) {
|
|
var error = $root.cosmos.tx.v1beta1.SignerInfo.verify(message.signerInfos[i]);
|
|
if (error)
|
|
return "signerInfos." + error;
|
|
}
|
|
}
|
|
if (message.fee != null && message.hasOwnProperty("fee")) {
|
|
var error = $root.cosmos.tx.v1beta1.Fee.verify(message.fee);
|
|
if (error)
|
|
return "fee." + error;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates an AuthInfo message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.tx.v1beta1.AuthInfo
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.tx.v1beta1.AuthInfo} AuthInfo
|
|
*/
|
|
AuthInfo.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.tx.v1beta1.AuthInfo)
|
|
return object;
|
|
var message = new $root.cosmos.tx.v1beta1.AuthInfo();
|
|
if (object.signerInfos) {
|
|
if (!Array.isArray(object.signerInfos))
|
|
throw TypeError(".cosmos.tx.v1beta1.AuthInfo.signerInfos: array expected");
|
|
message.signerInfos = [];
|
|
for (var i = 0; i < object.signerInfos.length; ++i) {
|
|
if (typeof object.signerInfos[i] !== "object")
|
|
throw TypeError(".cosmos.tx.v1beta1.AuthInfo.signerInfos: object expected");
|
|
message.signerInfos[i] = $root.cosmos.tx.v1beta1.SignerInfo.fromObject(object.signerInfos[i]);
|
|
}
|
|
}
|
|
if (object.fee != null) {
|
|
if (typeof object.fee !== "object")
|
|
throw TypeError(".cosmos.tx.v1beta1.AuthInfo.fee: object expected");
|
|
message.fee = $root.cosmos.tx.v1beta1.Fee.fromObject(object.fee);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from an AuthInfo message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.tx.v1beta1.AuthInfo
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.AuthInfo} message AuthInfo
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
AuthInfo.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.signerInfos = [];
|
|
if (options.defaults)
|
|
object.fee = null;
|
|
if (message.signerInfos && message.signerInfos.length) {
|
|
object.signerInfos = [];
|
|
for (var j = 0; j < message.signerInfos.length; ++j)
|
|
object.signerInfos[j] = $root.cosmos.tx.v1beta1.SignerInfo.toObject(message.signerInfos[j], options);
|
|
}
|
|
if (message.fee != null && message.hasOwnProperty("fee"))
|
|
object.fee = $root.cosmos.tx.v1beta1.Fee.toObject(message.fee, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this AuthInfo to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.tx.v1beta1.AuthInfo
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
AuthInfo.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return AuthInfo;
|
|
})(v1beta1.AuthInfo || {});
|
|
|
|
v1beta1.SignerInfo = (function(SignerInfo) {
|
|
|
|
/**
|
|
* Properties of a SignerInfo.
|
|
* @memberof cosmos.tx.v1beta1
|
|
* @interface ISignerInfo
|
|
* @property {google.protobuf.IAny|null} [publicKey] SignerInfo publicKey
|
|
* @property {cosmos.tx.v1beta1.IModeInfo|null} [modeInfo] SignerInfo modeInfo
|
|
* @property {number|Long|null} [sequence] SignerInfo sequence
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new SignerInfo.
|
|
* @memberof cosmos.tx.v1beta1
|
|
* @classdesc Represents a SignerInfo.
|
|
* @implements ISignerInfo
|
|
* @constructor
|
|
* @param {cosmos.tx.v1beta1.ISignerInfo=} [properties] Properties to set
|
|
*/
|
|
function SignerInfo(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* SignerInfo publicKey.
|
|
* @member {google.protobuf.IAny|null|undefined} publicKey
|
|
* @memberof cosmos.tx.v1beta1.SignerInfo
|
|
* @instance
|
|
*/
|
|
SignerInfo.prototype.publicKey = null;
|
|
|
|
/**
|
|
* SignerInfo modeInfo.
|
|
* @member {cosmos.tx.v1beta1.IModeInfo|null|undefined} modeInfo
|
|
* @memberof cosmos.tx.v1beta1.SignerInfo
|
|
* @instance
|
|
*/
|
|
SignerInfo.prototype.modeInfo = null;
|
|
|
|
/**
|
|
* SignerInfo sequence.
|
|
* @member {number|Long} sequence
|
|
* @memberof cosmos.tx.v1beta1.SignerInfo
|
|
* @instance
|
|
*/
|
|
SignerInfo.prototype.sequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* Creates a new SignerInfo instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.tx.v1beta1.SignerInfo
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ISignerInfo=} [properties] Properties to set
|
|
* @returns {cosmos.tx.v1beta1.SignerInfo} SignerInfo instance
|
|
*/
|
|
SignerInfo.create = function create(properties) {
|
|
return new SignerInfo(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified SignerInfo message. Does not implicitly {@link cosmos.tx.v1beta1.SignerInfo.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.tx.v1beta1.SignerInfo
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ISignerInfo} message SignerInfo message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
SignerInfo.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey"))
|
|
$root.google.protobuf.Any.encode(message.publicKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.modeInfo != null && Object.hasOwnProperty.call(message, "modeInfo"))
|
|
$root.cosmos.tx.v1beta1.ModeInfo.encode(message.modeInfo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence"))
|
|
writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sequence);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified SignerInfo message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.SignerInfo.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.tx.v1beta1.SignerInfo
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ISignerInfo} message SignerInfo message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
SignerInfo.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a SignerInfo message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.tx.v1beta1.SignerInfo
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.tx.v1beta1.SignerInfo} SignerInfo
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
SignerInfo.decode = 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.tx.v1beta1.SignerInfo();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.publicKey = $root.google.protobuf.Any.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
message.modeInfo = $root.cosmos.tx.v1beta1.ModeInfo.decode(reader, reader.uint32());
|
|
break;
|
|
case 3:
|
|
message.sequence = reader.uint64();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a SignerInfo message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.tx.v1beta1.SignerInfo
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.tx.v1beta1.SignerInfo} SignerInfo
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
SignerInfo.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a SignerInfo message.
|
|
* @function verify
|
|
* @memberof cosmos.tx.v1beta1.SignerInfo
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
SignerInfo.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.publicKey != null && message.hasOwnProperty("publicKey")) {
|
|
var error = $root.google.protobuf.Any.verify(message.publicKey);
|
|
if (error)
|
|
return "publicKey." + error;
|
|
}
|
|
if (message.modeInfo != null && message.hasOwnProperty("modeInfo")) {
|
|
var error = $root.cosmos.tx.v1beta1.ModeInfo.verify(message.modeInfo);
|
|
if (error)
|
|
return "modeInfo." + error;
|
|
}
|
|
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 SignerInfo message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.tx.v1beta1.SignerInfo
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.tx.v1beta1.SignerInfo} SignerInfo
|
|
*/
|
|
SignerInfo.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.tx.v1beta1.SignerInfo)
|
|
return object;
|
|
var message = new $root.cosmos.tx.v1beta1.SignerInfo();
|
|
if (object.publicKey != null) {
|
|
if (typeof object.publicKey !== "object")
|
|
throw TypeError(".cosmos.tx.v1beta1.SignerInfo.publicKey: object expected");
|
|
message.publicKey = $root.google.protobuf.Any.fromObject(object.publicKey);
|
|
}
|
|
if (object.modeInfo != null) {
|
|
if (typeof object.modeInfo !== "object")
|
|
throw TypeError(".cosmos.tx.v1beta1.SignerInfo.modeInfo: object expected");
|
|
message.modeInfo = $root.cosmos.tx.v1beta1.ModeInfo.fromObject(object.modeInfo);
|
|
}
|
|
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 SignerInfo message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.tx.v1beta1.SignerInfo
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.SignerInfo} message SignerInfo
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
SignerInfo.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.publicKey = null;
|
|
object.modeInfo = null;
|
|
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.publicKey != null && message.hasOwnProperty("publicKey"))
|
|
object.publicKey = $root.google.protobuf.Any.toObject(message.publicKey, options);
|
|
if (message.modeInfo != null && message.hasOwnProperty("modeInfo"))
|
|
object.modeInfo = $root.cosmos.tx.v1beta1.ModeInfo.toObject(message.modeInfo, options);
|
|
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 SignerInfo to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.tx.v1beta1.SignerInfo
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
SignerInfo.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return SignerInfo;
|
|
})(v1beta1.SignerInfo || {});
|
|
|
|
v1beta1.ModeInfo = (function(ModeInfo) {
|
|
|
|
/**
|
|
* Properties of a ModeInfo.
|
|
* @memberof cosmos.tx.v1beta1
|
|
* @interface IModeInfo
|
|
* @property {cosmos.tx.v1beta1.ModeInfo.ISingle|null} [single] ModeInfo single
|
|
* @property {cosmos.tx.v1beta1.ModeInfo.IMulti|null} [multi] ModeInfo multi
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new ModeInfo.
|
|
* @memberof cosmos.tx.v1beta1
|
|
* @classdesc Represents a ModeInfo.
|
|
* @implements IModeInfo
|
|
* @constructor
|
|
* @param {cosmos.tx.v1beta1.IModeInfo=} [properties] Properties to set
|
|
*/
|
|
function ModeInfo(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* ModeInfo single.
|
|
* @member {cosmos.tx.v1beta1.ModeInfo.ISingle|null|undefined} single
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo
|
|
* @instance
|
|
*/
|
|
ModeInfo.prototype.single = null;
|
|
|
|
/**
|
|
* ModeInfo multi.
|
|
* @member {cosmos.tx.v1beta1.ModeInfo.IMulti|null|undefined} multi
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo
|
|
* @instance
|
|
*/
|
|
ModeInfo.prototype.multi = null;
|
|
|
|
// OneOf field names bound to virtual getters and setters
|
|
var $oneOfFields;
|
|
|
|
/**
|
|
* ModeInfo sum.
|
|
* @member {"single"|"multi"|undefined} sum
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo
|
|
* @instance
|
|
*/
|
|
Object.defineProperty(ModeInfo.prototype, "sum", {
|
|
get: $util.oneOfGetter($oneOfFields = ["single", "multi"]),
|
|
set: $util.oneOfSetter($oneOfFields)
|
|
});
|
|
|
|
/**
|
|
* Creates a new ModeInfo instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.IModeInfo=} [properties] Properties to set
|
|
* @returns {cosmos.tx.v1beta1.ModeInfo} ModeInfo instance
|
|
*/
|
|
ModeInfo.create = function create(properties) {
|
|
return new ModeInfo(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified ModeInfo message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.IModeInfo} message ModeInfo message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
ModeInfo.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.single != null && Object.hasOwnProperty.call(message, "single"))
|
|
$root.cosmos.tx.v1beta1.ModeInfo.Single.encode(message.single, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.multi != null && Object.hasOwnProperty.call(message, "multi"))
|
|
$root.cosmos.tx.v1beta1.ModeInfo.Multi.encode(message.multi, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified ModeInfo message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.IModeInfo} message ModeInfo message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
ModeInfo.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a ModeInfo message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.tx.v1beta1.ModeInfo} ModeInfo
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
ModeInfo.decode = 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.tx.v1beta1.ModeInfo();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.single = $root.cosmos.tx.v1beta1.ModeInfo.Single.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
message.multi = $root.cosmos.tx.v1beta1.ModeInfo.Multi.decode(reader, reader.uint32());
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a ModeInfo message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.tx.v1beta1.ModeInfo} ModeInfo
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
ModeInfo.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a ModeInfo message.
|
|
* @function verify
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
ModeInfo.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
var properties = {};
|
|
if (message.single != null && message.hasOwnProperty("single")) {
|
|
properties.sum = 1;
|
|
{
|
|
var error = $root.cosmos.tx.v1beta1.ModeInfo.Single.verify(message.single);
|
|
if (error)
|
|
return "single." + error;
|
|
}
|
|
}
|
|
if (message.multi != null && message.hasOwnProperty("multi")) {
|
|
if (properties.sum === 1)
|
|
return "sum: multiple values";
|
|
properties.sum = 1;
|
|
{
|
|
var error = $root.cosmos.tx.v1beta1.ModeInfo.Multi.verify(message.multi);
|
|
if (error)
|
|
return "multi." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a ModeInfo message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.tx.v1beta1.ModeInfo} ModeInfo
|
|
*/
|
|
ModeInfo.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.tx.v1beta1.ModeInfo)
|
|
return object;
|
|
var message = new $root.cosmos.tx.v1beta1.ModeInfo();
|
|
if (object.single != null) {
|
|
if (typeof object.single !== "object")
|
|
throw TypeError(".cosmos.tx.v1beta1.ModeInfo.single: object expected");
|
|
message.single = $root.cosmos.tx.v1beta1.ModeInfo.Single.fromObject(object.single);
|
|
}
|
|
if (object.multi != null) {
|
|
if (typeof object.multi !== "object")
|
|
throw TypeError(".cosmos.tx.v1beta1.ModeInfo.multi: object expected");
|
|
message.multi = $root.cosmos.tx.v1beta1.ModeInfo.Multi.fromObject(object.multi);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a ModeInfo message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ModeInfo} message ModeInfo
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
ModeInfo.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (message.single != null && message.hasOwnProperty("single")) {
|
|
object.single = $root.cosmos.tx.v1beta1.ModeInfo.Single.toObject(message.single, options);
|
|
if (options.oneofs)
|
|
object.sum = "single";
|
|
}
|
|
if (message.multi != null && message.hasOwnProperty("multi")) {
|
|
object.multi = $root.cosmos.tx.v1beta1.ModeInfo.Multi.toObject(message.multi, options);
|
|
if (options.oneofs)
|
|
object.sum = "multi";
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this ModeInfo to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
ModeInfo.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
ModeInfo.Single = (function(Single) {
|
|
|
|
/**
|
|
* Properties of a Single.
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo
|
|
* @interface ISingle
|
|
* @property {cosmos.tx.signing.v1beta1.SignMode|null} [mode] Single mode
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Single.
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo
|
|
* @classdesc Represents a Single.
|
|
* @implements ISingle
|
|
* @constructor
|
|
* @param {cosmos.tx.v1beta1.ModeInfo.ISingle=} [properties] Properties to set
|
|
*/
|
|
function Single(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Single mode.
|
|
* @member {cosmos.tx.signing.v1beta1.SignMode} mode
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Single
|
|
* @instance
|
|
*/
|
|
Single.prototype.mode = 0;
|
|
|
|
/**
|
|
* Creates a new Single instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Single
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ModeInfo.ISingle=} [properties] Properties to set
|
|
* @returns {cosmos.tx.v1beta1.ModeInfo.Single} Single instance
|
|
*/
|
|
Single.create = function create(properties) {
|
|
return new Single(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Single message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Single.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Single
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ModeInfo.ISingle} message Single message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Single.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.mode != null && Object.hasOwnProperty.call(message, "mode"))
|
|
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mode);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Single message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Single.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Single
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ModeInfo.ISingle} message Single message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Single.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a Single message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Single
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.tx.v1beta1.ModeInfo.Single} Single
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Single.decode = 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.tx.v1beta1.ModeInfo.Single();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.mode = reader.int32();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a Single message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Single
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.tx.v1beta1.ModeInfo.Single} Single
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Single.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a Single message.
|
|
* @function verify
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Single
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
Single.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.mode != null && message.hasOwnProperty("mode"))
|
|
switch (message.mode) {
|
|
default:
|
|
return "mode: enum value expected";
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
case 127:
|
|
break;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a Single message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Single
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.tx.v1beta1.ModeInfo.Single} Single
|
|
*/
|
|
Single.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.tx.v1beta1.ModeInfo.Single)
|
|
return object;
|
|
var message = new $root.cosmos.tx.v1beta1.ModeInfo.Single();
|
|
switch (object.mode) {
|
|
case "SIGN_MODE_UNSPECIFIED":
|
|
case 0:
|
|
message.mode = 0;
|
|
break;
|
|
case "SIGN_MODE_DIRECT":
|
|
case 1:
|
|
message.mode = 1;
|
|
break;
|
|
case "SIGN_MODE_TEXTUAL":
|
|
case 2:
|
|
message.mode = 2;
|
|
break;
|
|
case "SIGN_MODE_LEGACY_AMINO_JSON":
|
|
case 127:
|
|
message.mode = 127;
|
|
break;
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a Single message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Single
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ModeInfo.Single} message Single
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Single.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults)
|
|
object.mode = options.enums === String ? "SIGN_MODE_UNSPECIFIED" : 0;
|
|
if (message.mode != null && message.hasOwnProperty("mode"))
|
|
object.mode = options.enums === String ? $root.cosmos.tx.signing.v1beta1.SignMode[message.mode] : message.mode;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Single to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Single
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Single.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Single;
|
|
})(ModeInfo.Single || {});
|
|
|
|
ModeInfo.Multi = (function(Multi) {
|
|
|
|
/**
|
|
* Properties of a Multi.
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo
|
|
* @interface IMulti
|
|
* @property {cosmos.crypto.multisig.v1beta1.ICompactBitArray|null} [bitarray] Multi bitarray
|
|
* @property {Array.<cosmos.tx.v1beta1.IModeInfo>|null} [modeInfos] Multi modeInfos
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Multi.
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo
|
|
* @classdesc Represents a Multi.
|
|
* @implements IMulti
|
|
* @constructor
|
|
* @param {cosmos.tx.v1beta1.ModeInfo.IMulti=} [properties] Properties to set
|
|
*/
|
|
function Multi(properties) {
|
|
this.modeInfos = [];
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Multi bitarray.
|
|
* @member {cosmos.crypto.multisig.v1beta1.ICompactBitArray|null|undefined} bitarray
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Multi
|
|
* @instance
|
|
*/
|
|
Multi.prototype.bitarray = null;
|
|
|
|
/**
|
|
* Multi modeInfos.
|
|
* @member {Array.<cosmos.tx.v1beta1.IModeInfo>} modeInfos
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Multi
|
|
* @instance
|
|
*/
|
|
Multi.prototype.modeInfos = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new Multi instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Multi
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ModeInfo.IMulti=} [properties] Properties to set
|
|
* @returns {cosmos.tx.v1beta1.ModeInfo.Multi} Multi instance
|
|
*/
|
|
Multi.create = function create(properties) {
|
|
return new Multi(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Multi message. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Multi.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Multi
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ModeInfo.IMulti} message Multi message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Multi.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.bitarray != null && Object.hasOwnProperty.call(message, "bitarray"))
|
|
$root.cosmos.crypto.multisig.v1beta1.CompactBitArray.encode(message.bitarray, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.modeInfos != null && message.modeInfos.length)
|
|
for (var i = 0; i < message.modeInfos.length; ++i)
|
|
$root.cosmos.tx.v1beta1.ModeInfo.encode(message.modeInfos[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Multi message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.ModeInfo.Multi.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Multi
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ModeInfo.IMulti} message Multi message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
Multi.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a Multi message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Multi
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.tx.v1beta1.ModeInfo.Multi} Multi
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Multi.decode = 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.tx.v1beta1.ModeInfo.Multi();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
if (!(message.modeInfos && message.modeInfos.length))
|
|
message.modeInfos = [];
|
|
message.modeInfos.push($root.cosmos.tx.v1beta1.ModeInfo.decode(reader, reader.uint32()));
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a Multi message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Multi
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.tx.v1beta1.ModeInfo.Multi} Multi
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
Multi.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a Multi message.
|
|
* @function verify
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Multi
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
Multi.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.bitarray != null && message.hasOwnProperty("bitarray")) {
|
|
var error = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.verify(message.bitarray);
|
|
if (error)
|
|
return "bitarray." + error;
|
|
}
|
|
if (message.modeInfos != null && message.hasOwnProperty("modeInfos")) {
|
|
if (!Array.isArray(message.modeInfos))
|
|
return "modeInfos: array expected";
|
|
for (var i = 0; i < message.modeInfos.length; ++i) {
|
|
var error = $root.cosmos.tx.v1beta1.ModeInfo.verify(message.modeInfos[i]);
|
|
if (error)
|
|
return "modeInfos." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a Multi message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Multi
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.tx.v1beta1.ModeInfo.Multi} Multi
|
|
*/
|
|
Multi.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.tx.v1beta1.ModeInfo.Multi)
|
|
return object;
|
|
var message = new $root.cosmos.tx.v1beta1.ModeInfo.Multi();
|
|
if (object.bitarray != null) {
|
|
if (typeof object.bitarray !== "object")
|
|
throw TypeError(".cosmos.tx.v1beta1.ModeInfo.Multi.bitarray: object expected");
|
|
message.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.fromObject(object.bitarray);
|
|
}
|
|
if (object.modeInfos) {
|
|
if (!Array.isArray(object.modeInfos))
|
|
throw TypeError(".cosmos.tx.v1beta1.ModeInfo.Multi.modeInfos: array expected");
|
|
message.modeInfos = [];
|
|
for (var i = 0; i < object.modeInfos.length; ++i) {
|
|
if (typeof object.modeInfos[i] !== "object")
|
|
throw TypeError(".cosmos.tx.v1beta1.ModeInfo.Multi.modeInfos: object expected");
|
|
message.modeInfos[i] = $root.cosmos.tx.v1beta1.ModeInfo.fromObject(object.modeInfos[i]);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a Multi message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Multi
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.ModeInfo.Multi} message Multi
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Multi.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.modeInfos = [];
|
|
if (options.defaults)
|
|
object.bitarray = null;
|
|
if (message.bitarray != null && message.hasOwnProperty("bitarray"))
|
|
object.bitarray = $root.cosmos.crypto.multisig.v1beta1.CompactBitArray.toObject(message.bitarray, options);
|
|
if (message.modeInfos && message.modeInfos.length) {
|
|
object.modeInfos = [];
|
|
for (var j = 0; j < message.modeInfos.length; ++j)
|
|
object.modeInfos[j] = $root.cosmos.tx.v1beta1.ModeInfo.toObject(message.modeInfos[j], options);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Multi to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.tx.v1beta1.ModeInfo.Multi
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Multi.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Multi;
|
|
})(ModeInfo.Multi || {});
|
|
|
|
return ModeInfo;
|
|
})(v1beta1.ModeInfo || {});
|
|
|
|
v1beta1.Fee = (function(Fee) {
|
|
|
|
/**
|
|
* Properties of a Fee.
|
|
* @memberof cosmos.tx.v1beta1
|
|
* @interface IFee
|
|
* @property {Array.<cosmos.base.v1beta1.ICoin>|null} [amount] Fee amount
|
|
* @property {number|Long|null} [gasLimit] Fee gasLimit
|
|
* @property {string|null} [payer] Fee payer
|
|
* @property {string|null} [granter] Fee granter
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Fee.
|
|
* @memberof cosmos.tx.v1beta1
|
|
* @classdesc Represents a Fee.
|
|
* @implements IFee
|
|
* @constructor
|
|
* @param {cosmos.tx.v1beta1.IFee=} [properties] Properties to set
|
|
*/
|
|
function Fee(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]];
|
|
}
|
|
|
|
/**
|
|
* Fee amount.
|
|
* @member {Array.<cosmos.base.v1beta1.ICoin>} amount
|
|
* @memberof cosmos.tx.v1beta1.Fee
|
|
* @instance
|
|
*/
|
|
Fee.prototype.amount = $util.emptyArray;
|
|
|
|
/**
|
|
* Fee gasLimit.
|
|
* @member {number|Long} gasLimit
|
|
* @memberof cosmos.tx.v1beta1.Fee
|
|
* @instance
|
|
*/
|
|
Fee.prototype.gasLimit = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* Fee payer.
|
|
* @member {string} payer
|
|
* @memberof cosmos.tx.v1beta1.Fee
|
|
* @instance
|
|
*/
|
|
Fee.prototype.payer = "";
|
|
|
|
/**
|
|
* Fee granter.
|
|
* @member {string} granter
|
|
* @memberof cosmos.tx.v1beta1.Fee
|
|
* @instance
|
|
*/
|
|
Fee.prototype.granter = "";
|
|
|
|
/**
|
|
* Creates a new Fee instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.tx.v1beta1.Fee
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.IFee=} [properties] Properties to set
|
|
* @returns {cosmos.tx.v1beta1.Fee} Fee instance
|
|
*/
|
|
Fee.create = function create(properties) {
|
|
return new Fee(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Fee message. Does not implicitly {@link cosmos.tx.v1beta1.Fee.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.tx.v1beta1.Fee
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.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.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 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.gasLimit != null && Object.hasOwnProperty.call(message, "gasLimit"))
|
|
writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.gasLimit);
|
|
if (message.payer != null && Object.hasOwnProperty.call(message, "payer"))
|
|
writer.uint32(/* id 3, wireType 2 =*/26).string(message.payer);
|
|
if (message.granter != null && Object.hasOwnProperty.call(message, "granter"))
|
|
writer.uint32(/* id 4, wireType 2 =*/34).string(message.granter);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Fee message, length delimited. Does not implicitly {@link cosmos.tx.v1beta1.Fee.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.tx.v1beta1.Fee
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.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 cosmos.tx.v1beta1.Fee
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.tx.v1beta1.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.cosmos.tx.v1beta1.Fee();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
if (!(message.amount && message.amount.length))
|
|
message.amount = [];
|
|
message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()));
|
|
break;
|
|
case 2:
|
|
message.gasLimit = reader.uint64();
|
|
break;
|
|
case 3:
|
|
message.payer = reader.string();
|
|
break;
|
|
case 4:
|
|
message.granter = reader.string();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a Fee message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.tx.v1beta1.Fee
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.tx.v1beta1.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 cosmos.tx.v1beta1.Fee
|
|
* @static
|
|
* @param {Object.<string,*>} 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.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;
|
|
}
|
|
}
|
|
if (message.gasLimit != null && message.hasOwnProperty("gasLimit"))
|
|
if (!$util.isInteger(message.gasLimit) && !(message.gasLimit && $util.isInteger(message.gasLimit.low) && $util.isInteger(message.gasLimit.high)))
|
|
return "gasLimit: integer|Long expected";
|
|
if (message.payer != null && message.hasOwnProperty("payer"))
|
|
if (!$util.isString(message.payer))
|
|
return "payer: string expected";
|
|
if (message.granter != null && message.hasOwnProperty("granter"))
|
|
if (!$util.isString(message.granter))
|
|
return "granter: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a Fee message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.tx.v1beta1.Fee
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.tx.v1beta1.Fee} Fee
|
|
*/
|
|
Fee.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.tx.v1beta1.Fee)
|
|
return object;
|
|
var message = new $root.cosmos.tx.v1beta1.Fee();
|
|
if (object.amount) {
|
|
if (!Array.isArray(object.amount))
|
|
throw TypeError(".cosmos.tx.v1beta1.Fee.amount: array expected");
|
|
message.amount = [];
|
|
for (var i = 0; i < object.amount.length; ++i) {
|
|
if (typeof object.amount[i] !== "object")
|
|
throw TypeError(".cosmos.tx.v1beta1.Fee.amount: object expected");
|
|
message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]);
|
|
}
|
|
}
|
|
if (object.gasLimit != null)
|
|
if ($util.Long)
|
|
(message.gasLimit = $util.Long.fromValue(object.gasLimit)).unsigned = true;
|
|
else if (typeof object.gasLimit === "string")
|
|
message.gasLimit = parseInt(object.gasLimit, 10);
|
|
else if (typeof object.gasLimit === "number")
|
|
message.gasLimit = object.gasLimit;
|
|
else if (typeof object.gasLimit === "object")
|
|
message.gasLimit = new $util.LongBits(object.gasLimit.low >>> 0, object.gasLimit.high >>> 0).toNumber(true);
|
|
if (object.payer != null)
|
|
message.payer = String(object.payer);
|
|
if (object.granter != null)
|
|
message.granter = String(object.granter);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a Fee message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.tx.v1beta1.Fee
|
|
* @static
|
|
* @param {cosmos.tx.v1beta1.Fee} message Fee
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Fee.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.gasLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.gasLimit = options.longs === String ? "0" : 0;
|
|
object.payer = "";
|
|
object.granter = "";
|
|
}
|
|
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);
|
|
}
|
|
if (message.gasLimit != null && message.hasOwnProperty("gasLimit"))
|
|
if (typeof message.gasLimit === "number")
|
|
object.gasLimit = options.longs === String ? String(message.gasLimit) : message.gasLimit;
|
|
else
|
|
object.gasLimit = options.longs === String ? $util.Long.prototype.toString.call(message.gasLimit) : options.longs === Number ? new $util.LongBits(message.gasLimit.low >>> 0, message.gasLimit.high >>> 0).toNumber(true) : message.gasLimit;
|
|
if (message.payer != null && message.hasOwnProperty("payer"))
|
|
object.payer = message.payer;
|
|
if (message.granter != null && message.hasOwnProperty("granter"))
|
|
object.granter = message.granter;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Fee to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.tx.v1beta1.Fee
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Fee.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Fee;
|
|
})(v1beta1.Fee || {});
|
|
|
|
return v1beta1;
|
|
})(tx.v1beta1 || {});
|
|
|
|
return tx;
|
|
})(cosmos.tx || {});
|
|
|
|
/**
|
|
* Namespace crisis.
|
|
* @memberof cosmos
|
|
* @namespace
|
|
*/
|
|
|
|
cosmos.crisis = (function(crisis) {
|
|
|
|
/**
|
|
* Namespace v1beta1.
|
|
* @memberof cosmos.crisis
|
|
* @namespace
|
|
*/
|
|
|
|
crisis.v1beta1 = (function(v1beta1) {
|
|
|
|
v1beta1.Msg = (function(Msg) {
|
|
|
|
/**
|
|
* Constructs a new Msg service.
|
|
* @memberof cosmos.crisis.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;
|
|
|
|
/**
|
|
* Creates new Msg service using the specified rpc implementation.
|
|
* @function create
|
|
* @memberof cosmos.crisis.v1beta1.Msg
|
|
* @static
|
|
* @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
|
* @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
|
* @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
|
* @returns {Msg} RPC service. Useful where requests and/or responses are streamed.
|
|
*/
|
|
Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
|
return new this(rpcImpl, requestDelimited, responseDelimited);
|
|
};
|
|
|
|
/**
|
|
* Callback as used by {@link cosmos.crisis.v1beta1.Msg#verifyInvariant}.
|
|
* @memberof cosmos.crisis.v1beta1.Msg
|
|
* @typedef VerifyInvariantCallback
|
|
* @type {function}
|
|
* @param {Error|null} error Error, if any
|
|
* @param {cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse} [response] MsgVerifyInvariantResponse
|
|
*/
|
|
|
|
/**
|
|
* Calls VerifyInvariant.
|
|
* @function verifyInvariant
|
|
* @memberof cosmos.crisis.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant} request MsgVerifyInvariant message or plain object
|
|
* @param {cosmos.crisis.v1beta1.Msg.VerifyInvariantCallback} callback Node-style callback called with the error, if any, and MsgVerifyInvariantResponse
|
|
* @returns {undefined}
|
|
* @variation 1
|
|
*/
|
|
Object.defineProperty(Msg.prototype.verifyInvariant = function verifyInvariant(request, callback) {
|
|
return this.rpcCall(verifyInvariant, $root.cosmos.crisis.v1beta1.MsgVerifyInvariant, $root.cosmos.crisis.v1beta1.MsgVerifyInvariantResponse, request, callback);
|
|
}, "name", { value: "VerifyInvariant" });
|
|
|
|
/**
|
|
* Calls VerifyInvariant.
|
|
* @function verifyInvariant
|
|
* @memberof cosmos.crisis.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant} request MsgVerifyInvariant message or plain object
|
|
* @returns {Promise<cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
return Msg;
|
|
})(v1beta1.Msg || {});
|
|
|
|
v1beta1.MsgVerifyInvariant = (function(MsgVerifyInvariant) {
|
|
|
|
/**
|
|
* Properties of a MsgVerifyInvariant.
|
|
* @memberof cosmos.crisis.v1beta1
|
|
* @interface IMsgVerifyInvariant
|
|
* @property {string|null} [sender] MsgVerifyInvariant sender
|
|
* @property {string|null} [invariantModuleName] MsgVerifyInvariant invariantModuleName
|
|
* @property {string|null} [invariantRoute] MsgVerifyInvariant invariantRoute
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgVerifyInvariant.
|
|
* @memberof cosmos.crisis.v1beta1
|
|
* @classdesc Represents a MsgVerifyInvariant.
|
|
* @implements IMsgVerifyInvariant
|
|
* @constructor
|
|
* @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant=} [properties] Properties to set
|
|
*/
|
|
function MsgVerifyInvariant(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* MsgVerifyInvariant sender.
|
|
* @member {string} sender
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant
|
|
* @instance
|
|
*/
|
|
MsgVerifyInvariant.prototype.sender = "";
|
|
|
|
/**
|
|
* MsgVerifyInvariant invariantModuleName.
|
|
* @member {string} invariantModuleName
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant
|
|
* @instance
|
|
*/
|
|
MsgVerifyInvariant.prototype.invariantModuleName = "";
|
|
|
|
/**
|
|
* MsgVerifyInvariant invariantRoute.
|
|
* @member {string} invariantRoute
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant
|
|
* @instance
|
|
*/
|
|
MsgVerifyInvariant.prototype.invariantRoute = "";
|
|
|
|
/**
|
|
* Creates a new MsgVerifyInvariant instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant
|
|
* @static
|
|
* @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant=} [properties] Properties to set
|
|
* @returns {cosmos.crisis.v1beta1.MsgVerifyInvariant} MsgVerifyInvariant instance
|
|
*/
|
|
MsgVerifyInvariant.create = function create(properties) {
|
|
return new MsgVerifyInvariant(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgVerifyInvariant message. Does not implicitly {@link cosmos.crisis.v1beta1.MsgVerifyInvariant.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant
|
|
* @static
|
|
* @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant} message MsgVerifyInvariant message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgVerifyInvariant.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.invariantModuleName != null && Object.hasOwnProperty.call(message, "invariantModuleName"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.invariantModuleName);
|
|
if (message.invariantRoute != null && Object.hasOwnProperty.call(message, "invariantRoute"))
|
|
writer.uint32(/* id 3, wireType 2 =*/26).string(message.invariantRoute);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgVerifyInvariant message, length delimited. Does not implicitly {@link cosmos.crisis.v1beta1.MsgVerifyInvariant.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant
|
|
* @static
|
|
* @param {cosmos.crisis.v1beta1.IMsgVerifyInvariant} message MsgVerifyInvariant message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgVerifyInvariant.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgVerifyInvariant message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.crisis.v1beta1.MsgVerifyInvariant} MsgVerifyInvariant
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgVerifyInvariant.decode = 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.crisis.v1beta1.MsgVerifyInvariant();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.sender = reader.string();
|
|
break;
|
|
case 2:
|
|
message.invariantModuleName = reader.string();
|
|
break;
|
|
case 3:
|
|
message.invariantRoute = reader.string();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgVerifyInvariant message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.crisis.v1beta1.MsgVerifyInvariant} MsgVerifyInvariant
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgVerifyInvariant.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgVerifyInvariant message.
|
|
* @function verify
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgVerifyInvariant.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.invariantModuleName != null && message.hasOwnProperty("invariantModuleName"))
|
|
if (!$util.isString(message.invariantModuleName))
|
|
return "invariantModuleName: string expected";
|
|
if (message.invariantRoute != null && message.hasOwnProperty("invariantRoute"))
|
|
if (!$util.isString(message.invariantRoute))
|
|
return "invariantRoute: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgVerifyInvariant message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.crisis.v1beta1.MsgVerifyInvariant} MsgVerifyInvariant
|
|
*/
|
|
MsgVerifyInvariant.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.crisis.v1beta1.MsgVerifyInvariant)
|
|
return object;
|
|
var message = new $root.cosmos.crisis.v1beta1.MsgVerifyInvariant();
|
|
if (object.sender != null)
|
|
message.sender = String(object.sender);
|
|
if (object.invariantModuleName != null)
|
|
message.invariantModuleName = String(object.invariantModuleName);
|
|
if (object.invariantRoute != null)
|
|
message.invariantRoute = String(object.invariantRoute);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgVerifyInvariant message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant
|
|
* @static
|
|
* @param {cosmos.crisis.v1beta1.MsgVerifyInvariant} message MsgVerifyInvariant
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgVerifyInvariant.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.sender = "";
|
|
object.invariantModuleName = "";
|
|
object.invariantRoute = "";
|
|
}
|
|
if (message.sender != null && message.hasOwnProperty("sender"))
|
|
object.sender = message.sender;
|
|
if (message.invariantModuleName != null && message.hasOwnProperty("invariantModuleName"))
|
|
object.invariantModuleName = message.invariantModuleName;
|
|
if (message.invariantRoute != null && message.hasOwnProperty("invariantRoute"))
|
|
object.invariantRoute = message.invariantRoute;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgVerifyInvariant to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariant
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgVerifyInvariant.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgVerifyInvariant;
|
|
})(v1beta1.MsgVerifyInvariant || {});
|
|
|
|
v1beta1.MsgVerifyInvariantResponse = (function(MsgVerifyInvariantResponse) {
|
|
|
|
/**
|
|
* Properties of a MsgVerifyInvariantResponse.
|
|
* @memberof cosmos.crisis.v1beta1
|
|
* @interface IMsgVerifyInvariantResponse
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgVerifyInvariantResponse.
|
|
* @memberof cosmos.crisis.v1beta1
|
|
* @classdesc Represents a MsgVerifyInvariantResponse.
|
|
* @implements IMsgVerifyInvariantResponse
|
|
* @constructor
|
|
* @param {cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse=} [properties] Properties to set
|
|
*/
|
|
function MsgVerifyInvariantResponse(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new MsgVerifyInvariantResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse
|
|
* @static
|
|
* @param {cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse=} [properties] Properties to set
|
|
* @returns {cosmos.crisis.v1beta1.MsgVerifyInvariantResponse} MsgVerifyInvariantResponse instance
|
|
*/
|
|
MsgVerifyInvariantResponse.create = function create(properties) {
|
|
return new MsgVerifyInvariantResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgVerifyInvariantResponse message. Does not implicitly {@link cosmos.crisis.v1beta1.MsgVerifyInvariantResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse
|
|
* @static
|
|
* @param {cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse} message MsgVerifyInvariantResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgVerifyInvariantResponse.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgVerifyInvariantResponse message, length delimited. Does not implicitly {@link cosmos.crisis.v1beta1.MsgVerifyInvariantResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse
|
|
* @static
|
|
* @param {cosmos.crisis.v1beta1.IMsgVerifyInvariantResponse} message MsgVerifyInvariantResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgVerifyInvariantResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgVerifyInvariantResponse message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.crisis.v1beta1.MsgVerifyInvariantResponse} MsgVerifyInvariantResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgVerifyInvariantResponse.decode = 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.crisis.v1beta1.MsgVerifyInvariantResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgVerifyInvariantResponse message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.crisis.v1beta1.MsgVerifyInvariantResponse} MsgVerifyInvariantResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgVerifyInvariantResponse.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgVerifyInvariantResponse message.
|
|
* @function verify
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgVerifyInvariantResponse.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgVerifyInvariantResponse message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.crisis.v1beta1.MsgVerifyInvariantResponse} MsgVerifyInvariantResponse
|
|
*/
|
|
MsgVerifyInvariantResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.crisis.v1beta1.MsgVerifyInvariantResponse)
|
|
return object;
|
|
return new $root.cosmos.crisis.v1beta1.MsgVerifyInvariantResponse();
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgVerifyInvariantResponse message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse
|
|
* @static
|
|
* @param {cosmos.crisis.v1beta1.MsgVerifyInvariantResponse} message MsgVerifyInvariantResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgVerifyInvariantResponse.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgVerifyInvariantResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.crisis.v1beta1.MsgVerifyInvariantResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgVerifyInvariantResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgVerifyInvariantResponse;
|
|
})(v1beta1.MsgVerifyInvariantResponse || {});
|
|
|
|
return v1beta1;
|
|
})(crisis.v1beta1 || {});
|
|
|
|
return crisis;
|
|
})(cosmos.crisis || {});
|
|
|
|
/**
|
|
* Namespace distribution.
|
|
* @memberof cosmos
|
|
* @namespace
|
|
*/
|
|
|
|
cosmos.distribution = (function(distribution) {
|
|
|
|
/**
|
|
* Namespace v1beta1.
|
|
* @memberof cosmos.distribution
|
|
* @namespace
|
|
*/
|
|
|
|
distribution.v1beta1 = (function(v1beta1) {
|
|
|
|
v1beta1.Msg = (function(Msg) {
|
|
|
|
/**
|
|
* Constructs a new Msg service.
|
|
* @memberof cosmos.distribution.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;
|
|
|
|
/**
|
|
* Creates new Msg service using the specified rpc implementation.
|
|
* @function create
|
|
* @memberof cosmos.distribution.v1beta1.Msg
|
|
* @static
|
|
* @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
|
* @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
|
* @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
|
* @returns {Msg} RPC service. Useful where requests and/or responses are streamed.
|
|
*/
|
|
Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
|
return new this(rpcImpl, requestDelimited, responseDelimited);
|
|
};
|
|
|
|
/**
|
|
* Callback as used by {@link cosmos.distribution.v1beta1.Msg#setWithdrawAddress}.
|
|
* @memberof cosmos.distribution.v1beta1.Msg
|
|
* @typedef SetWithdrawAddressCallback
|
|
* @type {function}
|
|
* @param {Error|null} error Error, if any
|
|
* @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse} [response] MsgSetWithdrawAddressResponse
|
|
*/
|
|
|
|
/**
|
|
* Calls SetWithdrawAddress.
|
|
* @function setWithdrawAddress
|
|
* @memberof cosmos.distribution.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress} request MsgSetWithdrawAddress message or plain object
|
|
* @param {cosmos.distribution.v1beta1.Msg.SetWithdrawAddressCallback} callback Node-style callback called with the error, if any, and MsgSetWithdrawAddressResponse
|
|
* @returns {undefined}
|
|
* @variation 1
|
|
*/
|
|
Object.defineProperty(Msg.prototype.setWithdrawAddress = function setWithdrawAddress(request, callback) {
|
|
return this.rpcCall(setWithdrawAddress, $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddress, $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse, request, callback);
|
|
}, "name", { value: "SetWithdrawAddress" });
|
|
|
|
/**
|
|
* Calls SetWithdrawAddress.
|
|
* @function setWithdrawAddress
|
|
* @memberof cosmos.distribution.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress} request MsgSetWithdrawAddress message or plain object
|
|
* @returns {Promise<cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
/**
|
|
* Callback as used by {@link cosmos.distribution.v1beta1.Msg#withdrawDelegatorReward}.
|
|
* @memberof cosmos.distribution.v1beta1.Msg
|
|
* @typedef WithdrawDelegatorRewardCallback
|
|
* @type {function}
|
|
* @param {Error|null} error Error, if any
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse} [response] MsgWithdrawDelegatorRewardResponse
|
|
*/
|
|
|
|
/**
|
|
* Calls WithdrawDelegatorReward.
|
|
* @function withdrawDelegatorReward
|
|
* @memberof cosmos.distribution.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward} request MsgWithdrawDelegatorReward message or plain object
|
|
* @param {cosmos.distribution.v1beta1.Msg.WithdrawDelegatorRewardCallback} callback Node-style callback called with the error, if any, and MsgWithdrawDelegatorRewardResponse
|
|
* @returns {undefined}
|
|
* @variation 1
|
|
*/
|
|
Object.defineProperty(Msg.prototype.withdrawDelegatorReward = function withdrawDelegatorReward(request, callback) {
|
|
return this.rpcCall(withdrawDelegatorReward, $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward, $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse, request, callback);
|
|
}, "name", { value: "WithdrawDelegatorReward" });
|
|
|
|
/**
|
|
* Calls WithdrawDelegatorReward.
|
|
* @function withdrawDelegatorReward
|
|
* @memberof cosmos.distribution.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward} request MsgWithdrawDelegatorReward message or plain object
|
|
* @returns {Promise<cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
/**
|
|
* Callback as used by {@link cosmos.distribution.v1beta1.Msg#withdrawValidatorCommission}.
|
|
* @memberof cosmos.distribution.v1beta1.Msg
|
|
* @typedef WithdrawValidatorCommissionCallback
|
|
* @type {function}
|
|
* @param {Error|null} error Error, if any
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse} [response] MsgWithdrawValidatorCommissionResponse
|
|
*/
|
|
|
|
/**
|
|
* Calls WithdrawValidatorCommission.
|
|
* @function withdrawValidatorCommission
|
|
* @memberof cosmos.distribution.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission} request MsgWithdrawValidatorCommission message or plain object
|
|
* @param {cosmos.distribution.v1beta1.Msg.WithdrawValidatorCommissionCallback} callback Node-style callback called with the error, if any, and MsgWithdrawValidatorCommissionResponse
|
|
* @returns {undefined}
|
|
* @variation 1
|
|
*/
|
|
Object.defineProperty(Msg.prototype.withdrawValidatorCommission = function withdrawValidatorCommission(request, callback) {
|
|
return this.rpcCall(withdrawValidatorCommission, $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission, $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse, request, callback);
|
|
}, "name", { value: "WithdrawValidatorCommission" });
|
|
|
|
/**
|
|
* Calls WithdrawValidatorCommission.
|
|
* @function withdrawValidatorCommission
|
|
* @memberof cosmos.distribution.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission} request MsgWithdrawValidatorCommission message or plain object
|
|
* @returns {Promise<cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
/**
|
|
* Callback as used by {@link cosmos.distribution.v1beta1.Msg#fundCommunityPool}.
|
|
* @memberof cosmos.distribution.v1beta1.Msg
|
|
* @typedef FundCommunityPoolCallback
|
|
* @type {function}
|
|
* @param {Error|null} error Error, if any
|
|
* @param {cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse} [response] MsgFundCommunityPoolResponse
|
|
*/
|
|
|
|
/**
|
|
* Calls FundCommunityPool.
|
|
* @function fundCommunityPool
|
|
* @memberof cosmos.distribution.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool} request MsgFundCommunityPool message or plain object
|
|
* @param {cosmos.distribution.v1beta1.Msg.FundCommunityPoolCallback} callback Node-style callback called with the error, if any, and MsgFundCommunityPoolResponse
|
|
* @returns {undefined}
|
|
* @variation 1
|
|
*/
|
|
Object.defineProperty(Msg.prototype.fundCommunityPool = function fundCommunityPool(request, callback) {
|
|
return this.rpcCall(fundCommunityPool, $root.cosmos.distribution.v1beta1.MsgFundCommunityPool, $root.cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse, request, callback);
|
|
}, "name", { value: "FundCommunityPool" });
|
|
|
|
/**
|
|
* Calls FundCommunityPool.
|
|
* @function fundCommunityPool
|
|
* @memberof cosmos.distribution.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool} request MsgFundCommunityPool message or plain object
|
|
* @returns {Promise<cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
return Msg;
|
|
})(v1beta1.Msg || {});
|
|
|
|
v1beta1.MsgSetWithdrawAddress = (function(MsgSetWithdrawAddress) {
|
|
|
|
/**
|
|
* Properties of a MsgSetWithdrawAddress.
|
|
* @memberof cosmos.distribution.v1beta1
|
|
* @interface IMsgSetWithdrawAddress
|
|
* @property {string|null} [delegatorAddress] MsgSetWithdrawAddress delegatorAddress
|
|
* @property {string|null} [withdrawAddress] MsgSetWithdrawAddress withdrawAddress
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgSetWithdrawAddress.
|
|
* @memberof cosmos.distribution.v1beta1
|
|
* @classdesc Represents a MsgSetWithdrawAddress.
|
|
* @implements IMsgSetWithdrawAddress
|
|
* @constructor
|
|
* @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress=} [properties] Properties to set
|
|
*/
|
|
function MsgSetWithdrawAddress(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* MsgSetWithdrawAddress delegatorAddress.
|
|
* @member {string} delegatorAddress
|
|
* @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress
|
|
* @instance
|
|
*/
|
|
MsgSetWithdrawAddress.prototype.delegatorAddress = "";
|
|
|
|
/**
|
|
* MsgSetWithdrawAddress withdrawAddress.
|
|
* @member {string} withdrawAddress
|
|
* @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress
|
|
* @instance
|
|
*/
|
|
MsgSetWithdrawAddress.prototype.withdrawAddress = "";
|
|
|
|
/**
|
|
* Creates a new MsgSetWithdrawAddress instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress=} [properties] Properties to set
|
|
* @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddress} MsgSetWithdrawAddress instance
|
|
*/
|
|
MsgSetWithdrawAddress.create = function create(properties) {
|
|
return new MsgSetWithdrawAddress(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgSetWithdrawAddress message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgSetWithdrawAddress.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress} message MsgSetWithdrawAddress message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgSetWithdrawAddress.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress);
|
|
if (message.withdrawAddress != null && Object.hasOwnProperty.call(message, "withdrawAddress"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.withdrawAddress);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgSetWithdrawAddress message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgSetWithdrawAddress.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddress} message MsgSetWithdrawAddress message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgSetWithdrawAddress.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgSetWithdrawAddress message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddress} MsgSetWithdrawAddress
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgSetWithdrawAddress.decode = 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.distribution.v1beta1.MsgSetWithdrawAddress();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.delegatorAddress = reader.string();
|
|
break;
|
|
case 2:
|
|
message.withdrawAddress = reader.string();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgSetWithdrawAddress message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddress} MsgSetWithdrawAddress
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgSetWithdrawAddress.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgSetWithdrawAddress message.
|
|
* @function verify
|
|
* @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgSetWithdrawAddress.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
if (!$util.isString(message.delegatorAddress))
|
|
return "delegatorAddress: string expected";
|
|
if (message.withdrawAddress != null && message.hasOwnProperty("withdrawAddress"))
|
|
if (!$util.isString(message.withdrawAddress))
|
|
return "withdrawAddress: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgSetWithdrawAddress message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddress} MsgSetWithdrawAddress
|
|
*/
|
|
MsgSetWithdrawAddress.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddress)
|
|
return object;
|
|
var message = new $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddress();
|
|
if (object.delegatorAddress != null)
|
|
message.delegatorAddress = String(object.delegatorAddress);
|
|
if (object.withdrawAddress != null)
|
|
message.withdrawAddress = String(object.withdrawAddress);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgSetWithdrawAddress message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.MsgSetWithdrawAddress} message MsgSetWithdrawAddress
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgSetWithdrawAddress.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.delegatorAddress = "";
|
|
object.withdrawAddress = "";
|
|
}
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
object.delegatorAddress = message.delegatorAddress;
|
|
if (message.withdrawAddress != null && message.hasOwnProperty("withdrawAddress"))
|
|
object.withdrawAddress = message.withdrawAddress;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgSetWithdrawAddress to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddress
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgSetWithdrawAddress.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgSetWithdrawAddress;
|
|
})(v1beta1.MsgSetWithdrawAddress || {});
|
|
|
|
v1beta1.MsgSetWithdrawAddressResponse = (function(MsgSetWithdrawAddressResponse) {
|
|
|
|
/**
|
|
* Properties of a MsgSetWithdrawAddressResponse.
|
|
* @memberof cosmos.distribution.v1beta1
|
|
* @interface IMsgSetWithdrawAddressResponse
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgSetWithdrawAddressResponse.
|
|
* @memberof cosmos.distribution.v1beta1
|
|
* @classdesc Represents a MsgSetWithdrawAddressResponse.
|
|
* @implements IMsgSetWithdrawAddressResponse
|
|
* @constructor
|
|
* @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse=} [properties] Properties to set
|
|
*/
|
|
function MsgSetWithdrawAddressResponse(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new MsgSetWithdrawAddressResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse=} [properties] Properties to set
|
|
* @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse} MsgSetWithdrawAddressResponse instance
|
|
*/
|
|
MsgSetWithdrawAddressResponse.create = function create(properties) {
|
|
return new MsgSetWithdrawAddressResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgSetWithdrawAddressResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse} message MsgSetWithdrawAddressResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgSetWithdrawAddressResponse.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgSetWithdrawAddressResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgSetWithdrawAddressResponse} message MsgSetWithdrawAddressResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgSetWithdrawAddressResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgSetWithdrawAddressResponse message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse} MsgSetWithdrawAddressResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgSetWithdrawAddressResponse.decode = 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.distribution.v1beta1.MsgSetWithdrawAddressResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgSetWithdrawAddressResponse message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse} MsgSetWithdrawAddressResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgSetWithdrawAddressResponse.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgSetWithdrawAddressResponse message.
|
|
* @function verify
|
|
* @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgSetWithdrawAddressResponse.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgSetWithdrawAddressResponse message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse} MsgSetWithdrawAddressResponse
|
|
*/
|
|
MsgSetWithdrawAddressResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse)
|
|
return object;
|
|
return new $root.cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse();
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgSetWithdrawAddressResponse message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse} message MsgSetWithdrawAddressResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgSetWithdrawAddressResponse.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgSetWithdrawAddressResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgSetWithdrawAddressResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgSetWithdrawAddressResponse;
|
|
})(v1beta1.MsgSetWithdrawAddressResponse || {});
|
|
|
|
v1beta1.MsgWithdrawDelegatorReward = (function(MsgWithdrawDelegatorReward) {
|
|
|
|
/**
|
|
* Properties of a MsgWithdrawDelegatorReward.
|
|
* @memberof cosmos.distribution.v1beta1
|
|
* @interface IMsgWithdrawDelegatorReward
|
|
* @property {string|null} [delegatorAddress] MsgWithdrawDelegatorReward delegatorAddress
|
|
* @property {string|null} [validatorAddress] MsgWithdrawDelegatorReward validatorAddress
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgWithdrawDelegatorReward.
|
|
* @memberof cosmos.distribution.v1beta1
|
|
* @classdesc Represents a MsgWithdrawDelegatorReward.
|
|
* @implements IMsgWithdrawDelegatorReward
|
|
* @constructor
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward=} [properties] Properties to set
|
|
*/
|
|
function MsgWithdrawDelegatorReward(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* MsgWithdrawDelegatorReward delegatorAddress.
|
|
* @member {string} delegatorAddress
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward
|
|
* @instance
|
|
*/
|
|
MsgWithdrawDelegatorReward.prototype.delegatorAddress = "";
|
|
|
|
/**
|
|
* MsgWithdrawDelegatorReward validatorAddress.
|
|
* @member {string} validatorAddress
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward
|
|
* @instance
|
|
*/
|
|
MsgWithdrawDelegatorReward.prototype.validatorAddress = "";
|
|
|
|
/**
|
|
* Creates a new MsgWithdrawDelegatorReward instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward=} [properties] Properties to set
|
|
* @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward} MsgWithdrawDelegatorReward instance
|
|
*/
|
|
MsgWithdrawDelegatorReward.create = function create(properties) {
|
|
return new MsgWithdrawDelegatorReward(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgWithdrawDelegatorReward message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward} message MsgWithdrawDelegatorReward message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgWithdrawDelegatorReward.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.delegatorAddress != null && Object.hasOwnProperty.call(message, "delegatorAddress"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.delegatorAddress);
|
|
if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.validatorAddress);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgWithdrawDelegatorReward message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorReward} message MsgWithdrawDelegatorReward message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgWithdrawDelegatorReward.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgWithdrawDelegatorReward message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward} MsgWithdrawDelegatorReward
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgWithdrawDelegatorReward.decode = 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.distribution.v1beta1.MsgWithdrawDelegatorReward();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.delegatorAddress = reader.string();
|
|
break;
|
|
case 2:
|
|
message.validatorAddress = reader.string();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgWithdrawDelegatorReward message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward} MsgWithdrawDelegatorReward
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgWithdrawDelegatorReward.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgWithdrawDelegatorReward message.
|
|
* @function verify
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgWithdrawDelegatorReward.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
if (!$util.isString(message.delegatorAddress))
|
|
return "delegatorAddress: string expected";
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
if (!$util.isString(message.validatorAddress))
|
|
return "validatorAddress: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgWithdrawDelegatorReward message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward} MsgWithdrawDelegatorReward
|
|
*/
|
|
MsgWithdrawDelegatorReward.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward)
|
|
return object;
|
|
var message = new $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward();
|
|
if (object.delegatorAddress != null)
|
|
message.delegatorAddress = String(object.delegatorAddress);
|
|
if (object.validatorAddress != null)
|
|
message.validatorAddress = String(object.validatorAddress);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgWithdrawDelegatorReward message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward} message MsgWithdrawDelegatorReward
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgWithdrawDelegatorReward.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.delegatorAddress = "";
|
|
object.validatorAddress = "";
|
|
}
|
|
if (message.delegatorAddress != null && message.hasOwnProperty("delegatorAddress"))
|
|
object.delegatorAddress = message.delegatorAddress;
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
object.validatorAddress = message.validatorAddress;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgWithdrawDelegatorReward to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgWithdrawDelegatorReward.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgWithdrawDelegatorReward;
|
|
})(v1beta1.MsgWithdrawDelegatorReward || {});
|
|
|
|
v1beta1.MsgWithdrawDelegatorRewardResponse = (function(MsgWithdrawDelegatorRewardResponse) {
|
|
|
|
/**
|
|
* Properties of a MsgWithdrawDelegatorRewardResponse.
|
|
* @memberof cosmos.distribution.v1beta1
|
|
* @interface IMsgWithdrawDelegatorRewardResponse
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgWithdrawDelegatorRewardResponse.
|
|
* @memberof cosmos.distribution.v1beta1
|
|
* @classdesc Represents a MsgWithdrawDelegatorRewardResponse.
|
|
* @implements IMsgWithdrawDelegatorRewardResponse
|
|
* @constructor
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse=} [properties] Properties to set
|
|
*/
|
|
function MsgWithdrawDelegatorRewardResponse(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new MsgWithdrawDelegatorRewardResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse=} [properties] Properties to set
|
|
* @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse} MsgWithdrawDelegatorRewardResponse instance
|
|
*/
|
|
MsgWithdrawDelegatorRewardResponse.create = function create(properties) {
|
|
return new MsgWithdrawDelegatorRewardResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgWithdrawDelegatorRewardResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse} message MsgWithdrawDelegatorRewardResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgWithdrawDelegatorRewardResponse.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgWithdrawDelegatorRewardResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawDelegatorRewardResponse} message MsgWithdrawDelegatorRewardResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgWithdrawDelegatorRewardResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgWithdrawDelegatorRewardResponse message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse} MsgWithdrawDelegatorRewardResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgWithdrawDelegatorRewardResponse.decode = 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.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgWithdrawDelegatorRewardResponse message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse} MsgWithdrawDelegatorRewardResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgWithdrawDelegatorRewardResponse.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgWithdrawDelegatorRewardResponse message.
|
|
* @function verify
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgWithdrawDelegatorRewardResponse.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgWithdrawDelegatorRewardResponse message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse} MsgWithdrawDelegatorRewardResponse
|
|
*/
|
|
MsgWithdrawDelegatorRewardResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse)
|
|
return object;
|
|
return new $root.cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse();
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgWithdrawDelegatorRewardResponse message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse} message MsgWithdrawDelegatorRewardResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgWithdrawDelegatorRewardResponse.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgWithdrawDelegatorRewardResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgWithdrawDelegatorRewardResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgWithdrawDelegatorRewardResponse;
|
|
})(v1beta1.MsgWithdrawDelegatorRewardResponse || {});
|
|
|
|
v1beta1.MsgWithdrawValidatorCommission = (function(MsgWithdrawValidatorCommission) {
|
|
|
|
/**
|
|
* Properties of a MsgWithdrawValidatorCommission.
|
|
* @memberof cosmos.distribution.v1beta1
|
|
* @interface IMsgWithdrawValidatorCommission
|
|
* @property {string|null} [validatorAddress] MsgWithdrawValidatorCommission validatorAddress
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgWithdrawValidatorCommission.
|
|
* @memberof cosmos.distribution.v1beta1
|
|
* @classdesc Represents a MsgWithdrawValidatorCommission.
|
|
* @implements IMsgWithdrawValidatorCommission
|
|
* @constructor
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission=} [properties] Properties to set
|
|
*/
|
|
function MsgWithdrawValidatorCommission(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* MsgWithdrawValidatorCommission validatorAddress.
|
|
* @member {string} validatorAddress
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission
|
|
* @instance
|
|
*/
|
|
MsgWithdrawValidatorCommission.prototype.validatorAddress = "";
|
|
|
|
/**
|
|
* Creates a new MsgWithdrawValidatorCommission instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission=} [properties] Properties to set
|
|
* @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission} MsgWithdrawValidatorCommission instance
|
|
*/
|
|
MsgWithdrawValidatorCommission.create = function create(properties) {
|
|
return new MsgWithdrawValidatorCommission(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgWithdrawValidatorCommission message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission} message MsgWithdrawValidatorCommission message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgWithdrawValidatorCommission.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.validatorAddress);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgWithdrawValidatorCommission message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommission} message MsgWithdrawValidatorCommission message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgWithdrawValidatorCommission.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgWithdrawValidatorCommission message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission} MsgWithdrawValidatorCommission
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgWithdrawValidatorCommission.decode = 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.distribution.v1beta1.MsgWithdrawValidatorCommission();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.validatorAddress = reader.string();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgWithdrawValidatorCommission message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission} MsgWithdrawValidatorCommission
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgWithdrawValidatorCommission.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgWithdrawValidatorCommission message.
|
|
* @function verify
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgWithdrawValidatorCommission.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
if (!$util.isString(message.validatorAddress))
|
|
return "validatorAddress: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgWithdrawValidatorCommission message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission} MsgWithdrawValidatorCommission
|
|
*/
|
|
MsgWithdrawValidatorCommission.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission)
|
|
return object;
|
|
var message = new $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission();
|
|
if (object.validatorAddress != null)
|
|
message.validatorAddress = String(object.validatorAddress);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgWithdrawValidatorCommission message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission} message MsgWithdrawValidatorCommission
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgWithdrawValidatorCommission.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults)
|
|
object.validatorAddress = "";
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
object.validatorAddress = message.validatorAddress;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgWithdrawValidatorCommission to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgWithdrawValidatorCommission.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgWithdrawValidatorCommission;
|
|
})(v1beta1.MsgWithdrawValidatorCommission || {});
|
|
|
|
v1beta1.MsgWithdrawValidatorCommissionResponse = (function(MsgWithdrawValidatorCommissionResponse) {
|
|
|
|
/**
|
|
* Properties of a MsgWithdrawValidatorCommissionResponse.
|
|
* @memberof cosmos.distribution.v1beta1
|
|
* @interface IMsgWithdrawValidatorCommissionResponse
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgWithdrawValidatorCommissionResponse.
|
|
* @memberof cosmos.distribution.v1beta1
|
|
* @classdesc Represents a MsgWithdrawValidatorCommissionResponse.
|
|
* @implements IMsgWithdrawValidatorCommissionResponse
|
|
* @constructor
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse=} [properties] Properties to set
|
|
*/
|
|
function MsgWithdrawValidatorCommissionResponse(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new MsgWithdrawValidatorCommissionResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse=} [properties] Properties to set
|
|
* @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse} MsgWithdrawValidatorCommissionResponse instance
|
|
*/
|
|
MsgWithdrawValidatorCommissionResponse.create = function create(properties) {
|
|
return new MsgWithdrawValidatorCommissionResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgWithdrawValidatorCommissionResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse} message MsgWithdrawValidatorCommissionResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgWithdrawValidatorCommissionResponse.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgWithdrawValidatorCommissionResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgWithdrawValidatorCommissionResponse} message MsgWithdrawValidatorCommissionResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgWithdrawValidatorCommissionResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgWithdrawValidatorCommissionResponse message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse} MsgWithdrawValidatorCommissionResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgWithdrawValidatorCommissionResponse.decode = 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.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgWithdrawValidatorCommissionResponse message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse} MsgWithdrawValidatorCommissionResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgWithdrawValidatorCommissionResponse.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgWithdrawValidatorCommissionResponse message.
|
|
* @function verify
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgWithdrawValidatorCommissionResponse.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgWithdrawValidatorCommissionResponse message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse} MsgWithdrawValidatorCommissionResponse
|
|
*/
|
|
MsgWithdrawValidatorCommissionResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse)
|
|
return object;
|
|
return new $root.cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse();
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgWithdrawValidatorCommissionResponse message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse} message MsgWithdrawValidatorCommissionResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgWithdrawValidatorCommissionResponse.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgWithdrawValidatorCommissionResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgWithdrawValidatorCommissionResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgWithdrawValidatorCommissionResponse;
|
|
})(v1beta1.MsgWithdrawValidatorCommissionResponse || {});
|
|
|
|
v1beta1.MsgFundCommunityPool = (function(MsgFundCommunityPool) {
|
|
|
|
/**
|
|
* Properties of a MsgFundCommunityPool.
|
|
* @memberof cosmos.distribution.v1beta1
|
|
* @interface IMsgFundCommunityPool
|
|
* @property {Array.<cosmos.base.v1beta1.ICoin>|null} [amount] MsgFundCommunityPool amount
|
|
* @property {string|null} [depositor] MsgFundCommunityPool depositor
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgFundCommunityPool.
|
|
* @memberof cosmos.distribution.v1beta1
|
|
* @classdesc Represents a MsgFundCommunityPool.
|
|
* @implements IMsgFundCommunityPool
|
|
* @constructor
|
|
* @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool=} [properties] Properties to set
|
|
*/
|
|
function MsgFundCommunityPool(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]];
|
|
}
|
|
|
|
/**
|
|
* MsgFundCommunityPool amount.
|
|
* @member {Array.<cosmos.base.v1beta1.ICoin>} amount
|
|
* @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool
|
|
* @instance
|
|
*/
|
|
MsgFundCommunityPool.prototype.amount = $util.emptyArray;
|
|
|
|
/**
|
|
* MsgFundCommunityPool depositor.
|
|
* @member {string} depositor
|
|
* @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool
|
|
* @instance
|
|
*/
|
|
MsgFundCommunityPool.prototype.depositor = "";
|
|
|
|
/**
|
|
* Creates a new MsgFundCommunityPool instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool=} [properties] Properties to set
|
|
* @returns {cosmos.distribution.v1beta1.MsgFundCommunityPool} MsgFundCommunityPool instance
|
|
*/
|
|
MsgFundCommunityPool.create = function create(properties) {
|
|
return new MsgFundCommunityPool(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgFundCommunityPool message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgFundCommunityPool.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool} message MsgFundCommunityPool message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgFundCommunityPool.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
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 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.depositor != null && Object.hasOwnProperty.call(message, "depositor"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.depositor);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgFundCommunityPool message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgFundCommunityPool.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgFundCommunityPool} message MsgFundCommunityPool message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgFundCommunityPool.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgFundCommunityPool message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.distribution.v1beta1.MsgFundCommunityPool} MsgFundCommunityPool
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgFundCommunityPool.decode = 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.distribution.v1beta1.MsgFundCommunityPool();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
if (!(message.amount && message.amount.length))
|
|
message.amount = [];
|
|
message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()));
|
|
break;
|
|
case 2:
|
|
message.depositor = reader.string();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgFundCommunityPool message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.distribution.v1beta1.MsgFundCommunityPool} MsgFundCommunityPool
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgFundCommunityPool.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgFundCommunityPool message.
|
|
* @function verify
|
|
* @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgFundCommunityPool.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object 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;
|
|
}
|
|
}
|
|
if (message.depositor != null && message.hasOwnProperty("depositor"))
|
|
if (!$util.isString(message.depositor))
|
|
return "depositor: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgFundCommunityPool message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.distribution.v1beta1.MsgFundCommunityPool} MsgFundCommunityPool
|
|
*/
|
|
MsgFundCommunityPool.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.distribution.v1beta1.MsgFundCommunityPool)
|
|
return object;
|
|
var message = new $root.cosmos.distribution.v1beta1.MsgFundCommunityPool();
|
|
if (object.amount) {
|
|
if (!Array.isArray(object.amount))
|
|
throw TypeError(".cosmos.distribution.v1beta1.MsgFundCommunityPool.amount: array expected");
|
|
message.amount = [];
|
|
for (var i = 0; i < object.amount.length; ++i) {
|
|
if (typeof object.amount[i] !== "object")
|
|
throw TypeError(".cosmos.distribution.v1beta1.MsgFundCommunityPool.amount: object expected");
|
|
message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]);
|
|
}
|
|
}
|
|
if (object.depositor != null)
|
|
message.depositor = String(object.depositor);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgFundCommunityPool message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.MsgFundCommunityPool} message MsgFundCommunityPool
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgFundCommunityPool.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.amount = [];
|
|
if (options.defaults)
|
|
object.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);
|
|
}
|
|
if (message.depositor != null && message.hasOwnProperty("depositor"))
|
|
object.depositor = message.depositor;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgFundCommunityPool to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.distribution.v1beta1.MsgFundCommunityPool
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgFundCommunityPool.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgFundCommunityPool;
|
|
})(v1beta1.MsgFundCommunityPool || {});
|
|
|
|
v1beta1.MsgFundCommunityPoolResponse = (function(MsgFundCommunityPoolResponse) {
|
|
|
|
/**
|
|
* Properties of a MsgFundCommunityPoolResponse.
|
|
* @memberof cosmos.distribution.v1beta1
|
|
* @interface IMsgFundCommunityPoolResponse
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgFundCommunityPoolResponse.
|
|
* @memberof cosmos.distribution.v1beta1
|
|
* @classdesc Represents a MsgFundCommunityPoolResponse.
|
|
* @implements IMsgFundCommunityPoolResponse
|
|
* @constructor
|
|
* @param {cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse=} [properties] Properties to set
|
|
*/
|
|
function MsgFundCommunityPoolResponse(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new MsgFundCommunityPoolResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse=} [properties] Properties to set
|
|
* @returns {cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse} MsgFundCommunityPoolResponse instance
|
|
*/
|
|
MsgFundCommunityPoolResponse.create = function create(properties) {
|
|
return new MsgFundCommunityPoolResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgFundCommunityPoolResponse message. Does not implicitly {@link cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse} message MsgFundCommunityPoolResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgFundCommunityPoolResponse.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgFundCommunityPoolResponse message, length delimited. Does not implicitly {@link cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.IMsgFundCommunityPoolResponse} message MsgFundCommunityPoolResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgFundCommunityPoolResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgFundCommunityPoolResponse message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse} MsgFundCommunityPoolResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgFundCommunityPoolResponse.decode = 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.distribution.v1beta1.MsgFundCommunityPoolResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgFundCommunityPoolResponse message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse} MsgFundCommunityPoolResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgFundCommunityPoolResponse.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgFundCommunityPoolResponse message.
|
|
* @function verify
|
|
* @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgFundCommunityPoolResponse.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgFundCommunityPoolResponse message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse} MsgFundCommunityPoolResponse
|
|
*/
|
|
MsgFundCommunityPoolResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse)
|
|
return object;
|
|
return new $root.cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse();
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgFundCommunityPoolResponse message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse
|
|
* @static
|
|
* @param {cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse} message MsgFundCommunityPoolResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgFundCommunityPoolResponse.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgFundCommunityPoolResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgFundCommunityPoolResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgFundCommunityPoolResponse;
|
|
})(v1beta1.MsgFundCommunityPoolResponse || {});
|
|
|
|
return v1beta1;
|
|
})(distribution.v1beta1 || {});
|
|
|
|
return distribution;
|
|
})(cosmos.distribution || {});
|
|
|
|
/**
|
|
* Namespace evidence.
|
|
* @memberof cosmos
|
|
* @namespace
|
|
*/
|
|
|
|
cosmos.evidence = (function(evidence) {
|
|
|
|
/**
|
|
* Namespace v1beta1.
|
|
* @memberof cosmos.evidence
|
|
* @namespace
|
|
*/
|
|
|
|
evidence.v1beta1 = (function(v1beta1) {
|
|
|
|
v1beta1.Msg = (function(Msg) {
|
|
|
|
/**
|
|
* Constructs a new Msg service.
|
|
* @memberof cosmos.evidence.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;
|
|
|
|
/**
|
|
* Creates new Msg service using the specified rpc implementation.
|
|
* @function create
|
|
* @memberof cosmos.evidence.v1beta1.Msg
|
|
* @static
|
|
* @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
|
* @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
|
* @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
|
* @returns {Msg} RPC service. Useful where requests and/or responses are streamed.
|
|
*/
|
|
Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
|
return new this(rpcImpl, requestDelimited, responseDelimited);
|
|
};
|
|
|
|
/**
|
|
* Callback as used by {@link cosmos.evidence.v1beta1.Msg#submitEvidence}.
|
|
* @memberof cosmos.evidence.v1beta1.Msg
|
|
* @typedef SubmitEvidenceCallback
|
|
* @type {function}
|
|
* @param {Error|null} error Error, if any
|
|
* @param {cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse} [response] MsgSubmitEvidenceResponse
|
|
*/
|
|
|
|
/**
|
|
* Calls SubmitEvidence.
|
|
* @function submitEvidence
|
|
* @memberof cosmos.evidence.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence} request MsgSubmitEvidence message or plain object
|
|
* @param {cosmos.evidence.v1beta1.Msg.SubmitEvidenceCallback} callback Node-style callback called with the error, if any, and MsgSubmitEvidenceResponse
|
|
* @returns {undefined}
|
|
* @variation 1
|
|
*/
|
|
Object.defineProperty(Msg.prototype.submitEvidence = function submitEvidence(request, callback) {
|
|
return this.rpcCall(submitEvidence, $root.cosmos.evidence.v1beta1.MsgSubmitEvidence, $root.cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse, request, callback);
|
|
}, "name", { value: "SubmitEvidence" });
|
|
|
|
/**
|
|
* Calls SubmitEvidence.
|
|
* @function submitEvidence
|
|
* @memberof cosmos.evidence.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence} request MsgSubmitEvidence message or plain object
|
|
* @returns {Promise<cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
return Msg;
|
|
})(v1beta1.Msg || {});
|
|
|
|
v1beta1.MsgSubmitEvidence = (function(MsgSubmitEvidence) {
|
|
|
|
/**
|
|
* Properties of a MsgSubmitEvidence.
|
|
* @memberof cosmos.evidence.v1beta1
|
|
* @interface IMsgSubmitEvidence
|
|
* @property {string|null} [submitter] MsgSubmitEvidence submitter
|
|
* @property {google.protobuf.IAny|null} [evidence] MsgSubmitEvidence evidence
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgSubmitEvidence.
|
|
* @memberof cosmos.evidence.v1beta1
|
|
* @classdesc Represents a MsgSubmitEvidence.
|
|
* @implements IMsgSubmitEvidence
|
|
* @constructor
|
|
* @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence=} [properties] Properties to set
|
|
*/
|
|
function MsgSubmitEvidence(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* MsgSubmitEvidence submitter.
|
|
* @member {string} submitter
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence
|
|
* @instance
|
|
*/
|
|
MsgSubmitEvidence.prototype.submitter = "";
|
|
|
|
/**
|
|
* MsgSubmitEvidence evidence.
|
|
* @member {google.protobuf.IAny|null|undefined} evidence
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence
|
|
* @instance
|
|
*/
|
|
MsgSubmitEvidence.prototype.evidence = null;
|
|
|
|
/**
|
|
* Creates a new MsgSubmitEvidence instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence
|
|
* @static
|
|
* @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence=} [properties] Properties to set
|
|
* @returns {cosmos.evidence.v1beta1.MsgSubmitEvidence} MsgSubmitEvidence instance
|
|
*/
|
|
MsgSubmitEvidence.create = function create(properties) {
|
|
return new MsgSubmitEvidence(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgSubmitEvidence message. Does not implicitly {@link cosmos.evidence.v1beta1.MsgSubmitEvidence.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence
|
|
* @static
|
|
* @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence} message MsgSubmitEvidence message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgSubmitEvidence.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.submitter != null && Object.hasOwnProperty.call(message, "submitter"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.submitter);
|
|
if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence"))
|
|
$root.google.protobuf.Any.encode(message.evidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgSubmitEvidence message, length delimited. Does not implicitly {@link cosmos.evidence.v1beta1.MsgSubmitEvidence.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence
|
|
* @static
|
|
* @param {cosmos.evidence.v1beta1.IMsgSubmitEvidence} message MsgSubmitEvidence message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgSubmitEvidence.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgSubmitEvidence message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.evidence.v1beta1.MsgSubmitEvidence} MsgSubmitEvidence
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgSubmitEvidence.decode = 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.evidence.v1beta1.MsgSubmitEvidence();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.submitter = reader.string();
|
|
break;
|
|
case 2:
|
|
message.evidence = $root.google.protobuf.Any.decode(reader, reader.uint32());
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgSubmitEvidence message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.evidence.v1beta1.MsgSubmitEvidence} MsgSubmitEvidence
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgSubmitEvidence.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgSubmitEvidence message.
|
|
* @function verify
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgSubmitEvidence.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.submitter != null && message.hasOwnProperty("submitter"))
|
|
if (!$util.isString(message.submitter))
|
|
return "submitter: string expected";
|
|
if (message.evidence != null && message.hasOwnProperty("evidence")) {
|
|
var error = $root.google.protobuf.Any.verify(message.evidence);
|
|
if (error)
|
|
return "evidence." + error;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgSubmitEvidence message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.evidence.v1beta1.MsgSubmitEvidence} MsgSubmitEvidence
|
|
*/
|
|
MsgSubmitEvidence.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.evidence.v1beta1.MsgSubmitEvidence)
|
|
return object;
|
|
var message = new $root.cosmos.evidence.v1beta1.MsgSubmitEvidence();
|
|
if (object.submitter != null)
|
|
message.submitter = String(object.submitter);
|
|
if (object.evidence != null) {
|
|
if (typeof object.evidence !== "object")
|
|
throw TypeError(".cosmos.evidence.v1beta1.MsgSubmitEvidence.evidence: object expected");
|
|
message.evidence = $root.google.protobuf.Any.fromObject(object.evidence);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgSubmitEvidence message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence
|
|
* @static
|
|
* @param {cosmos.evidence.v1beta1.MsgSubmitEvidence} message MsgSubmitEvidence
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgSubmitEvidence.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.submitter = "";
|
|
object.evidence = null;
|
|
}
|
|
if (message.submitter != null && message.hasOwnProperty("submitter"))
|
|
object.submitter = message.submitter;
|
|
if (message.evidence != null && message.hasOwnProperty("evidence"))
|
|
object.evidence = $root.google.protobuf.Any.toObject(message.evidence, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgSubmitEvidence to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidence
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgSubmitEvidence.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgSubmitEvidence;
|
|
})(v1beta1.MsgSubmitEvidence || {});
|
|
|
|
v1beta1.MsgSubmitEvidenceResponse = (function(MsgSubmitEvidenceResponse) {
|
|
|
|
/**
|
|
* Properties of a MsgSubmitEvidenceResponse.
|
|
* @memberof cosmos.evidence.v1beta1
|
|
* @interface IMsgSubmitEvidenceResponse
|
|
* @property {Uint8Array|null} [hash] MsgSubmitEvidenceResponse hash
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgSubmitEvidenceResponse.
|
|
* @memberof cosmos.evidence.v1beta1
|
|
* @classdesc Represents a MsgSubmitEvidenceResponse.
|
|
* @implements IMsgSubmitEvidenceResponse
|
|
* @constructor
|
|
* @param {cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse=} [properties] Properties to set
|
|
*/
|
|
function MsgSubmitEvidenceResponse(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* MsgSubmitEvidenceResponse hash.
|
|
* @member {Uint8Array} hash
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse
|
|
* @instance
|
|
*/
|
|
MsgSubmitEvidenceResponse.prototype.hash = $util.newBuffer([]);
|
|
|
|
/**
|
|
* Creates a new MsgSubmitEvidenceResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse
|
|
* @static
|
|
* @param {cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse=} [properties] Properties to set
|
|
* @returns {cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse} MsgSubmitEvidenceResponse instance
|
|
*/
|
|
MsgSubmitEvidenceResponse.create = function create(properties) {
|
|
return new MsgSubmitEvidenceResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgSubmitEvidenceResponse message. Does not implicitly {@link cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse
|
|
* @static
|
|
* @param {cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse} message MsgSubmitEvidenceResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgSubmitEvidenceResponse.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.hash != null && Object.hasOwnProperty.call(message, "hash"))
|
|
writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.hash);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgSubmitEvidenceResponse message, length delimited. Does not implicitly {@link cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse
|
|
* @static
|
|
* @param {cosmos.evidence.v1beta1.IMsgSubmitEvidenceResponse} message MsgSubmitEvidenceResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgSubmitEvidenceResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgSubmitEvidenceResponse message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse} MsgSubmitEvidenceResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgSubmitEvidenceResponse.decode = 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.evidence.v1beta1.MsgSubmitEvidenceResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 4:
|
|
message.hash = reader.bytes();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgSubmitEvidenceResponse message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse} MsgSubmitEvidenceResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgSubmitEvidenceResponse.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgSubmitEvidenceResponse message.
|
|
* @function verify
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgSubmitEvidenceResponse.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 MsgSubmitEvidenceResponse message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse} MsgSubmitEvidenceResponse
|
|
*/
|
|
MsgSubmitEvidenceResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse)
|
|
return object;
|
|
var message = new $root.cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse();
|
|
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 MsgSubmitEvidenceResponse message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse
|
|
* @static
|
|
* @param {cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse} message MsgSubmitEvidenceResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgSubmitEvidenceResponse.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 MsgSubmitEvidenceResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgSubmitEvidenceResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgSubmitEvidenceResponse;
|
|
})(v1beta1.MsgSubmitEvidenceResponse || {});
|
|
|
|
return v1beta1;
|
|
})(evidence.v1beta1 || {});
|
|
|
|
return evidence;
|
|
})(cosmos.evidence || {});
|
|
|
|
/**
|
|
* Namespace slashing.
|
|
* @memberof cosmos
|
|
* @namespace
|
|
*/
|
|
|
|
cosmos.slashing = (function(slashing) {
|
|
|
|
/**
|
|
* Namespace v1beta1.
|
|
* @memberof cosmos.slashing
|
|
* @namespace
|
|
*/
|
|
|
|
slashing.v1beta1 = (function(v1beta1) {
|
|
|
|
v1beta1.Msg = (function(Msg) {
|
|
|
|
/**
|
|
* Constructs a new Msg service.
|
|
* @memberof cosmos.slashing.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;
|
|
|
|
/**
|
|
* Creates new Msg service using the specified rpc implementation.
|
|
* @function create
|
|
* @memberof cosmos.slashing.v1beta1.Msg
|
|
* @static
|
|
* @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
|
* @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
|
* @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
|
* @returns {Msg} RPC service. Useful where requests and/or responses are streamed.
|
|
*/
|
|
Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
|
return new this(rpcImpl, requestDelimited, responseDelimited);
|
|
};
|
|
|
|
/**
|
|
* Callback as used by {@link cosmos.slashing.v1beta1.Msg#unjail}.
|
|
* @memberof cosmos.slashing.v1beta1.Msg
|
|
* @typedef UnjailCallback
|
|
* @type {function}
|
|
* @param {Error|null} error Error, if any
|
|
* @param {cosmos.slashing.v1beta1.IMsgUnjailResponse} [response] MsgUnjailResponse
|
|
*/
|
|
|
|
/**
|
|
* Calls Unjail.
|
|
* @function unjail
|
|
* @memberof cosmos.slashing.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.slashing.v1beta1.IMsgUnjail} request MsgUnjail message or plain object
|
|
* @param {cosmos.slashing.v1beta1.Msg.UnjailCallback} callback Node-style callback called with the error, if any, and MsgUnjailResponse
|
|
* @returns {undefined}
|
|
* @variation 1
|
|
*/
|
|
Object.defineProperty(Msg.prototype.unjail = function unjail(request, callback) {
|
|
return this.rpcCall(unjail, $root.cosmos.slashing.v1beta1.MsgUnjail, $root.cosmos.slashing.v1beta1.MsgUnjailResponse, request, callback);
|
|
}, "name", { value: "Unjail" });
|
|
|
|
/**
|
|
* Calls Unjail.
|
|
* @function unjail
|
|
* @memberof cosmos.slashing.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.slashing.v1beta1.IMsgUnjail} request MsgUnjail message or plain object
|
|
* @returns {Promise<cosmos.slashing.v1beta1.IMsgUnjailResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
return Msg;
|
|
})(v1beta1.Msg || {});
|
|
|
|
v1beta1.MsgUnjail = (function(MsgUnjail) {
|
|
|
|
/**
|
|
* Properties of a MsgUnjail.
|
|
* @memberof cosmos.slashing.v1beta1
|
|
* @interface IMsgUnjail
|
|
* @property {string|null} [validatorAddr] MsgUnjail validatorAddr
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgUnjail.
|
|
* @memberof cosmos.slashing.v1beta1
|
|
* @classdesc Represents a MsgUnjail.
|
|
* @implements IMsgUnjail
|
|
* @constructor
|
|
* @param {cosmos.slashing.v1beta1.IMsgUnjail=} [properties] Properties to set
|
|
*/
|
|
function MsgUnjail(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* MsgUnjail validatorAddr.
|
|
* @member {string} validatorAddr
|
|
* @memberof cosmos.slashing.v1beta1.MsgUnjail
|
|
* @instance
|
|
*/
|
|
MsgUnjail.prototype.validatorAddr = "";
|
|
|
|
/**
|
|
* Creates a new MsgUnjail instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.slashing.v1beta1.MsgUnjail
|
|
* @static
|
|
* @param {cosmos.slashing.v1beta1.IMsgUnjail=} [properties] Properties to set
|
|
* @returns {cosmos.slashing.v1beta1.MsgUnjail} MsgUnjail instance
|
|
*/
|
|
MsgUnjail.create = function create(properties) {
|
|
return new MsgUnjail(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgUnjail message. Does not implicitly {@link cosmos.slashing.v1beta1.MsgUnjail.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.slashing.v1beta1.MsgUnjail
|
|
* @static
|
|
* @param {cosmos.slashing.v1beta1.IMsgUnjail} message MsgUnjail message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgUnjail.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.validatorAddr != null && Object.hasOwnProperty.call(message, "validatorAddr"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.validatorAddr);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgUnjail message, length delimited. Does not implicitly {@link cosmos.slashing.v1beta1.MsgUnjail.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.slashing.v1beta1.MsgUnjail
|
|
* @static
|
|
* @param {cosmos.slashing.v1beta1.IMsgUnjail} message MsgUnjail message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgUnjail.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgUnjail message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.slashing.v1beta1.MsgUnjail
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.slashing.v1beta1.MsgUnjail} MsgUnjail
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgUnjail.decode = 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.slashing.v1beta1.MsgUnjail();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.validatorAddr = reader.string();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgUnjail message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.slashing.v1beta1.MsgUnjail
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.slashing.v1beta1.MsgUnjail} MsgUnjail
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgUnjail.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgUnjail message.
|
|
* @function verify
|
|
* @memberof cosmos.slashing.v1beta1.MsgUnjail
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgUnjail.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.validatorAddr != null && message.hasOwnProperty("validatorAddr"))
|
|
if (!$util.isString(message.validatorAddr))
|
|
return "validatorAddr: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgUnjail message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.slashing.v1beta1.MsgUnjail
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.slashing.v1beta1.MsgUnjail} MsgUnjail
|
|
*/
|
|
MsgUnjail.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.slashing.v1beta1.MsgUnjail)
|
|
return object;
|
|
var message = new $root.cosmos.slashing.v1beta1.MsgUnjail();
|
|
if (object.validatorAddr != null)
|
|
message.validatorAddr = String(object.validatorAddr);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgUnjail message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.slashing.v1beta1.MsgUnjail
|
|
* @static
|
|
* @param {cosmos.slashing.v1beta1.MsgUnjail} message MsgUnjail
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgUnjail.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults)
|
|
object.validatorAddr = "";
|
|
if (message.validatorAddr != null && message.hasOwnProperty("validatorAddr"))
|
|
object.validatorAddr = message.validatorAddr;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgUnjail to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.slashing.v1beta1.MsgUnjail
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgUnjail.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgUnjail;
|
|
})(v1beta1.MsgUnjail || {});
|
|
|
|
v1beta1.MsgUnjailResponse = (function(MsgUnjailResponse) {
|
|
|
|
/**
|
|
* Properties of a MsgUnjailResponse.
|
|
* @memberof cosmos.slashing.v1beta1
|
|
* @interface IMsgUnjailResponse
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgUnjailResponse.
|
|
* @memberof cosmos.slashing.v1beta1
|
|
* @classdesc Represents a MsgUnjailResponse.
|
|
* @implements IMsgUnjailResponse
|
|
* @constructor
|
|
* @param {cosmos.slashing.v1beta1.IMsgUnjailResponse=} [properties] Properties to set
|
|
*/
|
|
function MsgUnjailResponse(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new MsgUnjailResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.slashing.v1beta1.MsgUnjailResponse
|
|
* @static
|
|
* @param {cosmos.slashing.v1beta1.IMsgUnjailResponse=} [properties] Properties to set
|
|
* @returns {cosmos.slashing.v1beta1.MsgUnjailResponse} MsgUnjailResponse instance
|
|
*/
|
|
MsgUnjailResponse.create = function create(properties) {
|
|
return new MsgUnjailResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgUnjailResponse message. Does not implicitly {@link cosmos.slashing.v1beta1.MsgUnjailResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.slashing.v1beta1.MsgUnjailResponse
|
|
* @static
|
|
* @param {cosmos.slashing.v1beta1.IMsgUnjailResponse} message MsgUnjailResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgUnjailResponse.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgUnjailResponse message, length delimited. Does not implicitly {@link cosmos.slashing.v1beta1.MsgUnjailResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.slashing.v1beta1.MsgUnjailResponse
|
|
* @static
|
|
* @param {cosmos.slashing.v1beta1.IMsgUnjailResponse} message MsgUnjailResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgUnjailResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgUnjailResponse message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.slashing.v1beta1.MsgUnjailResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.slashing.v1beta1.MsgUnjailResponse} MsgUnjailResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgUnjailResponse.decode = 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.slashing.v1beta1.MsgUnjailResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgUnjailResponse message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.slashing.v1beta1.MsgUnjailResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.slashing.v1beta1.MsgUnjailResponse} MsgUnjailResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgUnjailResponse.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgUnjailResponse message.
|
|
* @function verify
|
|
* @memberof cosmos.slashing.v1beta1.MsgUnjailResponse
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgUnjailResponse.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgUnjailResponse message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.slashing.v1beta1.MsgUnjailResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.slashing.v1beta1.MsgUnjailResponse} MsgUnjailResponse
|
|
*/
|
|
MsgUnjailResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.slashing.v1beta1.MsgUnjailResponse)
|
|
return object;
|
|
return new $root.cosmos.slashing.v1beta1.MsgUnjailResponse();
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgUnjailResponse message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.slashing.v1beta1.MsgUnjailResponse
|
|
* @static
|
|
* @param {cosmos.slashing.v1beta1.MsgUnjailResponse} message MsgUnjailResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgUnjailResponse.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgUnjailResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.slashing.v1beta1.MsgUnjailResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgUnjailResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgUnjailResponse;
|
|
})(v1beta1.MsgUnjailResponse || {});
|
|
|
|
return v1beta1;
|
|
})(slashing.v1beta1 || {});
|
|
|
|
return slashing;
|
|
})(cosmos.slashing || {});
|
|
|
|
/**
|
|
* Namespace vesting.
|
|
* @memberof cosmos
|
|
* @namespace
|
|
*/
|
|
|
|
cosmos.vesting = (function(vesting) {
|
|
|
|
/**
|
|
* Namespace v1beta1.
|
|
* @memberof cosmos.vesting
|
|
* @namespace
|
|
*/
|
|
|
|
vesting.v1beta1 = (function(v1beta1) {
|
|
|
|
v1beta1.Msg = (function(Msg) {
|
|
|
|
/**
|
|
* Constructs a new Msg service.
|
|
* @memberof cosmos.vesting.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;
|
|
|
|
/**
|
|
* Creates new Msg service using the specified rpc implementation.
|
|
* @function create
|
|
* @memberof cosmos.vesting.v1beta1.Msg
|
|
* @static
|
|
* @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
|
* @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
|
* @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
|
* @returns {Msg} RPC service. Useful where requests and/or responses are streamed.
|
|
*/
|
|
Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
|
return new this(rpcImpl, requestDelimited, responseDelimited);
|
|
};
|
|
|
|
/**
|
|
* Callback as used by {@link cosmos.vesting.v1beta1.Msg#createVestingAccount}.
|
|
* @memberof cosmos.vesting.v1beta1.Msg
|
|
* @typedef CreateVestingAccountCallback
|
|
* @type {function}
|
|
* @param {Error|null} error Error, if any
|
|
* @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse} [response] MsgCreateVestingAccountResponse
|
|
*/
|
|
|
|
/**
|
|
* Calls CreateVestingAccount.
|
|
* @function createVestingAccount
|
|
* @memberof cosmos.vesting.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount} request MsgCreateVestingAccount message or plain object
|
|
* @param {cosmos.vesting.v1beta1.Msg.CreateVestingAccountCallback} callback Node-style callback called with the error, if any, and MsgCreateVestingAccountResponse
|
|
* @returns {undefined}
|
|
* @variation 1
|
|
*/
|
|
Object.defineProperty(Msg.prototype.createVestingAccount = function createVestingAccount(request, callback) {
|
|
return this.rpcCall(createVestingAccount, $root.cosmos.vesting.v1beta1.MsgCreateVestingAccount, $root.cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse, request, callback);
|
|
}, "name", { value: "CreateVestingAccount" });
|
|
|
|
/**
|
|
* Calls CreateVestingAccount.
|
|
* @function createVestingAccount
|
|
* @memberof cosmos.vesting.v1beta1.Msg
|
|
* @instance
|
|
* @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount} request MsgCreateVestingAccount message or plain object
|
|
* @returns {Promise<cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
return Msg;
|
|
})(v1beta1.Msg || {});
|
|
|
|
v1beta1.MsgCreateVestingAccount = (function(MsgCreateVestingAccount) {
|
|
|
|
/**
|
|
* Properties of a MsgCreateVestingAccount.
|
|
* @memberof cosmos.vesting.v1beta1
|
|
* @interface IMsgCreateVestingAccount
|
|
* @property {string|null} [fromAddress] MsgCreateVestingAccount fromAddress
|
|
* @property {string|null} [toAddress] MsgCreateVestingAccount toAddress
|
|
* @property {Array.<cosmos.base.v1beta1.ICoin>|null} [amount] MsgCreateVestingAccount amount
|
|
* @property {number|Long|null} [endTime] MsgCreateVestingAccount endTime
|
|
* @property {boolean|null} [delayed] MsgCreateVestingAccount delayed
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgCreateVestingAccount.
|
|
* @memberof cosmos.vesting.v1beta1
|
|
* @classdesc Represents a MsgCreateVestingAccount.
|
|
* @implements IMsgCreateVestingAccount
|
|
* @constructor
|
|
* @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount=} [properties] Properties to set
|
|
*/
|
|
function MsgCreateVestingAccount(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]];
|
|
}
|
|
|
|
/**
|
|
* MsgCreateVestingAccount fromAddress.
|
|
* @member {string} fromAddress
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount
|
|
* @instance
|
|
*/
|
|
MsgCreateVestingAccount.prototype.fromAddress = "";
|
|
|
|
/**
|
|
* MsgCreateVestingAccount toAddress.
|
|
* @member {string} toAddress
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount
|
|
* @instance
|
|
*/
|
|
MsgCreateVestingAccount.prototype.toAddress = "";
|
|
|
|
/**
|
|
* MsgCreateVestingAccount amount.
|
|
* @member {Array.<cosmos.base.v1beta1.ICoin>} amount
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount
|
|
* @instance
|
|
*/
|
|
MsgCreateVestingAccount.prototype.amount = $util.emptyArray;
|
|
|
|
/**
|
|
* MsgCreateVestingAccount endTime.
|
|
* @member {number|Long} endTime
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount
|
|
* @instance
|
|
*/
|
|
MsgCreateVestingAccount.prototype.endTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* MsgCreateVestingAccount delayed.
|
|
* @member {boolean} delayed
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount
|
|
* @instance
|
|
*/
|
|
MsgCreateVestingAccount.prototype.delayed = false;
|
|
|
|
/**
|
|
* Creates a new MsgCreateVestingAccount instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount
|
|
* @static
|
|
* @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount=} [properties] Properties to set
|
|
* @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccount} MsgCreateVestingAccount instance
|
|
*/
|
|
MsgCreateVestingAccount.create = function create(properties) {
|
|
return new MsgCreateVestingAccount(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgCreateVestingAccount message. Does not implicitly {@link cosmos.vesting.v1beta1.MsgCreateVestingAccount.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount
|
|
* @static
|
|
* @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount} message MsgCreateVestingAccount message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgCreateVestingAccount.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.fromAddress != null && Object.hasOwnProperty.call(message, "fromAddress"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.fromAddress);
|
|
if (message.toAddress != null && Object.hasOwnProperty.call(message, "toAddress"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.toAddress);
|
|
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();
|
|
if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime"))
|
|
writer.uint32(/* id 4, wireType 0 =*/32).int64(message.endTime);
|
|
if (message.delayed != null && Object.hasOwnProperty.call(message, "delayed"))
|
|
writer.uint32(/* id 5, wireType 0 =*/40).bool(message.delayed);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgCreateVestingAccount message, length delimited. Does not implicitly {@link cosmos.vesting.v1beta1.MsgCreateVestingAccount.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount
|
|
* @static
|
|
* @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccount} message MsgCreateVestingAccount message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgCreateVestingAccount.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgCreateVestingAccount message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccount} MsgCreateVestingAccount
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgCreateVestingAccount.decode = 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.vesting.v1beta1.MsgCreateVestingAccount();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.fromAddress = reader.string();
|
|
break;
|
|
case 2:
|
|
message.toAddress = 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;
|
|
case 4:
|
|
message.endTime = reader.int64();
|
|
break;
|
|
case 5:
|
|
message.delayed = reader.bool();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgCreateVestingAccount message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccount} MsgCreateVestingAccount
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgCreateVestingAccount.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgCreateVestingAccount message.
|
|
* @function verify
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgCreateVestingAccount.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.fromAddress != null && message.hasOwnProperty("fromAddress"))
|
|
if (!$util.isString(message.fromAddress))
|
|
return "fromAddress: string expected";
|
|
if (message.toAddress != null && message.hasOwnProperty("toAddress"))
|
|
if (!$util.isString(message.toAddress))
|
|
return "toAddress: 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;
|
|
}
|
|
}
|
|
if (message.endTime != null && message.hasOwnProperty("endTime"))
|
|
if (!$util.isInteger(message.endTime) && !(message.endTime && $util.isInteger(message.endTime.low) && $util.isInteger(message.endTime.high)))
|
|
return "endTime: integer|Long expected";
|
|
if (message.delayed != null && message.hasOwnProperty("delayed"))
|
|
if (typeof message.delayed !== "boolean")
|
|
return "delayed: boolean expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgCreateVestingAccount message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccount} MsgCreateVestingAccount
|
|
*/
|
|
MsgCreateVestingAccount.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.vesting.v1beta1.MsgCreateVestingAccount)
|
|
return object;
|
|
var message = new $root.cosmos.vesting.v1beta1.MsgCreateVestingAccount();
|
|
if (object.fromAddress != null)
|
|
message.fromAddress = String(object.fromAddress);
|
|
if (object.toAddress != null)
|
|
message.toAddress = String(object.toAddress);
|
|
if (object.amount) {
|
|
if (!Array.isArray(object.amount))
|
|
throw TypeError(".cosmos.vesting.v1beta1.MsgCreateVestingAccount.amount: array expected");
|
|
message.amount = [];
|
|
for (var i = 0; i < object.amount.length; ++i) {
|
|
if (typeof object.amount[i] !== "object")
|
|
throw TypeError(".cosmos.vesting.v1beta1.MsgCreateVestingAccount.amount: object expected");
|
|
message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]);
|
|
}
|
|
}
|
|
if (object.endTime != null)
|
|
if ($util.Long)
|
|
(message.endTime = $util.Long.fromValue(object.endTime)).unsigned = false;
|
|
else if (typeof object.endTime === "string")
|
|
message.endTime = parseInt(object.endTime, 10);
|
|
else if (typeof object.endTime === "number")
|
|
message.endTime = object.endTime;
|
|
else if (typeof object.endTime === "object")
|
|
message.endTime = new $util.LongBits(object.endTime.low >>> 0, object.endTime.high >>> 0).toNumber();
|
|
if (object.delayed != null)
|
|
message.delayed = Boolean(object.delayed);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgCreateVestingAccount message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount
|
|
* @static
|
|
* @param {cosmos.vesting.v1beta1.MsgCreateVestingAccount} message MsgCreateVestingAccount
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgCreateVestingAccount.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.amount = [];
|
|
if (options.defaults) {
|
|
object.fromAddress = "";
|
|
object.toAddress = "";
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.endTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.endTime = options.longs === String ? "0" : 0;
|
|
object.delayed = false;
|
|
}
|
|
if (message.fromAddress != null && message.hasOwnProperty("fromAddress"))
|
|
object.fromAddress = message.fromAddress;
|
|
if (message.toAddress != null && message.hasOwnProperty("toAddress"))
|
|
object.toAddress = message.toAddress;
|
|
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);
|
|
}
|
|
if (message.endTime != null && message.hasOwnProperty("endTime"))
|
|
if (typeof message.endTime === "number")
|
|
object.endTime = options.longs === String ? String(message.endTime) : message.endTime;
|
|
else
|
|
object.endTime = options.longs === String ? $util.Long.prototype.toString.call(message.endTime) : options.longs === Number ? new $util.LongBits(message.endTime.low >>> 0, message.endTime.high >>> 0).toNumber() : message.endTime;
|
|
if (message.delayed != null && message.hasOwnProperty("delayed"))
|
|
object.delayed = message.delayed;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgCreateVestingAccount to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccount
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgCreateVestingAccount.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgCreateVestingAccount;
|
|
})(v1beta1.MsgCreateVestingAccount || {});
|
|
|
|
v1beta1.MsgCreateVestingAccountResponse = (function(MsgCreateVestingAccountResponse) {
|
|
|
|
/**
|
|
* Properties of a MsgCreateVestingAccountResponse.
|
|
* @memberof cosmos.vesting.v1beta1
|
|
* @interface IMsgCreateVestingAccountResponse
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new MsgCreateVestingAccountResponse.
|
|
* @memberof cosmos.vesting.v1beta1
|
|
* @classdesc Represents a MsgCreateVestingAccountResponse.
|
|
* @implements IMsgCreateVestingAccountResponse
|
|
* @constructor
|
|
* @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse=} [properties] Properties to set
|
|
*/
|
|
function MsgCreateVestingAccountResponse(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new MsgCreateVestingAccountResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse
|
|
* @static
|
|
* @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse=} [properties] Properties to set
|
|
* @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse} MsgCreateVestingAccountResponse instance
|
|
*/
|
|
MsgCreateVestingAccountResponse.create = function create(properties) {
|
|
return new MsgCreateVestingAccountResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgCreateVestingAccountResponse message. Does not implicitly {@link cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse
|
|
* @static
|
|
* @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse} message MsgCreateVestingAccountResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgCreateVestingAccountResponse.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified MsgCreateVestingAccountResponse message, length delimited. Does not implicitly {@link cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse
|
|
* @static
|
|
* @param {cosmos.vesting.v1beta1.IMsgCreateVestingAccountResponse} message MsgCreateVestingAccountResponse message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
MsgCreateVestingAccountResponse.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgCreateVestingAccountResponse message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse} MsgCreateVestingAccountResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgCreateVestingAccountResponse.decode = 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.vesting.v1beta1.MsgCreateVestingAccountResponse();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a MsgCreateVestingAccountResponse message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse} MsgCreateVestingAccountResponse
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
MsgCreateVestingAccountResponse.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a MsgCreateVestingAccountResponse message.
|
|
* @function verify
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
MsgCreateVestingAccountResponse.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a MsgCreateVestingAccountResponse message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse} MsgCreateVestingAccountResponse
|
|
*/
|
|
MsgCreateVestingAccountResponse.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse)
|
|
return object;
|
|
return new $root.cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse();
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a MsgCreateVestingAccountResponse message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse
|
|
* @static
|
|
* @param {cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse} message MsgCreateVestingAccountResponse
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
MsgCreateVestingAccountResponse.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgCreateVestingAccountResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgCreateVestingAccountResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgCreateVestingAccountResponse;
|
|
})(v1beta1.MsgCreateVestingAccountResponse || {});
|
|
|
|
return v1beta1;
|
|
})(vesting.v1beta1 || {});
|
|
|
|
return vesting;
|
|
})(cosmos.vesting || {});
|
|
|
|
return cosmos;
|
|
})($root.cosmos || {});
|
|
|
|
/**
|
|
* Namespace google.
|
|
* @exports google
|
|
* @namespace
|
|
*/
|
|
|
|
$root.google = (function(google) {
|
|
|
|
/**
|
|
* Namespace protobuf.
|
|
* @memberof google
|
|
* @namespace
|
|
*/
|
|
|
|
google.protobuf = (function(protobuf) {
|
|
|
|
protobuf.Timestamp = (function(Timestamp) {
|
|
|
|
/**
|
|
* Properties of a Timestamp.
|
|
* @memberof google.protobuf
|
|
* @interface ITimestamp
|
|
* @property {number|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 {number|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;
|
|
|
|
/**
|
|
* Creates a new Timestamp instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.Timestamp
|
|
* @static
|
|
* @param {google.protobuf.ITimestamp=} [properties] Properties to set
|
|
* @returns {google.protobuf.Timestamp} Timestamp instance
|
|
*/
|
|
Timestamp.create = function create(properties) {
|
|
return new Timestamp(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
Timestamp.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Timestamp;
|
|
})(protobuf.Timestamp || {});
|
|
|
|
protobuf.Any = (function(Any) {
|
|
|
|
/**
|
|
* 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([]);
|
|
|
|
/**
|
|
* Creates a new Any instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.Any
|
|
* @static
|
|
* @param {google.protobuf.IAny=} [properties] Properties to set
|
|
* @returns {google.protobuf.Any} Any instance
|
|
*/
|
|
Any.create = function create(properties) {
|
|
return new Any(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
Any.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Any;
|
|
})(protobuf.Any || {});
|
|
|
|
protobuf.Duration = (function(Duration) {
|
|
|
|
/**
|
|
* Properties of a Duration.
|
|
* @memberof google.protobuf
|
|
* @interface IDuration
|
|
* @property {number|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 {number|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;
|
|
|
|
/**
|
|
* Creates a new Duration instance using the specified properties.
|
|
* @function create
|
|
* @memberof google.protobuf.Duration
|
|
* @static
|
|
* @param {google.protobuf.IDuration=} [properties] Properties to set
|
|
* @returns {google.protobuf.Duration} Duration instance
|
|
*/
|
|
Duration.create = function create(properties) {
|
|
return new Duration(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
Duration.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Duration;
|
|
})(protobuf.Duration || {});
|
|
|
|
return protobuf;
|
|
})(google.protobuf || {});
|
|
|
|
return google;
|
|
})($root.google || {});
|
|
|
|
/**
|
|
* Namespace tendermint.
|
|
* @exports tendermint
|
|
* @namespace
|
|
*/
|
|
|
|
$root.tendermint = (function(tendermint) {
|
|
|
|
/**
|
|
* Namespace abci.
|
|
* @memberof tendermint
|
|
* @namespace
|
|
*/
|
|
|
|
tendermint.abci = (function(abci) {
|
|
|
|
abci.Request = (function(Request) {
|
|
|
|
/**
|
|
* 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} [setOption] Request setOption
|
|
* @property {tendermint.abci.IRequestInitChain|null} [initChain] Request initChain
|
|
* @property {tendermint.abci.IRequestQuery|null} [query] Request query
|
|
* @property {tendermint.abci.IRequestBeginBlock|null} [beginBlock] Request beginBlock
|
|
* @property {tendermint.abci.IRequestCheckTx|null} [checkTx] Request checkTx
|
|
* @property {tendermint.abci.IRequestDeliverTx|null} [deliverTx] Request deliverTx
|
|
* @property {tendermint.abci.IRequestEndBlock|null} [endBlock] Request endBlock
|
|
* @property {tendermint.abci.IRequestCommit|null} [commit] Request commit
|
|
* @property {tendermint.abci.IRequestListSnapshots|null} [listSnapshots] Request listSnapshots
|
|
* @property {tendermint.abci.IRequestOfferSnapshot|null} [offerSnapshot] Request offerSnapshot
|
|
* @property {tendermint.abci.IRequestLoadSnapshotChunk|null} [loadSnapshotChunk] Request loadSnapshotChunk
|
|
* @property {tendermint.abci.IRequestApplySnapshotChunk|null} [applySnapshotChunk] Request applySnapshotChunk
|
|
*/
|
|
|
|
/**
|
|
* 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 setOption.
|
|
* @member {tendermint.abci.IRequestSetOption|null|undefined} setOption
|
|
* @memberof tendermint.abci.Request
|
|
* @instance
|
|
*/
|
|
Request.prototype.setOption = null;
|
|
|
|
/**
|
|
* Request initChain.
|
|
* @member {tendermint.abci.IRequestInitChain|null|undefined} initChain
|
|
* @memberof tendermint.abci.Request
|
|
* @instance
|
|
*/
|
|
Request.prototype.initChain = null;
|
|
|
|
/**
|
|
* Request query.
|
|
* @member {tendermint.abci.IRequestQuery|null|undefined} query
|
|
* @memberof tendermint.abci.Request
|
|
* @instance
|
|
*/
|
|
Request.prototype.query = null;
|
|
|
|
/**
|
|
* Request beginBlock.
|
|
* @member {tendermint.abci.IRequestBeginBlock|null|undefined} beginBlock
|
|
* @memberof tendermint.abci.Request
|
|
* @instance
|
|
*/
|
|
Request.prototype.beginBlock = null;
|
|
|
|
/**
|
|
* Request checkTx.
|
|
* @member {tendermint.abci.IRequestCheckTx|null|undefined} checkTx
|
|
* @memberof tendermint.abci.Request
|
|
* @instance
|
|
*/
|
|
Request.prototype.checkTx = null;
|
|
|
|
/**
|
|
* Request deliverTx.
|
|
* @member {tendermint.abci.IRequestDeliverTx|null|undefined} deliverTx
|
|
* @memberof tendermint.abci.Request
|
|
* @instance
|
|
*/
|
|
Request.prototype.deliverTx = null;
|
|
|
|
/**
|
|
* Request endBlock.
|
|
* @member {tendermint.abci.IRequestEndBlock|null|undefined} endBlock
|
|
* @memberof tendermint.abci.Request
|
|
* @instance
|
|
*/
|
|
Request.prototype.endBlock = null;
|
|
|
|
/**
|
|
* Request commit.
|
|
* @member {tendermint.abci.IRequestCommit|null|undefined} commit
|
|
* @memberof tendermint.abci.Request
|
|
* @instance
|
|
*/
|
|
Request.prototype.commit = null;
|
|
|
|
/**
|
|
* Request listSnapshots.
|
|
* @member {tendermint.abci.IRequestListSnapshots|null|undefined} listSnapshots
|
|
* @memberof tendermint.abci.Request
|
|
* @instance
|
|
*/
|
|
Request.prototype.listSnapshots = null;
|
|
|
|
/**
|
|
* Request offerSnapshot.
|
|
* @member {tendermint.abci.IRequestOfferSnapshot|null|undefined} offerSnapshot
|
|
* @memberof tendermint.abci.Request
|
|
* @instance
|
|
*/
|
|
Request.prototype.offerSnapshot = null;
|
|
|
|
/**
|
|
* Request loadSnapshotChunk.
|
|
* @member {tendermint.abci.IRequestLoadSnapshotChunk|null|undefined} loadSnapshotChunk
|
|
* @memberof tendermint.abci.Request
|
|
* @instance
|
|
*/
|
|
Request.prototype.loadSnapshotChunk = null;
|
|
|
|
/**
|
|
* Request applySnapshotChunk.
|
|
* @member {tendermint.abci.IRequestApplySnapshotChunk|null|undefined} applySnapshotChunk
|
|
* @memberof tendermint.abci.Request
|
|
* @instance
|
|
*/
|
|
Request.prototype.applySnapshotChunk = null;
|
|
|
|
// OneOf field names bound to virtual getters and setters
|
|
var $oneOfFields;
|
|
|
|
/**
|
|
* Request value.
|
|
* @member {"echo"|"flush"|"info"|"setOption"|"initChain"|"query"|"beginBlock"|"checkTx"|"deliverTx"|"endBlock"|"commit"|"listSnapshots"|"offerSnapshot"|"loadSnapshotChunk"|"applySnapshotChunk"|undefined} value
|
|
* @memberof tendermint.abci.Request
|
|
* @instance
|
|
*/
|
|
Object.defineProperty(Request.prototype, "value", {
|
|
get: $util.oneOfGetter($oneOfFields = ["echo", "flush", "info", "setOption", "initChain", "query", "beginBlock", "checkTx", "deliverTx", "endBlock", "commit", "listSnapshots", "offerSnapshot", "loadSnapshotChunk", "applySnapshotChunk"]),
|
|
set: $util.oneOfSetter($oneOfFields)
|
|
});
|
|
|
|
/**
|
|
* Creates a new Request instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.Request
|
|
* @static
|
|
* @param {tendermint.abci.IRequest=} [properties] Properties to set
|
|
* @returns {tendermint.abci.Request} Request instance
|
|
*/
|
|
Request.create = function create(properties) {
|
|
return new Request(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.setOption != null && Object.hasOwnProperty.call(message, "setOption"))
|
|
$root.tendermint.abci.RequestSetOption.encode(message.setOption, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
|
if (message.initChain != null && Object.hasOwnProperty.call(message, "initChain"))
|
|
$root.tendermint.abci.RequestInitChain.encode(message.initChain, 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.beginBlock != null && Object.hasOwnProperty.call(message, "beginBlock"))
|
|
$root.tendermint.abci.RequestBeginBlock.encode(message.beginBlock, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
|
if (message.checkTx != null && Object.hasOwnProperty.call(message, "checkTx"))
|
|
$root.tendermint.abci.RequestCheckTx.encode(message.checkTx, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
|
if (message.deliverTx != null && Object.hasOwnProperty.call(message, "deliverTx"))
|
|
$root.tendermint.abci.RequestDeliverTx.encode(message.deliverTx, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
|
|
if (message.endBlock != null && Object.hasOwnProperty.call(message, "endBlock"))
|
|
$root.tendermint.abci.RequestEndBlock.encode(message.endBlock, 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.listSnapshots != null && Object.hasOwnProperty.call(message, "listSnapshots"))
|
|
$root.tendermint.abci.RequestListSnapshots.encode(message.listSnapshots, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
|
|
if (message.offerSnapshot != null && Object.hasOwnProperty.call(message, "offerSnapshot"))
|
|
$root.tendermint.abci.RequestOfferSnapshot.encode(message.offerSnapshot, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim();
|
|
if (message.loadSnapshotChunk != null && Object.hasOwnProperty.call(message, "loadSnapshotChunk"))
|
|
$root.tendermint.abci.RequestLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();
|
|
if (message.applySnapshotChunk != null && Object.hasOwnProperty.call(message, "applySnapshotChunk"))
|
|
$root.tendermint.abci.RequestApplySnapshotChunk.encode(message.applySnapshotChunk, 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.setOption = $root.tendermint.abci.RequestSetOption.decode(reader, reader.uint32());
|
|
break;
|
|
case 5:
|
|
message.initChain = $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.beginBlock = $root.tendermint.abci.RequestBeginBlock.decode(reader, reader.uint32());
|
|
break;
|
|
case 8:
|
|
message.checkTx = $root.tendermint.abci.RequestCheckTx.decode(reader, reader.uint32());
|
|
break;
|
|
case 9:
|
|
message.deliverTx = $root.tendermint.abci.RequestDeliverTx.decode(reader, reader.uint32());
|
|
break;
|
|
case 10:
|
|
message.endBlock = $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.listSnapshots = $root.tendermint.abci.RequestListSnapshots.decode(reader, reader.uint32());
|
|
break;
|
|
case 13:
|
|
message.offerSnapshot = $root.tendermint.abci.RequestOfferSnapshot.decode(reader, reader.uint32());
|
|
break;
|
|
case 14:
|
|
message.loadSnapshotChunk = $root.tendermint.abci.RequestLoadSnapshotChunk.decode(reader, reader.uint32());
|
|
break;
|
|
case 15:
|
|
message.applySnapshotChunk = $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.<string,*>} 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.setOption != null && message.hasOwnProperty("setOption")) {
|
|
if (properties.value === 1)
|
|
return "value: multiple values";
|
|
properties.value = 1;
|
|
{
|
|
var error = $root.tendermint.abci.RequestSetOption.verify(message.setOption);
|
|
if (error)
|
|
return "setOption." + error;
|
|
}
|
|
}
|
|
if (message.initChain != null && message.hasOwnProperty("initChain")) {
|
|
if (properties.value === 1)
|
|
return "value: multiple values";
|
|
properties.value = 1;
|
|
{
|
|
var error = $root.tendermint.abci.RequestInitChain.verify(message.initChain);
|
|
if (error)
|
|
return "initChain." + 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.beginBlock != null && message.hasOwnProperty("beginBlock")) {
|
|
if (properties.value === 1)
|
|
return "value: multiple values";
|
|
properties.value = 1;
|
|
{
|
|
var error = $root.tendermint.abci.RequestBeginBlock.verify(message.beginBlock);
|
|
if (error)
|
|
return "beginBlock." + error;
|
|
}
|
|
}
|
|
if (message.checkTx != null && message.hasOwnProperty("checkTx")) {
|
|
if (properties.value === 1)
|
|
return "value: multiple values";
|
|
properties.value = 1;
|
|
{
|
|
var error = $root.tendermint.abci.RequestCheckTx.verify(message.checkTx);
|
|
if (error)
|
|
return "checkTx." + error;
|
|
}
|
|
}
|
|
if (message.deliverTx != null && message.hasOwnProperty("deliverTx")) {
|
|
if (properties.value === 1)
|
|
return "value: multiple values";
|
|
properties.value = 1;
|
|
{
|
|
var error = $root.tendermint.abci.RequestDeliverTx.verify(message.deliverTx);
|
|
if (error)
|
|
return "deliverTx." + error;
|
|
}
|
|
}
|
|
if (message.endBlock != null && message.hasOwnProperty("endBlock")) {
|
|
if (properties.value === 1)
|
|
return "value: multiple values";
|
|
properties.value = 1;
|
|
{
|
|
var error = $root.tendermint.abci.RequestEndBlock.verify(message.endBlock);
|
|
if (error)
|
|
return "endBlock." + 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.listSnapshots != null && message.hasOwnProperty("listSnapshots")) {
|
|
if (properties.value === 1)
|
|
return "value: multiple values";
|
|
properties.value = 1;
|
|
{
|
|
var error = $root.tendermint.abci.RequestListSnapshots.verify(message.listSnapshots);
|
|
if (error)
|
|
return "listSnapshots." + error;
|
|
}
|
|
}
|
|
if (message.offerSnapshot != null && message.hasOwnProperty("offerSnapshot")) {
|
|
if (properties.value === 1)
|
|
return "value: multiple values";
|
|
properties.value = 1;
|
|
{
|
|
var error = $root.tendermint.abci.RequestOfferSnapshot.verify(message.offerSnapshot);
|
|
if (error)
|
|
return "offerSnapshot." + error;
|
|
}
|
|
}
|
|
if (message.loadSnapshotChunk != null && message.hasOwnProperty("loadSnapshotChunk")) {
|
|
if (properties.value === 1)
|
|
return "value: multiple values";
|
|
properties.value = 1;
|
|
{
|
|
var error = $root.tendermint.abci.RequestLoadSnapshotChunk.verify(message.loadSnapshotChunk);
|
|
if (error)
|
|
return "loadSnapshotChunk." + error;
|
|
}
|
|
}
|
|
if (message.applySnapshotChunk != null && message.hasOwnProperty("applySnapshotChunk")) {
|
|
if (properties.value === 1)
|
|
return "value: multiple values";
|
|
properties.value = 1;
|
|
{
|
|
var error = $root.tendermint.abci.RequestApplySnapshotChunk.verify(message.applySnapshotChunk);
|
|
if (error)
|
|
return "applySnapshotChunk." + 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.<string,*>} 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.setOption != null) {
|
|
if (typeof object.setOption !== "object")
|
|
throw TypeError(".tendermint.abci.Request.setOption: object expected");
|
|
message.setOption = $root.tendermint.abci.RequestSetOption.fromObject(object.setOption);
|
|
}
|
|
if (object.initChain != null) {
|
|
if (typeof object.initChain !== "object")
|
|
throw TypeError(".tendermint.abci.Request.initChain: object expected");
|
|
message.initChain = $root.tendermint.abci.RequestInitChain.fromObject(object.initChain);
|
|
}
|
|
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.beginBlock != null) {
|
|
if (typeof object.beginBlock !== "object")
|
|
throw TypeError(".tendermint.abci.Request.beginBlock: object expected");
|
|
message.beginBlock = $root.tendermint.abci.RequestBeginBlock.fromObject(object.beginBlock);
|
|
}
|
|
if (object.checkTx != null) {
|
|
if (typeof object.checkTx !== "object")
|
|
throw TypeError(".tendermint.abci.Request.checkTx: object expected");
|
|
message.checkTx = $root.tendermint.abci.RequestCheckTx.fromObject(object.checkTx);
|
|
}
|
|
if (object.deliverTx != null) {
|
|
if (typeof object.deliverTx !== "object")
|
|
throw TypeError(".tendermint.abci.Request.deliverTx: object expected");
|
|
message.deliverTx = $root.tendermint.abci.RequestDeliverTx.fromObject(object.deliverTx);
|
|
}
|
|
if (object.endBlock != null) {
|
|
if (typeof object.endBlock !== "object")
|
|
throw TypeError(".tendermint.abci.Request.endBlock: object expected");
|
|
message.endBlock = $root.tendermint.abci.RequestEndBlock.fromObject(object.endBlock);
|
|
}
|
|
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.listSnapshots != null) {
|
|
if (typeof object.listSnapshots !== "object")
|
|
throw TypeError(".tendermint.abci.Request.listSnapshots: object expected");
|
|
message.listSnapshots = $root.tendermint.abci.RequestListSnapshots.fromObject(object.listSnapshots);
|
|
}
|
|
if (object.offerSnapshot != null) {
|
|
if (typeof object.offerSnapshot !== "object")
|
|
throw TypeError(".tendermint.abci.Request.offerSnapshot: object expected");
|
|
message.offerSnapshot = $root.tendermint.abci.RequestOfferSnapshot.fromObject(object.offerSnapshot);
|
|
}
|
|
if (object.loadSnapshotChunk != null) {
|
|
if (typeof object.loadSnapshotChunk !== "object")
|
|
throw TypeError(".tendermint.abci.Request.loadSnapshotChunk: object expected");
|
|
message.loadSnapshotChunk = $root.tendermint.abci.RequestLoadSnapshotChunk.fromObject(object.loadSnapshotChunk);
|
|
}
|
|
if (object.applySnapshotChunk != null) {
|
|
if (typeof object.applySnapshotChunk !== "object")
|
|
throw TypeError(".tendermint.abci.Request.applySnapshotChunk: object expected");
|
|
message.applySnapshotChunk = $root.tendermint.abci.RequestApplySnapshotChunk.fromObject(object.applySnapshotChunk);
|
|
}
|
|
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.<string,*>} 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.setOption != null && message.hasOwnProperty("setOption")) {
|
|
object.setOption = $root.tendermint.abci.RequestSetOption.toObject(message.setOption, options);
|
|
if (options.oneofs)
|
|
object.value = "setOption";
|
|
}
|
|
if (message.initChain != null && message.hasOwnProperty("initChain")) {
|
|
object.initChain = $root.tendermint.abci.RequestInitChain.toObject(message.initChain, options);
|
|
if (options.oneofs)
|
|
object.value = "initChain";
|
|
}
|
|
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.beginBlock != null && message.hasOwnProperty("beginBlock")) {
|
|
object.beginBlock = $root.tendermint.abci.RequestBeginBlock.toObject(message.beginBlock, options);
|
|
if (options.oneofs)
|
|
object.value = "beginBlock";
|
|
}
|
|
if (message.checkTx != null && message.hasOwnProperty("checkTx")) {
|
|
object.checkTx = $root.tendermint.abci.RequestCheckTx.toObject(message.checkTx, options);
|
|
if (options.oneofs)
|
|
object.value = "checkTx";
|
|
}
|
|
if (message.deliverTx != null && message.hasOwnProperty("deliverTx")) {
|
|
object.deliverTx = $root.tendermint.abci.RequestDeliverTx.toObject(message.deliverTx, options);
|
|
if (options.oneofs)
|
|
object.value = "deliverTx";
|
|
}
|
|
if (message.endBlock != null && message.hasOwnProperty("endBlock")) {
|
|
object.endBlock = $root.tendermint.abci.RequestEndBlock.toObject(message.endBlock, options);
|
|
if (options.oneofs)
|
|
object.value = "endBlock";
|
|
}
|
|
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.listSnapshots != null && message.hasOwnProperty("listSnapshots")) {
|
|
object.listSnapshots = $root.tendermint.abci.RequestListSnapshots.toObject(message.listSnapshots, options);
|
|
if (options.oneofs)
|
|
object.value = "listSnapshots";
|
|
}
|
|
if (message.offerSnapshot != null && message.hasOwnProperty("offerSnapshot")) {
|
|
object.offerSnapshot = $root.tendermint.abci.RequestOfferSnapshot.toObject(message.offerSnapshot, options);
|
|
if (options.oneofs)
|
|
object.value = "offerSnapshot";
|
|
}
|
|
if (message.loadSnapshotChunk != null && message.hasOwnProperty("loadSnapshotChunk")) {
|
|
object.loadSnapshotChunk = $root.tendermint.abci.RequestLoadSnapshotChunk.toObject(message.loadSnapshotChunk, options);
|
|
if (options.oneofs)
|
|
object.value = "loadSnapshotChunk";
|
|
}
|
|
if (message.applySnapshotChunk != null && message.hasOwnProperty("applySnapshotChunk")) {
|
|
object.applySnapshotChunk = $root.tendermint.abci.RequestApplySnapshotChunk.toObject(message.applySnapshotChunk, options);
|
|
if (options.oneofs)
|
|
object.value = "applySnapshotChunk";
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Request to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.abci.Request
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Request.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Request;
|
|
})(abci.Request || {});
|
|
|
|
abci.RequestEcho = (function(RequestEcho) {
|
|
|
|
/**
|
|
* 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 = "";
|
|
|
|
/**
|
|
* Creates a new RequestEcho instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.RequestEcho
|
|
* @static
|
|
* @param {tendermint.abci.IRequestEcho=} [properties] Properties to set
|
|
* @returns {tendermint.abci.RequestEcho} RequestEcho instance
|
|
*/
|
|
RequestEcho.create = function create(properties) {
|
|
return new RequestEcho(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
RequestEcho.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return RequestEcho;
|
|
})(abci.RequestEcho || {});
|
|
|
|
abci.RequestFlush = (function(RequestFlush) {
|
|
|
|
/**
|
|
* 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]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new RequestFlush instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.RequestFlush
|
|
* @static
|
|
* @param {tendermint.abci.IRequestFlush=} [properties] Properties to set
|
|
* @returns {tendermint.abci.RequestFlush} RequestFlush instance
|
|
*/
|
|
RequestFlush.create = function create(properties) {
|
|
return new RequestFlush(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} Plain object
|
|
*/
|
|
RequestFlush.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this RequestFlush to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.abci.RequestFlush
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
RequestFlush.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return RequestFlush;
|
|
})(abci.RequestFlush || {});
|
|
|
|
abci.RequestInfo = (function(RequestInfo) {
|
|
|
|
/**
|
|
* Properties of a RequestInfo.
|
|
* @memberof tendermint.abci
|
|
* @interface IRequestInfo
|
|
* @property {string|null} [version] RequestInfo version
|
|
* @property {number|Long|null} [blockVersion] RequestInfo blockVersion
|
|
* @property {number|Long|null} [p2pVersion] RequestInfo p2pVersion
|
|
*/
|
|
|
|
/**
|
|
* 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 blockVersion.
|
|
* @member {number|Long} blockVersion
|
|
* @memberof tendermint.abci.RequestInfo
|
|
* @instance
|
|
*/
|
|
RequestInfo.prototype.blockVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* RequestInfo p2pVersion.
|
|
* @member {number|Long} p2pVersion
|
|
* @memberof tendermint.abci.RequestInfo
|
|
* @instance
|
|
*/
|
|
RequestInfo.prototype.p2pVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* Creates a new RequestInfo instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.RequestInfo
|
|
* @static
|
|
* @param {tendermint.abci.IRequestInfo=} [properties] Properties to set
|
|
* @returns {tendermint.abci.RequestInfo} RequestInfo instance
|
|
*/
|
|
RequestInfo.create = function create(properties) {
|
|
return new RequestInfo(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.blockVersion != null && Object.hasOwnProperty.call(message, "blockVersion"))
|
|
writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.blockVersion);
|
|
if (message.p2pVersion != null && Object.hasOwnProperty.call(message, "p2pVersion"))
|
|
writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.p2pVersion);
|
|
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.blockVersion = reader.uint64();
|
|
break;
|
|
case 3:
|
|
message.p2pVersion = 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.<string,*>} 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.blockVersion != null && message.hasOwnProperty("blockVersion"))
|
|
if (!$util.isInteger(message.blockVersion) && !(message.blockVersion && $util.isInteger(message.blockVersion.low) && $util.isInteger(message.blockVersion.high)))
|
|
return "blockVersion: integer|Long expected";
|
|
if (message.p2pVersion != null && message.hasOwnProperty("p2pVersion"))
|
|
if (!$util.isInteger(message.p2pVersion) && !(message.p2pVersion && $util.isInteger(message.p2pVersion.low) && $util.isInteger(message.p2pVersion.high)))
|
|
return "p2pVersion: 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.<string,*>} 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.blockVersion != null)
|
|
if ($util.Long)
|
|
(message.blockVersion = $util.Long.fromValue(object.blockVersion)).unsigned = true;
|
|
else if (typeof object.blockVersion === "string")
|
|
message.blockVersion = parseInt(object.blockVersion, 10);
|
|
else if (typeof object.blockVersion === "number")
|
|
message.blockVersion = object.blockVersion;
|
|
else if (typeof object.blockVersion === "object")
|
|
message.blockVersion = new $util.LongBits(object.blockVersion.low >>> 0, object.blockVersion.high >>> 0).toNumber(true);
|
|
if (object.p2pVersion != null)
|
|
if ($util.Long)
|
|
(message.p2pVersion = $util.Long.fromValue(object.p2pVersion)).unsigned = true;
|
|
else if (typeof object.p2pVersion === "string")
|
|
message.p2pVersion = parseInt(object.p2pVersion, 10);
|
|
else if (typeof object.p2pVersion === "number")
|
|
message.p2pVersion = object.p2pVersion;
|
|
else if (typeof object.p2pVersion === "object")
|
|
message.p2pVersion = new $util.LongBits(object.p2pVersion.low >>> 0, object.p2pVersion.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.<string,*>} 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.blockVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.blockVersion = options.longs === String ? "0" : 0;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, true);
|
|
object.p2pVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.p2pVersion = options.longs === String ? "0" : 0;
|
|
}
|
|
if (message.version != null && message.hasOwnProperty("version"))
|
|
object.version = message.version;
|
|
if (message.blockVersion != null && message.hasOwnProperty("blockVersion"))
|
|
if (typeof message.blockVersion === "number")
|
|
object.blockVersion = options.longs === String ? String(message.blockVersion) : message.blockVersion;
|
|
else
|
|
object.blockVersion = options.longs === String ? $util.Long.prototype.toString.call(message.blockVersion) : options.longs === Number ? new $util.LongBits(message.blockVersion.low >>> 0, message.blockVersion.high >>> 0).toNumber(true) : message.blockVersion;
|
|
if (message.p2pVersion != null && message.hasOwnProperty("p2pVersion"))
|
|
if (typeof message.p2pVersion === "number")
|
|
object.p2pVersion = options.longs === String ? String(message.p2pVersion) : message.p2pVersion;
|
|
else
|
|
object.p2pVersion = options.longs === String ? $util.Long.prototype.toString.call(message.p2pVersion) : options.longs === Number ? new $util.LongBits(message.p2pVersion.low >>> 0, message.p2pVersion.high >>> 0).toNumber(true) : message.p2pVersion;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this RequestInfo to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.abci.RequestInfo
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
RequestInfo.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return RequestInfo;
|
|
})(abci.RequestInfo || {});
|
|
|
|
abci.RequestSetOption = (function(RequestSetOption) {
|
|
|
|
/**
|
|
* 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 = "";
|
|
|
|
/**
|
|
* Creates a new RequestSetOption instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.RequestSetOption
|
|
* @static
|
|
* @param {tendermint.abci.IRequestSetOption=} [properties] Properties to set
|
|
* @returns {tendermint.abci.RequestSetOption} RequestSetOption instance
|
|
*/
|
|
RequestSetOption.create = function create(properties) {
|
|
return new RequestSetOption(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
RequestSetOption.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return RequestSetOption;
|
|
})(abci.RequestSetOption || {});
|
|
|
|
abci.RequestInitChain = (function(RequestInitChain) {
|
|
|
|
/**
|
|
* Properties of a RequestInitChain.
|
|
* @memberof tendermint.abci
|
|
* @interface IRequestInitChain
|
|
* @property {google.protobuf.ITimestamp|null} [time] RequestInitChain time
|
|
* @property {string|null} [chainId] RequestInitChain chainId
|
|
* @property {tendermint.abci.IConsensusParams|null} [consensusParams] RequestInitChain consensusParams
|
|
* @property {Array.<tendermint.abci.IValidatorUpdate>|null} [validators] RequestInitChain validators
|
|
* @property {Uint8Array|null} [appStateBytes] RequestInitChain appStateBytes
|
|
* @property {number|Long|null} [initialHeight] RequestInitChain initialHeight
|
|
*/
|
|
|
|
/**
|
|
* 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 chainId.
|
|
* @member {string} chainId
|
|
* @memberof tendermint.abci.RequestInitChain
|
|
* @instance
|
|
*/
|
|
RequestInitChain.prototype.chainId = "";
|
|
|
|
/**
|
|
* RequestInitChain consensusParams.
|
|
* @member {tendermint.abci.IConsensusParams|null|undefined} consensusParams
|
|
* @memberof tendermint.abci.RequestInitChain
|
|
* @instance
|
|
*/
|
|
RequestInitChain.prototype.consensusParams = null;
|
|
|
|
/**
|
|
* RequestInitChain validators.
|
|
* @member {Array.<tendermint.abci.IValidatorUpdate>} validators
|
|
* @memberof tendermint.abci.RequestInitChain
|
|
* @instance
|
|
*/
|
|
RequestInitChain.prototype.validators = $util.emptyArray;
|
|
|
|
/**
|
|
* RequestInitChain appStateBytes.
|
|
* @member {Uint8Array} appStateBytes
|
|
* @memberof tendermint.abci.RequestInitChain
|
|
* @instance
|
|
*/
|
|
RequestInitChain.prototype.appStateBytes = $util.newBuffer([]);
|
|
|
|
/**
|
|
* RequestInitChain initialHeight.
|
|
* @member {number|Long} initialHeight
|
|
* @memberof tendermint.abci.RequestInitChain
|
|
* @instance
|
|
*/
|
|
RequestInitChain.prototype.initialHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* Creates a new RequestInitChain instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.RequestInitChain
|
|
* @static
|
|
* @param {tendermint.abci.IRequestInitChain=} [properties] Properties to set
|
|
* @returns {tendermint.abci.RequestInitChain} RequestInitChain instance
|
|
*/
|
|
RequestInitChain.create = function create(properties) {
|
|
return new RequestInitChain(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.chainId != null && Object.hasOwnProperty.call(message, "chainId"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.chainId);
|
|
if (message.consensusParams != null && Object.hasOwnProperty.call(message, "consensusParams"))
|
|
$root.tendermint.abci.ConsensusParams.encode(message.consensusParams, 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.appStateBytes != null && Object.hasOwnProperty.call(message, "appStateBytes"))
|
|
writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.appStateBytes);
|
|
if (message.initialHeight != null && Object.hasOwnProperty.call(message, "initialHeight"))
|
|
writer.uint32(/* id 6, wireType 0 =*/48).int64(message.initialHeight);
|
|
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.chainId = reader.string();
|
|
break;
|
|
case 3:
|
|
message.consensusParams = $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.appStateBytes = reader.bytes();
|
|
break;
|
|
case 6:
|
|
message.initialHeight = 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.<string,*>} 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.chainId != null && message.hasOwnProperty("chainId"))
|
|
if (!$util.isString(message.chainId))
|
|
return "chainId: string expected";
|
|
if (message.consensusParams != null && message.hasOwnProperty("consensusParams")) {
|
|
var error = $root.tendermint.abci.ConsensusParams.verify(message.consensusParams);
|
|
if (error)
|
|
return "consensusParams." + 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.appStateBytes != null && message.hasOwnProperty("appStateBytes"))
|
|
if (!(message.appStateBytes && typeof message.appStateBytes.length === "number" || $util.isString(message.appStateBytes)))
|
|
return "appStateBytes: buffer expected";
|
|
if (message.initialHeight != null && message.hasOwnProperty("initialHeight"))
|
|
if (!$util.isInteger(message.initialHeight) && !(message.initialHeight && $util.isInteger(message.initialHeight.low) && $util.isInteger(message.initialHeight.high)))
|
|
return "initialHeight: 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.<string,*>} 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.chainId != null)
|
|
message.chainId = String(object.chainId);
|
|
if (object.consensusParams != null) {
|
|
if (typeof object.consensusParams !== "object")
|
|
throw TypeError(".tendermint.abci.RequestInitChain.consensusParams: object expected");
|
|
message.consensusParams = $root.tendermint.abci.ConsensusParams.fromObject(object.consensusParams);
|
|
}
|
|
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.appStateBytes != null)
|
|
if (typeof object.appStateBytes === "string")
|
|
$util.base64.decode(object.appStateBytes, message.appStateBytes = $util.newBuffer($util.base64.length(object.appStateBytes)), 0);
|
|
else if (object.appStateBytes.length)
|
|
message.appStateBytes = object.appStateBytes;
|
|
if (object.initialHeight != null)
|
|
if ($util.Long)
|
|
(message.initialHeight = $util.Long.fromValue(object.initialHeight)).unsigned = false;
|
|
else if (typeof object.initialHeight === "string")
|
|
message.initialHeight = parseInt(object.initialHeight, 10);
|
|
else if (typeof object.initialHeight === "number")
|
|
message.initialHeight = object.initialHeight;
|
|
else if (typeof object.initialHeight === "object")
|
|
message.initialHeight = new $util.LongBits(object.initialHeight.low >>> 0, object.initialHeight.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.<string,*>} 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.chainId = "";
|
|
object.consensusParams = null;
|
|
if (options.bytes === String)
|
|
object.appStateBytes = "";
|
|
else {
|
|
object.appStateBytes = [];
|
|
if (options.bytes !== Array)
|
|
object.appStateBytes = $util.newBuffer(object.appStateBytes);
|
|
}
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.initialHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.initialHeight = options.longs === String ? "0" : 0;
|
|
}
|
|
if (message.time != null && message.hasOwnProperty("time"))
|
|
object.time = $root.google.protobuf.Timestamp.toObject(message.time, options);
|
|
if (message.chainId != null && message.hasOwnProperty("chainId"))
|
|
object.chainId = message.chainId;
|
|
if (message.consensusParams != null && message.hasOwnProperty("consensusParams"))
|
|
object.consensusParams = $root.tendermint.abci.ConsensusParams.toObject(message.consensusParams, 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.appStateBytes != null && message.hasOwnProperty("appStateBytes"))
|
|
object.appStateBytes = options.bytes === String ? $util.base64.encode(message.appStateBytes, 0, message.appStateBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.appStateBytes) : message.appStateBytes;
|
|
if (message.initialHeight != null && message.hasOwnProperty("initialHeight"))
|
|
if (typeof message.initialHeight === "number")
|
|
object.initialHeight = options.longs === String ? String(message.initialHeight) : message.initialHeight;
|
|
else
|
|
object.initialHeight = options.longs === String ? $util.Long.prototype.toString.call(message.initialHeight) : options.longs === Number ? new $util.LongBits(message.initialHeight.low >>> 0, message.initialHeight.high >>> 0).toNumber() : message.initialHeight;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this RequestInitChain to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.abci.RequestInitChain
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
RequestInitChain.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return RequestInitChain;
|
|
})(abci.RequestInitChain || {});
|
|
|
|
abci.RequestQuery = (function(RequestQuery) {
|
|
|
|
/**
|
|
* Properties of a RequestQuery.
|
|
* @memberof tendermint.abci
|
|
* @interface IRequestQuery
|
|
* @property {Uint8Array|null} [data] RequestQuery data
|
|
* @property {string|null} [path] RequestQuery path
|
|
* @property {number|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 {number|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;
|
|
|
|
/**
|
|
* Creates a new RequestQuery instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.RequestQuery
|
|
* @static
|
|
* @param {tendermint.abci.IRequestQuery=} [properties] Properties to set
|
|
* @returns {tendermint.abci.RequestQuery} RequestQuery instance
|
|
*/
|
|
RequestQuery.create = function create(properties) {
|
|
return new RequestQuery(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
RequestQuery.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return RequestQuery;
|
|
})(abci.RequestQuery || {});
|
|
|
|
abci.RequestBeginBlock = (function(RequestBeginBlock) {
|
|
|
|
/**
|
|
* 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} [lastCommitInfo] RequestBeginBlock lastCommitInfo
|
|
* @property {Array.<tendermint.abci.IEvidence>|null} [byzantineValidators] RequestBeginBlock byzantineValidators
|
|
*/
|
|
|
|
/**
|
|
* 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.byzantineValidators = [];
|
|
if (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 lastCommitInfo.
|
|
* @member {tendermint.abci.ILastCommitInfo|null|undefined} lastCommitInfo
|
|
* @memberof tendermint.abci.RequestBeginBlock
|
|
* @instance
|
|
*/
|
|
RequestBeginBlock.prototype.lastCommitInfo = null;
|
|
|
|
/**
|
|
* RequestBeginBlock byzantineValidators.
|
|
* @member {Array.<tendermint.abci.IEvidence>} byzantineValidators
|
|
* @memberof tendermint.abci.RequestBeginBlock
|
|
* @instance
|
|
*/
|
|
RequestBeginBlock.prototype.byzantineValidators = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new RequestBeginBlock instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.RequestBeginBlock
|
|
* @static
|
|
* @param {tendermint.abci.IRequestBeginBlock=} [properties] Properties to set
|
|
* @returns {tendermint.abci.RequestBeginBlock} RequestBeginBlock instance
|
|
*/
|
|
RequestBeginBlock.create = function create(properties) {
|
|
return new RequestBeginBlock(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.lastCommitInfo != null && Object.hasOwnProperty.call(message, "lastCommitInfo"))
|
|
$root.tendermint.abci.LastCommitInfo.encode(message.lastCommitInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
|
if (message.byzantineValidators != null && message.byzantineValidators.length)
|
|
for (var i = 0; i < message.byzantineValidators.length; ++i)
|
|
$root.tendermint.abci.Evidence.encode(message.byzantineValidators[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.lastCommitInfo = $root.tendermint.abci.LastCommitInfo.decode(reader, reader.uint32());
|
|
break;
|
|
case 4:
|
|
if (!(message.byzantineValidators && message.byzantineValidators.length))
|
|
message.byzantineValidators = [];
|
|
message.byzantineValidators.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.<string,*>} 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.lastCommitInfo != null && message.hasOwnProperty("lastCommitInfo")) {
|
|
var error = $root.tendermint.abci.LastCommitInfo.verify(message.lastCommitInfo);
|
|
if (error)
|
|
return "lastCommitInfo." + error;
|
|
}
|
|
if (message.byzantineValidators != null && message.hasOwnProperty("byzantineValidators")) {
|
|
if (!Array.isArray(message.byzantineValidators))
|
|
return "byzantineValidators: array expected";
|
|
for (var i = 0; i < message.byzantineValidators.length; ++i) {
|
|
var error = $root.tendermint.abci.Evidence.verify(message.byzantineValidators[i]);
|
|
if (error)
|
|
return "byzantineValidators." + 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.<string,*>} 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.lastCommitInfo != null) {
|
|
if (typeof object.lastCommitInfo !== "object")
|
|
throw TypeError(".tendermint.abci.RequestBeginBlock.lastCommitInfo: object expected");
|
|
message.lastCommitInfo = $root.tendermint.abci.LastCommitInfo.fromObject(object.lastCommitInfo);
|
|
}
|
|
if (object.byzantineValidators) {
|
|
if (!Array.isArray(object.byzantineValidators))
|
|
throw TypeError(".tendermint.abci.RequestBeginBlock.byzantineValidators: array expected");
|
|
message.byzantineValidators = [];
|
|
for (var i = 0; i < object.byzantineValidators.length; ++i) {
|
|
if (typeof object.byzantineValidators[i] !== "object")
|
|
throw TypeError(".tendermint.abci.RequestBeginBlock.byzantineValidators: object expected");
|
|
message.byzantineValidators[i] = $root.tendermint.abci.Evidence.fromObject(object.byzantineValidators[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.<string,*>} Plain object
|
|
*/
|
|
RequestBeginBlock.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.byzantineValidators = [];
|
|
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.lastCommitInfo = 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.lastCommitInfo != null && message.hasOwnProperty("lastCommitInfo"))
|
|
object.lastCommitInfo = $root.tendermint.abci.LastCommitInfo.toObject(message.lastCommitInfo, options);
|
|
if (message.byzantineValidators && message.byzantineValidators.length) {
|
|
object.byzantineValidators = [];
|
|
for (var j = 0; j < message.byzantineValidators.length; ++j)
|
|
object.byzantineValidators[j] = $root.tendermint.abci.Evidence.toObject(message.byzantineValidators[j], options);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this RequestBeginBlock to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.abci.RequestBeginBlock
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
RequestBeginBlock.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return RequestBeginBlock;
|
|
})(abci.RequestBeginBlock || {});
|
|
|
|
/**
|
|
* CheckTxType enum.
|
|
* @name tendermint.abci.CheckTxType
|
|
* @enum {string}
|
|
* @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(RequestCheckTx) {
|
|
|
|
/**
|
|
* 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;
|
|
|
|
/**
|
|
* Creates a new RequestCheckTx instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.RequestCheckTx
|
|
* @static
|
|
* @param {tendermint.abci.IRequestCheckTx=} [properties] Properties to set
|
|
* @returns {tendermint.abci.RequestCheckTx} RequestCheckTx instance
|
|
*/
|
|
RequestCheckTx.create = function create(properties) {
|
|
return new RequestCheckTx(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
RequestCheckTx.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return RequestCheckTx;
|
|
})(abci.RequestCheckTx || {});
|
|
|
|
abci.RequestDeliverTx = (function(RequestDeliverTx) {
|
|
|
|
/**
|
|
* 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([]);
|
|
|
|
/**
|
|
* Creates a new RequestDeliverTx instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.RequestDeliverTx
|
|
* @static
|
|
* @param {tendermint.abci.IRequestDeliverTx=} [properties] Properties to set
|
|
* @returns {tendermint.abci.RequestDeliverTx} RequestDeliverTx instance
|
|
*/
|
|
RequestDeliverTx.create = function create(properties) {
|
|
return new RequestDeliverTx(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
RequestDeliverTx.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return RequestDeliverTx;
|
|
})(abci.RequestDeliverTx || {});
|
|
|
|
abci.RequestEndBlock = (function(RequestEndBlock) {
|
|
|
|
/**
|
|
* Properties of a RequestEndBlock.
|
|
* @memberof tendermint.abci
|
|
* @interface IRequestEndBlock
|
|
* @property {number|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 {number|Long} height
|
|
* @memberof tendermint.abci.RequestEndBlock
|
|
* @instance
|
|
*/
|
|
RequestEndBlock.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* Creates a new RequestEndBlock instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.RequestEndBlock
|
|
* @static
|
|
* @param {tendermint.abci.IRequestEndBlock=} [properties] Properties to set
|
|
* @returns {tendermint.abci.RequestEndBlock} RequestEndBlock instance
|
|
*/
|
|
RequestEndBlock.create = function create(properties) {
|
|
return new RequestEndBlock(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
RequestEndBlock.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return RequestEndBlock;
|
|
})(abci.RequestEndBlock || {});
|
|
|
|
abci.RequestCommit = (function(RequestCommit) {
|
|
|
|
/**
|
|
* 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]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new RequestCommit instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.RequestCommit
|
|
* @static
|
|
* @param {tendermint.abci.IRequestCommit=} [properties] Properties to set
|
|
* @returns {tendermint.abci.RequestCommit} RequestCommit instance
|
|
*/
|
|
RequestCommit.create = function create(properties) {
|
|
return new RequestCommit(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} Plain object
|
|
*/
|
|
RequestCommit.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this RequestCommit to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.abci.RequestCommit
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
RequestCommit.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return RequestCommit;
|
|
})(abci.RequestCommit || {});
|
|
|
|
abci.RequestListSnapshots = (function(RequestListSnapshots) {
|
|
|
|
/**
|
|
* 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]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new RequestListSnapshots instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.RequestListSnapshots
|
|
* @static
|
|
* @param {tendermint.abci.IRequestListSnapshots=} [properties] Properties to set
|
|
* @returns {tendermint.abci.RequestListSnapshots} RequestListSnapshots instance
|
|
*/
|
|
RequestListSnapshots.create = function create(properties) {
|
|
return new RequestListSnapshots(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} Plain object
|
|
*/
|
|
RequestListSnapshots.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this RequestListSnapshots to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.abci.RequestListSnapshots
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
RequestListSnapshots.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return RequestListSnapshots;
|
|
})(abci.RequestListSnapshots || {});
|
|
|
|
abci.RequestOfferSnapshot = (function(RequestOfferSnapshot) {
|
|
|
|
/**
|
|
* Properties of a RequestOfferSnapshot.
|
|
* @memberof tendermint.abci
|
|
* @interface IRequestOfferSnapshot
|
|
* @property {tendermint.abci.ISnapshot|null} [snapshot] RequestOfferSnapshot snapshot
|
|
* @property {Uint8Array|null} [appHash] RequestOfferSnapshot appHash
|
|
*/
|
|
|
|
/**
|
|
* 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 appHash.
|
|
* @member {Uint8Array} appHash
|
|
* @memberof tendermint.abci.RequestOfferSnapshot
|
|
* @instance
|
|
*/
|
|
RequestOfferSnapshot.prototype.appHash = $util.newBuffer([]);
|
|
|
|
/**
|
|
* Creates a new RequestOfferSnapshot instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.RequestOfferSnapshot
|
|
* @static
|
|
* @param {tendermint.abci.IRequestOfferSnapshot=} [properties] Properties to set
|
|
* @returns {tendermint.abci.RequestOfferSnapshot} RequestOfferSnapshot instance
|
|
*/
|
|
RequestOfferSnapshot.create = function create(properties) {
|
|
return new RequestOfferSnapshot(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.appHash != null && Object.hasOwnProperty.call(message, "appHash"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.appHash);
|
|
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.appHash = 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.<string,*>} 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.appHash != null && message.hasOwnProperty("appHash"))
|
|
if (!(message.appHash && typeof message.appHash.length === "number" || $util.isString(message.appHash)))
|
|
return "appHash: 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.<string,*>} 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.appHash != null)
|
|
if (typeof object.appHash === "string")
|
|
$util.base64.decode(object.appHash, message.appHash = $util.newBuffer($util.base64.length(object.appHash)), 0);
|
|
else if (object.appHash.length)
|
|
message.appHash = object.appHash;
|
|
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.<string,*>} Plain object
|
|
*/
|
|
RequestOfferSnapshot.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.snapshot = null;
|
|
if (options.bytes === String)
|
|
object.appHash = "";
|
|
else {
|
|
object.appHash = [];
|
|
if (options.bytes !== Array)
|
|
object.appHash = $util.newBuffer(object.appHash);
|
|
}
|
|
}
|
|
if (message.snapshot != null && message.hasOwnProperty("snapshot"))
|
|
object.snapshot = $root.tendermint.abci.Snapshot.toObject(message.snapshot, options);
|
|
if (message.appHash != null && message.hasOwnProperty("appHash"))
|
|
object.appHash = options.bytes === String ? $util.base64.encode(message.appHash, 0, message.appHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.appHash) : message.appHash;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this RequestOfferSnapshot to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.abci.RequestOfferSnapshot
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
RequestOfferSnapshot.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return RequestOfferSnapshot;
|
|
})(abci.RequestOfferSnapshot || {});
|
|
|
|
abci.RequestLoadSnapshotChunk = (function(RequestLoadSnapshotChunk) {
|
|
|
|
/**
|
|
* Properties of a RequestLoadSnapshotChunk.
|
|
* @memberof tendermint.abci
|
|
* @interface IRequestLoadSnapshotChunk
|
|
* @property {number|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 {number|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;
|
|
|
|
/**
|
|
* Creates a new RequestLoadSnapshotChunk instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.RequestLoadSnapshotChunk
|
|
* @static
|
|
* @param {tendermint.abci.IRequestLoadSnapshotChunk=} [properties] Properties to set
|
|
* @returns {tendermint.abci.RequestLoadSnapshotChunk} RequestLoadSnapshotChunk instance
|
|
*/
|
|
RequestLoadSnapshotChunk.create = function create(properties) {
|
|
return new RequestLoadSnapshotChunk(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
RequestLoadSnapshotChunk.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return RequestLoadSnapshotChunk;
|
|
})(abci.RequestLoadSnapshotChunk || {});
|
|
|
|
abci.RequestApplySnapshotChunk = (function(RequestApplySnapshotChunk) {
|
|
|
|
/**
|
|
* 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 = "";
|
|
|
|
/**
|
|
* Creates a new RequestApplySnapshotChunk instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.RequestApplySnapshotChunk
|
|
* @static
|
|
* @param {tendermint.abci.IRequestApplySnapshotChunk=} [properties] Properties to set
|
|
* @returns {tendermint.abci.RequestApplySnapshotChunk} RequestApplySnapshotChunk instance
|
|
*/
|
|
RequestApplySnapshotChunk.create = function create(properties) {
|
|
return new RequestApplySnapshotChunk(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
RequestApplySnapshotChunk.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return RequestApplySnapshotChunk;
|
|
})(abci.RequestApplySnapshotChunk || {});
|
|
|
|
abci.Response = (function(Response) {
|
|
|
|
/**
|
|
* 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} [setOption] Response setOption
|
|
* @property {tendermint.abci.IResponseInitChain|null} [initChain] Response initChain
|
|
* @property {tendermint.abci.IResponseQuery|null} [query] Response query
|
|
* @property {tendermint.abci.IResponseBeginBlock|null} [beginBlock] Response beginBlock
|
|
* @property {tendermint.abci.IResponseCheckTx|null} [checkTx] Response checkTx
|
|
* @property {tendermint.abci.IResponseDeliverTx|null} [deliverTx] Response deliverTx
|
|
* @property {tendermint.abci.IResponseEndBlock|null} [endBlock] Response endBlock
|
|
* @property {tendermint.abci.IResponseCommit|null} [commit] Response commit
|
|
* @property {tendermint.abci.IResponseListSnapshots|null} [listSnapshots] Response listSnapshots
|
|
* @property {tendermint.abci.IResponseOfferSnapshot|null} [offerSnapshot] Response offerSnapshot
|
|
* @property {tendermint.abci.IResponseLoadSnapshotChunk|null} [loadSnapshotChunk] Response loadSnapshotChunk
|
|
* @property {tendermint.abci.IResponseApplySnapshotChunk|null} [applySnapshotChunk] Response applySnapshotChunk
|
|
*/
|
|
|
|
/**
|
|
* 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 setOption.
|
|
* @member {tendermint.abci.IResponseSetOption|null|undefined} setOption
|
|
* @memberof tendermint.abci.Response
|
|
* @instance
|
|
*/
|
|
Response.prototype.setOption = null;
|
|
|
|
/**
|
|
* Response initChain.
|
|
* @member {tendermint.abci.IResponseInitChain|null|undefined} initChain
|
|
* @memberof tendermint.abci.Response
|
|
* @instance
|
|
*/
|
|
Response.prototype.initChain = null;
|
|
|
|
/**
|
|
* Response query.
|
|
* @member {tendermint.abci.IResponseQuery|null|undefined} query
|
|
* @memberof tendermint.abci.Response
|
|
* @instance
|
|
*/
|
|
Response.prototype.query = null;
|
|
|
|
/**
|
|
* Response beginBlock.
|
|
* @member {tendermint.abci.IResponseBeginBlock|null|undefined} beginBlock
|
|
* @memberof tendermint.abci.Response
|
|
* @instance
|
|
*/
|
|
Response.prototype.beginBlock = null;
|
|
|
|
/**
|
|
* Response checkTx.
|
|
* @member {tendermint.abci.IResponseCheckTx|null|undefined} checkTx
|
|
* @memberof tendermint.abci.Response
|
|
* @instance
|
|
*/
|
|
Response.prototype.checkTx = null;
|
|
|
|
/**
|
|
* Response deliverTx.
|
|
* @member {tendermint.abci.IResponseDeliverTx|null|undefined} deliverTx
|
|
* @memberof tendermint.abci.Response
|
|
* @instance
|
|
*/
|
|
Response.prototype.deliverTx = null;
|
|
|
|
/**
|
|
* Response endBlock.
|
|
* @member {tendermint.abci.IResponseEndBlock|null|undefined} endBlock
|
|
* @memberof tendermint.abci.Response
|
|
* @instance
|
|
*/
|
|
Response.prototype.endBlock = null;
|
|
|
|
/**
|
|
* Response commit.
|
|
* @member {tendermint.abci.IResponseCommit|null|undefined} commit
|
|
* @memberof tendermint.abci.Response
|
|
* @instance
|
|
*/
|
|
Response.prototype.commit = null;
|
|
|
|
/**
|
|
* Response listSnapshots.
|
|
* @member {tendermint.abci.IResponseListSnapshots|null|undefined} listSnapshots
|
|
* @memberof tendermint.abci.Response
|
|
* @instance
|
|
*/
|
|
Response.prototype.listSnapshots = null;
|
|
|
|
/**
|
|
* Response offerSnapshot.
|
|
* @member {tendermint.abci.IResponseOfferSnapshot|null|undefined} offerSnapshot
|
|
* @memberof tendermint.abci.Response
|
|
* @instance
|
|
*/
|
|
Response.prototype.offerSnapshot = null;
|
|
|
|
/**
|
|
* Response loadSnapshotChunk.
|
|
* @member {tendermint.abci.IResponseLoadSnapshotChunk|null|undefined} loadSnapshotChunk
|
|
* @memberof tendermint.abci.Response
|
|
* @instance
|
|
*/
|
|
Response.prototype.loadSnapshotChunk = null;
|
|
|
|
/**
|
|
* Response applySnapshotChunk.
|
|
* @member {tendermint.abci.IResponseApplySnapshotChunk|null|undefined} applySnapshotChunk
|
|
* @memberof tendermint.abci.Response
|
|
* @instance
|
|
*/
|
|
Response.prototype.applySnapshotChunk = null;
|
|
|
|
// OneOf field names bound to virtual getters and setters
|
|
var $oneOfFields;
|
|
|
|
/**
|
|
* Response value.
|
|
* @member {"exception"|"echo"|"flush"|"info"|"setOption"|"initChain"|"query"|"beginBlock"|"checkTx"|"deliverTx"|"endBlock"|"commit"|"listSnapshots"|"offerSnapshot"|"loadSnapshotChunk"|"applySnapshotChunk"|undefined} value
|
|
* @memberof tendermint.abci.Response
|
|
* @instance
|
|
*/
|
|
Object.defineProperty(Response.prototype, "value", {
|
|
get: $util.oneOfGetter($oneOfFields = ["exception", "echo", "flush", "info", "setOption", "initChain", "query", "beginBlock", "checkTx", "deliverTx", "endBlock", "commit", "listSnapshots", "offerSnapshot", "loadSnapshotChunk", "applySnapshotChunk"]),
|
|
set: $util.oneOfSetter($oneOfFields)
|
|
});
|
|
|
|
/**
|
|
* Creates a new Response instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.Response
|
|
* @static
|
|
* @param {tendermint.abci.IResponse=} [properties] Properties to set
|
|
* @returns {tendermint.abci.Response} Response instance
|
|
*/
|
|
Response.create = function create(properties) {
|
|
return new Response(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.setOption != null && Object.hasOwnProperty.call(message, "setOption"))
|
|
$root.tendermint.abci.ResponseSetOption.encode(message.setOption, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
|
if (message.initChain != null && Object.hasOwnProperty.call(message, "initChain"))
|
|
$root.tendermint.abci.ResponseInitChain.encode(message.initChain, 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.beginBlock != null && Object.hasOwnProperty.call(message, "beginBlock"))
|
|
$root.tendermint.abci.ResponseBeginBlock.encode(message.beginBlock, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
|
if (message.checkTx != null && Object.hasOwnProperty.call(message, "checkTx"))
|
|
$root.tendermint.abci.ResponseCheckTx.encode(message.checkTx, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
|
|
if (message.deliverTx != null && Object.hasOwnProperty.call(message, "deliverTx"))
|
|
$root.tendermint.abci.ResponseDeliverTx.encode(message.deliverTx, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
|
|
if (message.endBlock != null && Object.hasOwnProperty.call(message, "endBlock"))
|
|
$root.tendermint.abci.ResponseEndBlock.encode(message.endBlock, 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.listSnapshots != null && Object.hasOwnProperty.call(message, "listSnapshots"))
|
|
$root.tendermint.abci.ResponseListSnapshots.encode(message.listSnapshots, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim();
|
|
if (message.offerSnapshot != null && Object.hasOwnProperty.call(message, "offerSnapshot"))
|
|
$root.tendermint.abci.ResponseOfferSnapshot.encode(message.offerSnapshot, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();
|
|
if (message.loadSnapshotChunk != null && Object.hasOwnProperty.call(message, "loadSnapshotChunk"))
|
|
$root.tendermint.abci.ResponseLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim();
|
|
if (message.applySnapshotChunk != null && Object.hasOwnProperty.call(message, "applySnapshotChunk"))
|
|
$root.tendermint.abci.ResponseApplySnapshotChunk.encode(message.applySnapshotChunk, 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.setOption = $root.tendermint.abci.ResponseSetOption.decode(reader, reader.uint32());
|
|
break;
|
|
case 6:
|
|
message.initChain = $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.beginBlock = $root.tendermint.abci.ResponseBeginBlock.decode(reader, reader.uint32());
|
|
break;
|
|
case 9:
|
|
message.checkTx = $root.tendermint.abci.ResponseCheckTx.decode(reader, reader.uint32());
|
|
break;
|
|
case 10:
|
|
message.deliverTx = $root.tendermint.abci.ResponseDeliverTx.decode(reader, reader.uint32());
|
|
break;
|
|
case 11:
|
|
message.endBlock = $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.listSnapshots = $root.tendermint.abci.ResponseListSnapshots.decode(reader, reader.uint32());
|
|
break;
|
|
case 14:
|
|
message.offerSnapshot = $root.tendermint.abci.ResponseOfferSnapshot.decode(reader, reader.uint32());
|
|
break;
|
|
case 15:
|
|
message.loadSnapshotChunk = $root.tendermint.abci.ResponseLoadSnapshotChunk.decode(reader, reader.uint32());
|
|
break;
|
|
case 16:
|
|
message.applySnapshotChunk = $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.<string,*>} 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.setOption != null && message.hasOwnProperty("setOption")) {
|
|
if (properties.value === 1)
|
|
return "value: multiple values";
|
|
properties.value = 1;
|
|
{
|
|
var error = $root.tendermint.abci.ResponseSetOption.verify(message.setOption);
|
|
if (error)
|
|
return "setOption." + error;
|
|
}
|
|
}
|
|
if (message.initChain != null && message.hasOwnProperty("initChain")) {
|
|
if (properties.value === 1)
|
|
return "value: multiple values";
|
|
properties.value = 1;
|
|
{
|
|
var error = $root.tendermint.abci.ResponseInitChain.verify(message.initChain);
|
|
if (error)
|
|
return "initChain." + 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.beginBlock != null && message.hasOwnProperty("beginBlock")) {
|
|
if (properties.value === 1)
|
|
return "value: multiple values";
|
|
properties.value = 1;
|
|
{
|
|
var error = $root.tendermint.abci.ResponseBeginBlock.verify(message.beginBlock);
|
|
if (error)
|
|
return "beginBlock." + error;
|
|
}
|
|
}
|
|
if (message.checkTx != null && message.hasOwnProperty("checkTx")) {
|
|
if (properties.value === 1)
|
|
return "value: multiple values";
|
|
properties.value = 1;
|
|
{
|
|
var error = $root.tendermint.abci.ResponseCheckTx.verify(message.checkTx);
|
|
if (error)
|
|
return "checkTx." + error;
|
|
}
|
|
}
|
|
if (message.deliverTx != null && message.hasOwnProperty("deliverTx")) {
|
|
if (properties.value === 1)
|
|
return "value: multiple values";
|
|
properties.value = 1;
|
|
{
|
|
var error = $root.tendermint.abci.ResponseDeliverTx.verify(message.deliverTx);
|
|
if (error)
|
|
return "deliverTx." + error;
|
|
}
|
|
}
|
|
if (message.endBlock != null && message.hasOwnProperty("endBlock")) {
|
|
if (properties.value === 1)
|
|
return "value: multiple values";
|
|
properties.value = 1;
|
|
{
|
|
var error = $root.tendermint.abci.ResponseEndBlock.verify(message.endBlock);
|
|
if (error)
|
|
return "endBlock." + 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.listSnapshots != null && message.hasOwnProperty("listSnapshots")) {
|
|
if (properties.value === 1)
|
|
return "value: multiple values";
|
|
properties.value = 1;
|
|
{
|
|
var error = $root.tendermint.abci.ResponseListSnapshots.verify(message.listSnapshots);
|
|
if (error)
|
|
return "listSnapshots." + error;
|
|
}
|
|
}
|
|
if (message.offerSnapshot != null && message.hasOwnProperty("offerSnapshot")) {
|
|
if (properties.value === 1)
|
|
return "value: multiple values";
|
|
properties.value = 1;
|
|
{
|
|
var error = $root.tendermint.abci.ResponseOfferSnapshot.verify(message.offerSnapshot);
|
|
if (error)
|
|
return "offerSnapshot." + error;
|
|
}
|
|
}
|
|
if (message.loadSnapshotChunk != null && message.hasOwnProperty("loadSnapshotChunk")) {
|
|
if (properties.value === 1)
|
|
return "value: multiple values";
|
|
properties.value = 1;
|
|
{
|
|
var error = $root.tendermint.abci.ResponseLoadSnapshotChunk.verify(message.loadSnapshotChunk);
|
|
if (error)
|
|
return "loadSnapshotChunk." + error;
|
|
}
|
|
}
|
|
if (message.applySnapshotChunk != null && message.hasOwnProperty("applySnapshotChunk")) {
|
|
if (properties.value === 1)
|
|
return "value: multiple values";
|
|
properties.value = 1;
|
|
{
|
|
var error = $root.tendermint.abci.ResponseApplySnapshotChunk.verify(message.applySnapshotChunk);
|
|
if (error)
|
|
return "applySnapshotChunk." + 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.<string,*>} 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.setOption != null) {
|
|
if (typeof object.setOption !== "object")
|
|
throw TypeError(".tendermint.abci.Response.setOption: object expected");
|
|
message.setOption = $root.tendermint.abci.ResponseSetOption.fromObject(object.setOption);
|
|
}
|
|
if (object.initChain != null) {
|
|
if (typeof object.initChain !== "object")
|
|
throw TypeError(".tendermint.abci.Response.initChain: object expected");
|
|
message.initChain = $root.tendermint.abci.ResponseInitChain.fromObject(object.initChain);
|
|
}
|
|
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.beginBlock != null) {
|
|
if (typeof object.beginBlock !== "object")
|
|
throw TypeError(".tendermint.abci.Response.beginBlock: object expected");
|
|
message.beginBlock = $root.tendermint.abci.ResponseBeginBlock.fromObject(object.beginBlock);
|
|
}
|
|
if (object.checkTx != null) {
|
|
if (typeof object.checkTx !== "object")
|
|
throw TypeError(".tendermint.abci.Response.checkTx: object expected");
|
|
message.checkTx = $root.tendermint.abci.ResponseCheckTx.fromObject(object.checkTx);
|
|
}
|
|
if (object.deliverTx != null) {
|
|
if (typeof object.deliverTx !== "object")
|
|
throw TypeError(".tendermint.abci.Response.deliverTx: object expected");
|
|
message.deliverTx = $root.tendermint.abci.ResponseDeliverTx.fromObject(object.deliverTx);
|
|
}
|
|
if (object.endBlock != null) {
|
|
if (typeof object.endBlock !== "object")
|
|
throw TypeError(".tendermint.abci.Response.endBlock: object expected");
|
|
message.endBlock = $root.tendermint.abci.ResponseEndBlock.fromObject(object.endBlock);
|
|
}
|
|
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.listSnapshots != null) {
|
|
if (typeof object.listSnapshots !== "object")
|
|
throw TypeError(".tendermint.abci.Response.listSnapshots: object expected");
|
|
message.listSnapshots = $root.tendermint.abci.ResponseListSnapshots.fromObject(object.listSnapshots);
|
|
}
|
|
if (object.offerSnapshot != null) {
|
|
if (typeof object.offerSnapshot !== "object")
|
|
throw TypeError(".tendermint.abci.Response.offerSnapshot: object expected");
|
|
message.offerSnapshot = $root.tendermint.abci.ResponseOfferSnapshot.fromObject(object.offerSnapshot);
|
|
}
|
|
if (object.loadSnapshotChunk != null) {
|
|
if (typeof object.loadSnapshotChunk !== "object")
|
|
throw TypeError(".tendermint.abci.Response.loadSnapshotChunk: object expected");
|
|
message.loadSnapshotChunk = $root.tendermint.abci.ResponseLoadSnapshotChunk.fromObject(object.loadSnapshotChunk);
|
|
}
|
|
if (object.applySnapshotChunk != null) {
|
|
if (typeof object.applySnapshotChunk !== "object")
|
|
throw TypeError(".tendermint.abci.Response.applySnapshotChunk: object expected");
|
|
message.applySnapshotChunk = $root.tendermint.abci.ResponseApplySnapshotChunk.fromObject(object.applySnapshotChunk);
|
|
}
|
|
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.<string,*>} 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.setOption != null && message.hasOwnProperty("setOption")) {
|
|
object.setOption = $root.tendermint.abci.ResponseSetOption.toObject(message.setOption, options);
|
|
if (options.oneofs)
|
|
object.value = "setOption";
|
|
}
|
|
if (message.initChain != null && message.hasOwnProperty("initChain")) {
|
|
object.initChain = $root.tendermint.abci.ResponseInitChain.toObject(message.initChain, options);
|
|
if (options.oneofs)
|
|
object.value = "initChain";
|
|
}
|
|
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.beginBlock != null && message.hasOwnProperty("beginBlock")) {
|
|
object.beginBlock = $root.tendermint.abci.ResponseBeginBlock.toObject(message.beginBlock, options);
|
|
if (options.oneofs)
|
|
object.value = "beginBlock";
|
|
}
|
|
if (message.checkTx != null && message.hasOwnProperty("checkTx")) {
|
|
object.checkTx = $root.tendermint.abci.ResponseCheckTx.toObject(message.checkTx, options);
|
|
if (options.oneofs)
|
|
object.value = "checkTx";
|
|
}
|
|
if (message.deliverTx != null && message.hasOwnProperty("deliverTx")) {
|
|
object.deliverTx = $root.tendermint.abci.ResponseDeliverTx.toObject(message.deliverTx, options);
|
|
if (options.oneofs)
|
|
object.value = "deliverTx";
|
|
}
|
|
if (message.endBlock != null && message.hasOwnProperty("endBlock")) {
|
|
object.endBlock = $root.tendermint.abci.ResponseEndBlock.toObject(message.endBlock, options);
|
|
if (options.oneofs)
|
|
object.value = "endBlock";
|
|
}
|
|
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.listSnapshots != null && message.hasOwnProperty("listSnapshots")) {
|
|
object.listSnapshots = $root.tendermint.abci.ResponseListSnapshots.toObject(message.listSnapshots, options);
|
|
if (options.oneofs)
|
|
object.value = "listSnapshots";
|
|
}
|
|
if (message.offerSnapshot != null && message.hasOwnProperty("offerSnapshot")) {
|
|
object.offerSnapshot = $root.tendermint.abci.ResponseOfferSnapshot.toObject(message.offerSnapshot, options);
|
|
if (options.oneofs)
|
|
object.value = "offerSnapshot";
|
|
}
|
|
if (message.loadSnapshotChunk != null && message.hasOwnProperty("loadSnapshotChunk")) {
|
|
object.loadSnapshotChunk = $root.tendermint.abci.ResponseLoadSnapshotChunk.toObject(message.loadSnapshotChunk, options);
|
|
if (options.oneofs)
|
|
object.value = "loadSnapshotChunk";
|
|
}
|
|
if (message.applySnapshotChunk != null && message.hasOwnProperty("applySnapshotChunk")) {
|
|
object.applySnapshotChunk = $root.tendermint.abci.ResponseApplySnapshotChunk.toObject(message.applySnapshotChunk, options);
|
|
if (options.oneofs)
|
|
object.value = "applySnapshotChunk";
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Response to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.abci.Response
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Response.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Response;
|
|
})(abci.Response || {});
|
|
|
|
abci.ResponseException = (function(ResponseException) {
|
|
|
|
/**
|
|
* 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 = "";
|
|
|
|
/**
|
|
* Creates a new ResponseException instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.ResponseException
|
|
* @static
|
|
* @param {tendermint.abci.IResponseException=} [properties] Properties to set
|
|
* @returns {tendermint.abci.ResponseException} ResponseException instance
|
|
*/
|
|
ResponseException.create = function create(properties) {
|
|
return new ResponseException(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
ResponseException.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ResponseException;
|
|
})(abci.ResponseException || {});
|
|
|
|
abci.ResponseEcho = (function(ResponseEcho) {
|
|
|
|
/**
|
|
* 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 = "";
|
|
|
|
/**
|
|
* Creates a new ResponseEcho instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.ResponseEcho
|
|
* @static
|
|
* @param {tendermint.abci.IResponseEcho=} [properties] Properties to set
|
|
* @returns {tendermint.abci.ResponseEcho} ResponseEcho instance
|
|
*/
|
|
ResponseEcho.create = function create(properties) {
|
|
return new ResponseEcho(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
ResponseEcho.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ResponseEcho;
|
|
})(abci.ResponseEcho || {});
|
|
|
|
abci.ResponseFlush = (function(ResponseFlush) {
|
|
|
|
/**
|
|
* 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]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new ResponseFlush instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.ResponseFlush
|
|
* @static
|
|
* @param {tendermint.abci.IResponseFlush=} [properties] Properties to set
|
|
* @returns {tendermint.abci.ResponseFlush} ResponseFlush instance
|
|
*/
|
|
ResponseFlush.create = function create(properties) {
|
|
return new ResponseFlush(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} Plain object
|
|
*/
|
|
ResponseFlush.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this ResponseFlush to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.abci.ResponseFlush
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
ResponseFlush.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ResponseFlush;
|
|
})(abci.ResponseFlush || {});
|
|
|
|
abci.ResponseInfo = (function(ResponseInfo) {
|
|
|
|
/**
|
|
* Properties of a ResponseInfo.
|
|
* @memberof tendermint.abci
|
|
* @interface IResponseInfo
|
|
* @property {string|null} [data] ResponseInfo data
|
|
* @property {string|null} [version] ResponseInfo version
|
|
* @property {number|Long|null} [appVersion] ResponseInfo appVersion
|
|
* @property {number|Long|null} [lastBlockHeight] ResponseInfo lastBlockHeight
|
|
* @property {Uint8Array|null} [lastBlockAppHash] ResponseInfo lastBlockAppHash
|
|
*/
|
|
|
|
/**
|
|
* 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 appVersion.
|
|
* @member {number|Long} appVersion
|
|
* @memberof tendermint.abci.ResponseInfo
|
|
* @instance
|
|
*/
|
|
ResponseInfo.prototype.appVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* ResponseInfo lastBlockHeight.
|
|
* @member {number|Long} lastBlockHeight
|
|
* @memberof tendermint.abci.ResponseInfo
|
|
* @instance
|
|
*/
|
|
ResponseInfo.prototype.lastBlockHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* ResponseInfo lastBlockAppHash.
|
|
* @member {Uint8Array} lastBlockAppHash
|
|
* @memberof tendermint.abci.ResponseInfo
|
|
* @instance
|
|
*/
|
|
ResponseInfo.prototype.lastBlockAppHash = $util.newBuffer([]);
|
|
|
|
/**
|
|
* Creates a new ResponseInfo instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.ResponseInfo
|
|
* @static
|
|
* @param {tendermint.abci.IResponseInfo=} [properties] Properties to set
|
|
* @returns {tendermint.abci.ResponseInfo} ResponseInfo instance
|
|
*/
|
|
ResponseInfo.create = function create(properties) {
|
|
return new ResponseInfo(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.appVersion != null && Object.hasOwnProperty.call(message, "appVersion"))
|
|
writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.appVersion);
|
|
if (message.lastBlockHeight != null && Object.hasOwnProperty.call(message, "lastBlockHeight"))
|
|
writer.uint32(/* id 4, wireType 0 =*/32).int64(message.lastBlockHeight);
|
|
if (message.lastBlockAppHash != null && Object.hasOwnProperty.call(message, "lastBlockAppHash"))
|
|
writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.lastBlockAppHash);
|
|
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.appVersion = reader.uint64();
|
|
break;
|
|
case 4:
|
|
message.lastBlockHeight = reader.int64();
|
|
break;
|
|
case 5:
|
|
message.lastBlockAppHash = 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.<string,*>} 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.appVersion != null && message.hasOwnProperty("appVersion"))
|
|
if (!$util.isInteger(message.appVersion) && !(message.appVersion && $util.isInteger(message.appVersion.low) && $util.isInteger(message.appVersion.high)))
|
|
return "appVersion: integer|Long expected";
|
|
if (message.lastBlockHeight != null && message.hasOwnProperty("lastBlockHeight"))
|
|
if (!$util.isInteger(message.lastBlockHeight) && !(message.lastBlockHeight && $util.isInteger(message.lastBlockHeight.low) && $util.isInteger(message.lastBlockHeight.high)))
|
|
return "lastBlockHeight: integer|Long expected";
|
|
if (message.lastBlockAppHash != null && message.hasOwnProperty("lastBlockAppHash"))
|
|
if (!(message.lastBlockAppHash && typeof message.lastBlockAppHash.length === "number" || $util.isString(message.lastBlockAppHash)))
|
|
return "lastBlockAppHash: 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.<string,*>} 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.appVersion != null)
|
|
if ($util.Long)
|
|
(message.appVersion = $util.Long.fromValue(object.appVersion)).unsigned = true;
|
|
else if (typeof object.appVersion === "string")
|
|
message.appVersion = parseInt(object.appVersion, 10);
|
|
else if (typeof object.appVersion === "number")
|
|
message.appVersion = object.appVersion;
|
|
else if (typeof object.appVersion === "object")
|
|
message.appVersion = new $util.LongBits(object.appVersion.low >>> 0, object.appVersion.high >>> 0).toNumber(true);
|
|
if (object.lastBlockHeight != null)
|
|
if ($util.Long)
|
|
(message.lastBlockHeight = $util.Long.fromValue(object.lastBlockHeight)).unsigned = false;
|
|
else if (typeof object.lastBlockHeight === "string")
|
|
message.lastBlockHeight = parseInt(object.lastBlockHeight, 10);
|
|
else if (typeof object.lastBlockHeight === "number")
|
|
message.lastBlockHeight = object.lastBlockHeight;
|
|
else if (typeof object.lastBlockHeight === "object")
|
|
message.lastBlockHeight = new $util.LongBits(object.lastBlockHeight.low >>> 0, object.lastBlockHeight.high >>> 0).toNumber();
|
|
if (object.lastBlockAppHash != null)
|
|
if (typeof object.lastBlockAppHash === "string")
|
|
$util.base64.decode(object.lastBlockAppHash, message.lastBlockAppHash = $util.newBuffer($util.base64.length(object.lastBlockAppHash)), 0);
|
|
else if (object.lastBlockAppHash.length)
|
|
message.lastBlockAppHash = object.lastBlockAppHash;
|
|
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.<string,*>} 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.appVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.appVersion = options.longs === String ? "0" : 0;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.lastBlockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.lastBlockHeight = options.longs === String ? "0" : 0;
|
|
if (options.bytes === String)
|
|
object.lastBlockAppHash = "";
|
|
else {
|
|
object.lastBlockAppHash = [];
|
|
if (options.bytes !== Array)
|
|
object.lastBlockAppHash = $util.newBuffer(object.lastBlockAppHash);
|
|
}
|
|
}
|
|
if (message.data != null && message.hasOwnProperty("data"))
|
|
object.data = message.data;
|
|
if (message.version != null && message.hasOwnProperty("version"))
|
|
object.version = message.version;
|
|
if (message.appVersion != null && message.hasOwnProperty("appVersion"))
|
|
if (typeof message.appVersion === "number")
|
|
object.appVersion = options.longs === String ? String(message.appVersion) : message.appVersion;
|
|
else
|
|
object.appVersion = options.longs === String ? $util.Long.prototype.toString.call(message.appVersion) : options.longs === Number ? new $util.LongBits(message.appVersion.low >>> 0, message.appVersion.high >>> 0).toNumber(true) : message.appVersion;
|
|
if (message.lastBlockHeight != null && message.hasOwnProperty("lastBlockHeight"))
|
|
if (typeof message.lastBlockHeight === "number")
|
|
object.lastBlockHeight = options.longs === String ? String(message.lastBlockHeight) : message.lastBlockHeight;
|
|
else
|
|
object.lastBlockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.lastBlockHeight) : options.longs === Number ? new $util.LongBits(message.lastBlockHeight.low >>> 0, message.lastBlockHeight.high >>> 0).toNumber() : message.lastBlockHeight;
|
|
if (message.lastBlockAppHash != null && message.hasOwnProperty("lastBlockAppHash"))
|
|
object.lastBlockAppHash = options.bytes === String ? $util.base64.encode(message.lastBlockAppHash, 0, message.lastBlockAppHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastBlockAppHash) : message.lastBlockAppHash;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this ResponseInfo to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.abci.ResponseInfo
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
ResponseInfo.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ResponseInfo;
|
|
})(abci.ResponseInfo || {});
|
|
|
|
abci.ResponseSetOption = (function(ResponseSetOption) {
|
|
|
|
/**
|
|
* 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 = "";
|
|
|
|
/**
|
|
* Creates a new ResponseSetOption instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.ResponseSetOption
|
|
* @static
|
|
* @param {tendermint.abci.IResponseSetOption=} [properties] Properties to set
|
|
* @returns {tendermint.abci.ResponseSetOption} ResponseSetOption instance
|
|
*/
|
|
ResponseSetOption.create = function create(properties) {
|
|
return new ResponseSetOption(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
ResponseSetOption.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ResponseSetOption;
|
|
})(abci.ResponseSetOption || {});
|
|
|
|
abci.ResponseInitChain = (function(ResponseInitChain) {
|
|
|
|
/**
|
|
* Properties of a ResponseInitChain.
|
|
* @memberof tendermint.abci
|
|
* @interface IResponseInitChain
|
|
* @property {tendermint.abci.IConsensusParams|null} [consensusParams] ResponseInitChain consensusParams
|
|
* @property {Array.<tendermint.abci.IValidatorUpdate>|null} [validators] ResponseInitChain validators
|
|
* @property {Uint8Array|null} [appHash] ResponseInitChain appHash
|
|
*/
|
|
|
|
/**
|
|
* 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 consensusParams.
|
|
* @member {tendermint.abci.IConsensusParams|null|undefined} consensusParams
|
|
* @memberof tendermint.abci.ResponseInitChain
|
|
* @instance
|
|
*/
|
|
ResponseInitChain.prototype.consensusParams = null;
|
|
|
|
/**
|
|
* ResponseInitChain validators.
|
|
* @member {Array.<tendermint.abci.IValidatorUpdate>} validators
|
|
* @memberof tendermint.abci.ResponseInitChain
|
|
* @instance
|
|
*/
|
|
ResponseInitChain.prototype.validators = $util.emptyArray;
|
|
|
|
/**
|
|
* ResponseInitChain appHash.
|
|
* @member {Uint8Array} appHash
|
|
* @memberof tendermint.abci.ResponseInitChain
|
|
* @instance
|
|
*/
|
|
ResponseInitChain.prototype.appHash = $util.newBuffer([]);
|
|
|
|
/**
|
|
* Creates a new ResponseInitChain instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.ResponseInitChain
|
|
* @static
|
|
* @param {tendermint.abci.IResponseInitChain=} [properties] Properties to set
|
|
* @returns {tendermint.abci.ResponseInitChain} ResponseInitChain instance
|
|
*/
|
|
ResponseInitChain.create = function create(properties) {
|
|
return new ResponseInitChain(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.consensusParams != null && Object.hasOwnProperty.call(message, "consensusParams"))
|
|
$root.tendermint.abci.ConsensusParams.encode(message.consensusParams, 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.appHash != null && Object.hasOwnProperty.call(message, "appHash"))
|
|
writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.appHash);
|
|
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.consensusParams = $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.appHash = 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.<string,*>} 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.consensusParams != null && message.hasOwnProperty("consensusParams")) {
|
|
var error = $root.tendermint.abci.ConsensusParams.verify(message.consensusParams);
|
|
if (error)
|
|
return "consensusParams." + 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.appHash != null && message.hasOwnProperty("appHash"))
|
|
if (!(message.appHash && typeof message.appHash.length === "number" || $util.isString(message.appHash)))
|
|
return "appHash: 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.<string,*>} 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.consensusParams != null) {
|
|
if (typeof object.consensusParams !== "object")
|
|
throw TypeError(".tendermint.abci.ResponseInitChain.consensusParams: object expected");
|
|
message.consensusParams = $root.tendermint.abci.ConsensusParams.fromObject(object.consensusParams);
|
|
}
|
|
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.appHash != null)
|
|
if (typeof object.appHash === "string")
|
|
$util.base64.decode(object.appHash, message.appHash = $util.newBuffer($util.base64.length(object.appHash)), 0);
|
|
else if (object.appHash.length)
|
|
message.appHash = object.appHash;
|
|
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.<string,*>} Plain object
|
|
*/
|
|
ResponseInitChain.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.validators = [];
|
|
if (options.defaults) {
|
|
object.consensusParams = null;
|
|
if (options.bytes === String)
|
|
object.appHash = "";
|
|
else {
|
|
object.appHash = [];
|
|
if (options.bytes !== Array)
|
|
object.appHash = $util.newBuffer(object.appHash);
|
|
}
|
|
}
|
|
if (message.consensusParams != null && message.hasOwnProperty("consensusParams"))
|
|
object.consensusParams = $root.tendermint.abci.ConsensusParams.toObject(message.consensusParams, 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.appHash != null && message.hasOwnProperty("appHash"))
|
|
object.appHash = options.bytes === String ? $util.base64.encode(message.appHash, 0, message.appHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.appHash) : message.appHash;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this ResponseInitChain to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.abci.ResponseInitChain
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
ResponseInitChain.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ResponseInitChain;
|
|
})(abci.ResponseInitChain || {});
|
|
|
|
abci.ResponseQuery = (function(ResponseQuery) {
|
|
|
|
/**
|
|
* 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 {number|Long|null} [index] ResponseQuery index
|
|
* @property {Uint8Array|null} [key] ResponseQuery key
|
|
* @property {Uint8Array|null} [value] ResponseQuery value
|
|
* @property {tendermint.crypto.IProofOps|null} [proofOps] ResponseQuery proofOps
|
|
* @property {number|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 {number|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 proofOps.
|
|
* @member {tendermint.crypto.IProofOps|null|undefined} proofOps
|
|
* @memberof tendermint.abci.ResponseQuery
|
|
* @instance
|
|
*/
|
|
ResponseQuery.prototype.proofOps = null;
|
|
|
|
/**
|
|
* ResponseQuery height.
|
|
* @member {number|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 = "";
|
|
|
|
/**
|
|
* Creates a new ResponseQuery instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.ResponseQuery
|
|
* @static
|
|
* @param {tendermint.abci.IResponseQuery=} [properties] Properties to set
|
|
* @returns {tendermint.abci.ResponseQuery} ResponseQuery instance
|
|
*/
|
|
ResponseQuery.create = function create(properties) {
|
|
return new ResponseQuery(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.proofOps != null && Object.hasOwnProperty.call(message, "proofOps"))
|
|
$root.tendermint.crypto.ProofOps.encode(message.proofOps, 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.proofOps = $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.<string,*>} 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.proofOps != null && message.hasOwnProperty("proofOps")) {
|
|
var error = $root.tendermint.crypto.ProofOps.verify(message.proofOps);
|
|
if (error)
|
|
return "proofOps." + 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.<string,*>} 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.proofOps != null) {
|
|
if (typeof object.proofOps !== "object")
|
|
throw TypeError(".tendermint.abci.ResponseQuery.proofOps: object expected");
|
|
message.proofOps = $root.tendermint.crypto.ProofOps.fromObject(object.proofOps);
|
|
}
|
|
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.<string,*>} 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.proofOps = 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.proofOps != null && message.hasOwnProperty("proofOps"))
|
|
object.proofOps = $root.tendermint.crypto.ProofOps.toObject(message.proofOps, 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.<string,*>} JSON object
|
|
*/
|
|
ResponseQuery.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ResponseQuery;
|
|
})(abci.ResponseQuery || {});
|
|
|
|
abci.ResponseBeginBlock = (function(ResponseBeginBlock) {
|
|
|
|
/**
|
|
* Properties of a ResponseBeginBlock.
|
|
* @memberof tendermint.abci
|
|
* @interface IResponseBeginBlock
|
|
* @property {Array.<tendermint.abci.IEvent>|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.<tendermint.abci.IEvent>} events
|
|
* @memberof tendermint.abci.ResponseBeginBlock
|
|
* @instance
|
|
*/
|
|
ResponseBeginBlock.prototype.events = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new ResponseBeginBlock instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.ResponseBeginBlock
|
|
* @static
|
|
* @param {tendermint.abci.IResponseBeginBlock=} [properties] Properties to set
|
|
* @returns {tendermint.abci.ResponseBeginBlock} ResponseBeginBlock instance
|
|
*/
|
|
ResponseBeginBlock.create = function create(properties) {
|
|
return new ResponseBeginBlock(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
ResponseBeginBlock.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ResponseBeginBlock;
|
|
})(abci.ResponseBeginBlock || {});
|
|
|
|
abci.ResponseCheckTx = (function(ResponseCheckTx) {
|
|
|
|
/**
|
|
* 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 {number|Long|null} [gasWanted] ResponseCheckTx gasWanted
|
|
* @property {number|Long|null} [gasUsed] ResponseCheckTx gasUsed
|
|
* @property {Array.<tendermint.abci.IEvent>|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 gasWanted.
|
|
* @member {number|Long} gasWanted
|
|
* @memberof tendermint.abci.ResponseCheckTx
|
|
* @instance
|
|
*/
|
|
ResponseCheckTx.prototype.gasWanted = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* ResponseCheckTx gasUsed.
|
|
* @member {number|Long} gasUsed
|
|
* @memberof tendermint.abci.ResponseCheckTx
|
|
* @instance
|
|
*/
|
|
ResponseCheckTx.prototype.gasUsed = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* ResponseCheckTx events.
|
|
* @member {Array.<tendermint.abci.IEvent>} events
|
|
* @memberof tendermint.abci.ResponseCheckTx
|
|
* @instance
|
|
*/
|
|
ResponseCheckTx.prototype.events = $util.emptyArray;
|
|
|
|
/**
|
|
* ResponseCheckTx codespace.
|
|
* @member {string} codespace
|
|
* @memberof tendermint.abci.ResponseCheckTx
|
|
* @instance
|
|
*/
|
|
ResponseCheckTx.prototype.codespace = "";
|
|
|
|
/**
|
|
* Creates a new ResponseCheckTx instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.ResponseCheckTx
|
|
* @static
|
|
* @param {tendermint.abci.IResponseCheckTx=} [properties] Properties to set
|
|
* @returns {tendermint.abci.ResponseCheckTx} ResponseCheckTx instance
|
|
*/
|
|
ResponseCheckTx.create = function create(properties) {
|
|
return new ResponseCheckTx(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.gasWanted != null && Object.hasOwnProperty.call(message, "gasWanted"))
|
|
writer.uint32(/* id 5, wireType 0 =*/40).int64(message.gasWanted);
|
|
if (message.gasUsed != null && Object.hasOwnProperty.call(message, "gasUsed"))
|
|
writer.uint32(/* id 6, wireType 0 =*/48).int64(message.gasUsed);
|
|
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.gasWanted = reader.int64();
|
|
break;
|
|
case 6:
|
|
message.gasUsed = 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.<string,*>} 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.gasWanted != null && message.hasOwnProperty("gasWanted"))
|
|
if (!$util.isInteger(message.gasWanted) && !(message.gasWanted && $util.isInteger(message.gasWanted.low) && $util.isInteger(message.gasWanted.high)))
|
|
return "gasWanted: integer|Long expected";
|
|
if (message.gasUsed != null && message.hasOwnProperty("gasUsed"))
|
|
if (!$util.isInteger(message.gasUsed) && !(message.gasUsed && $util.isInteger(message.gasUsed.low) && $util.isInteger(message.gasUsed.high)))
|
|
return "gasUsed: 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.<string,*>} 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.gasWanted != null)
|
|
if ($util.Long)
|
|
(message.gasWanted = $util.Long.fromValue(object.gasWanted)).unsigned = false;
|
|
else if (typeof object.gasWanted === "string")
|
|
message.gasWanted = parseInt(object.gasWanted, 10);
|
|
else if (typeof object.gasWanted === "number")
|
|
message.gasWanted = object.gasWanted;
|
|
else if (typeof object.gasWanted === "object")
|
|
message.gasWanted = new $util.LongBits(object.gasWanted.low >>> 0, object.gasWanted.high >>> 0).toNumber();
|
|
if (object.gasUsed != null)
|
|
if ($util.Long)
|
|
(message.gasUsed = $util.Long.fromValue(object.gasUsed)).unsigned = false;
|
|
else if (typeof object.gasUsed === "string")
|
|
message.gasUsed = parseInt(object.gasUsed, 10);
|
|
else if (typeof object.gasUsed === "number")
|
|
message.gasUsed = object.gasUsed;
|
|
else if (typeof object.gasUsed === "object")
|
|
message.gasUsed = new $util.LongBits(object.gasUsed.low >>> 0, object.gasUsed.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.<string,*>} 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.gasWanted = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.gasWanted = options.longs === String ? "0" : 0;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.gasUsed = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.gasUsed = 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.gasWanted != null && message.hasOwnProperty("gasWanted"))
|
|
if (typeof message.gasWanted === "number")
|
|
object.gasWanted = options.longs === String ? String(message.gasWanted) : message.gasWanted;
|
|
else
|
|
object.gasWanted = options.longs === String ? $util.Long.prototype.toString.call(message.gasWanted) : options.longs === Number ? new $util.LongBits(message.gasWanted.low >>> 0, message.gasWanted.high >>> 0).toNumber() : message.gasWanted;
|
|
if (message.gasUsed != null && message.hasOwnProperty("gasUsed"))
|
|
if (typeof message.gasUsed === "number")
|
|
object.gasUsed = options.longs === String ? String(message.gasUsed) : message.gasUsed;
|
|
else
|
|
object.gasUsed = options.longs === String ? $util.Long.prototype.toString.call(message.gasUsed) : options.longs === Number ? new $util.LongBits(message.gasUsed.low >>> 0, message.gasUsed.high >>> 0).toNumber() : message.gasUsed;
|
|
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.<string,*>} JSON object
|
|
*/
|
|
ResponseCheckTx.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ResponseCheckTx;
|
|
})(abci.ResponseCheckTx || {});
|
|
|
|
abci.ResponseDeliverTx = (function(ResponseDeliverTx) {
|
|
|
|
/**
|
|
* 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 {number|Long|null} [gasWanted] ResponseDeliverTx gasWanted
|
|
* @property {number|Long|null} [gasUsed] ResponseDeliverTx gasUsed
|
|
* @property {Array.<tendermint.abci.IEvent>|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 gasWanted.
|
|
* @member {number|Long} gasWanted
|
|
* @memberof tendermint.abci.ResponseDeliverTx
|
|
* @instance
|
|
*/
|
|
ResponseDeliverTx.prototype.gasWanted = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* ResponseDeliverTx gasUsed.
|
|
* @member {number|Long} gasUsed
|
|
* @memberof tendermint.abci.ResponseDeliverTx
|
|
* @instance
|
|
*/
|
|
ResponseDeliverTx.prototype.gasUsed = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* ResponseDeliverTx events.
|
|
* @member {Array.<tendermint.abci.IEvent>} events
|
|
* @memberof tendermint.abci.ResponseDeliverTx
|
|
* @instance
|
|
*/
|
|
ResponseDeliverTx.prototype.events = $util.emptyArray;
|
|
|
|
/**
|
|
* ResponseDeliverTx codespace.
|
|
* @member {string} codespace
|
|
* @memberof tendermint.abci.ResponseDeliverTx
|
|
* @instance
|
|
*/
|
|
ResponseDeliverTx.prototype.codespace = "";
|
|
|
|
/**
|
|
* Creates a new ResponseDeliverTx instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.ResponseDeliverTx
|
|
* @static
|
|
* @param {tendermint.abci.IResponseDeliverTx=} [properties] Properties to set
|
|
* @returns {tendermint.abci.ResponseDeliverTx} ResponseDeliverTx instance
|
|
*/
|
|
ResponseDeliverTx.create = function create(properties) {
|
|
return new ResponseDeliverTx(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.gasWanted != null && Object.hasOwnProperty.call(message, "gasWanted"))
|
|
writer.uint32(/* id 5, wireType 0 =*/40).int64(message.gasWanted);
|
|
if (message.gasUsed != null && Object.hasOwnProperty.call(message, "gasUsed"))
|
|
writer.uint32(/* id 6, wireType 0 =*/48).int64(message.gasUsed);
|
|
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.gasWanted = reader.int64();
|
|
break;
|
|
case 6:
|
|
message.gasUsed = 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.<string,*>} 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.gasWanted != null && message.hasOwnProperty("gasWanted"))
|
|
if (!$util.isInteger(message.gasWanted) && !(message.gasWanted && $util.isInteger(message.gasWanted.low) && $util.isInteger(message.gasWanted.high)))
|
|
return "gasWanted: integer|Long expected";
|
|
if (message.gasUsed != null && message.hasOwnProperty("gasUsed"))
|
|
if (!$util.isInteger(message.gasUsed) && !(message.gasUsed && $util.isInteger(message.gasUsed.low) && $util.isInteger(message.gasUsed.high)))
|
|
return "gasUsed: 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.<string,*>} 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.gasWanted != null)
|
|
if ($util.Long)
|
|
(message.gasWanted = $util.Long.fromValue(object.gasWanted)).unsigned = false;
|
|
else if (typeof object.gasWanted === "string")
|
|
message.gasWanted = parseInt(object.gasWanted, 10);
|
|
else if (typeof object.gasWanted === "number")
|
|
message.gasWanted = object.gasWanted;
|
|
else if (typeof object.gasWanted === "object")
|
|
message.gasWanted = new $util.LongBits(object.gasWanted.low >>> 0, object.gasWanted.high >>> 0).toNumber();
|
|
if (object.gasUsed != null)
|
|
if ($util.Long)
|
|
(message.gasUsed = $util.Long.fromValue(object.gasUsed)).unsigned = false;
|
|
else if (typeof object.gasUsed === "string")
|
|
message.gasUsed = parseInt(object.gasUsed, 10);
|
|
else if (typeof object.gasUsed === "number")
|
|
message.gasUsed = object.gasUsed;
|
|
else if (typeof object.gasUsed === "object")
|
|
message.gasUsed = new $util.LongBits(object.gasUsed.low >>> 0, object.gasUsed.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.<string,*>} 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.gasWanted = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.gasWanted = options.longs === String ? "0" : 0;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.gasUsed = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.gasUsed = 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.gasWanted != null && message.hasOwnProperty("gasWanted"))
|
|
if (typeof message.gasWanted === "number")
|
|
object.gasWanted = options.longs === String ? String(message.gasWanted) : message.gasWanted;
|
|
else
|
|
object.gasWanted = options.longs === String ? $util.Long.prototype.toString.call(message.gasWanted) : options.longs === Number ? new $util.LongBits(message.gasWanted.low >>> 0, message.gasWanted.high >>> 0).toNumber() : message.gasWanted;
|
|
if (message.gasUsed != null && message.hasOwnProperty("gasUsed"))
|
|
if (typeof message.gasUsed === "number")
|
|
object.gasUsed = options.longs === String ? String(message.gasUsed) : message.gasUsed;
|
|
else
|
|
object.gasUsed = options.longs === String ? $util.Long.prototype.toString.call(message.gasUsed) : options.longs === Number ? new $util.LongBits(message.gasUsed.low >>> 0, message.gasUsed.high >>> 0).toNumber() : message.gasUsed;
|
|
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.<string,*>} JSON object
|
|
*/
|
|
ResponseDeliverTx.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ResponseDeliverTx;
|
|
})(abci.ResponseDeliverTx || {});
|
|
|
|
abci.ResponseEndBlock = (function(ResponseEndBlock) {
|
|
|
|
/**
|
|
* Properties of a ResponseEndBlock.
|
|
* @memberof tendermint.abci
|
|
* @interface IResponseEndBlock
|
|
* @property {Array.<tendermint.abci.IValidatorUpdate>|null} [validatorUpdates] ResponseEndBlock validatorUpdates
|
|
* @property {tendermint.abci.IConsensusParams|null} [consensusParamUpdates] ResponseEndBlock consensusParamUpdates
|
|
* @property {Array.<tendermint.abci.IEvent>|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.validatorUpdates = [];
|
|
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 validatorUpdates.
|
|
* @member {Array.<tendermint.abci.IValidatorUpdate>} validatorUpdates
|
|
* @memberof tendermint.abci.ResponseEndBlock
|
|
* @instance
|
|
*/
|
|
ResponseEndBlock.prototype.validatorUpdates = $util.emptyArray;
|
|
|
|
/**
|
|
* ResponseEndBlock consensusParamUpdates.
|
|
* @member {tendermint.abci.IConsensusParams|null|undefined} consensusParamUpdates
|
|
* @memberof tendermint.abci.ResponseEndBlock
|
|
* @instance
|
|
*/
|
|
ResponseEndBlock.prototype.consensusParamUpdates = null;
|
|
|
|
/**
|
|
* ResponseEndBlock events.
|
|
* @member {Array.<tendermint.abci.IEvent>} events
|
|
* @memberof tendermint.abci.ResponseEndBlock
|
|
* @instance
|
|
*/
|
|
ResponseEndBlock.prototype.events = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new ResponseEndBlock instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.ResponseEndBlock
|
|
* @static
|
|
* @param {tendermint.abci.IResponseEndBlock=} [properties] Properties to set
|
|
* @returns {tendermint.abci.ResponseEndBlock} ResponseEndBlock instance
|
|
*/
|
|
ResponseEndBlock.create = function create(properties) {
|
|
return new ResponseEndBlock(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.validatorUpdates != null && message.validatorUpdates.length)
|
|
for (var i = 0; i < message.validatorUpdates.length; ++i)
|
|
$root.tendermint.abci.ValidatorUpdate.encode(message.validatorUpdates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.consensusParamUpdates != null && Object.hasOwnProperty.call(message, "consensusParamUpdates"))
|
|
$root.tendermint.abci.ConsensusParams.encode(message.consensusParamUpdates, 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.validatorUpdates && message.validatorUpdates.length))
|
|
message.validatorUpdates = [];
|
|
message.validatorUpdates.push($root.tendermint.abci.ValidatorUpdate.decode(reader, reader.uint32()));
|
|
break;
|
|
case 2:
|
|
message.consensusParamUpdates = $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.<string,*>} 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.validatorUpdates != null && message.hasOwnProperty("validatorUpdates")) {
|
|
if (!Array.isArray(message.validatorUpdates))
|
|
return "validatorUpdates: array expected";
|
|
for (var i = 0; i < message.validatorUpdates.length; ++i) {
|
|
var error = $root.tendermint.abci.ValidatorUpdate.verify(message.validatorUpdates[i]);
|
|
if (error)
|
|
return "validatorUpdates." + error;
|
|
}
|
|
}
|
|
if (message.consensusParamUpdates != null && message.hasOwnProperty("consensusParamUpdates")) {
|
|
var error = $root.tendermint.abci.ConsensusParams.verify(message.consensusParamUpdates);
|
|
if (error)
|
|
return "consensusParamUpdates." + 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.<string,*>} 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.validatorUpdates) {
|
|
if (!Array.isArray(object.validatorUpdates))
|
|
throw TypeError(".tendermint.abci.ResponseEndBlock.validatorUpdates: array expected");
|
|
message.validatorUpdates = [];
|
|
for (var i = 0; i < object.validatorUpdates.length; ++i) {
|
|
if (typeof object.validatorUpdates[i] !== "object")
|
|
throw TypeError(".tendermint.abci.ResponseEndBlock.validatorUpdates: object expected");
|
|
message.validatorUpdates[i] = $root.tendermint.abci.ValidatorUpdate.fromObject(object.validatorUpdates[i]);
|
|
}
|
|
}
|
|
if (object.consensusParamUpdates != null) {
|
|
if (typeof object.consensusParamUpdates !== "object")
|
|
throw TypeError(".tendermint.abci.ResponseEndBlock.consensusParamUpdates: object expected");
|
|
message.consensusParamUpdates = $root.tendermint.abci.ConsensusParams.fromObject(object.consensusParamUpdates);
|
|
}
|
|
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.<string,*>} Plain object
|
|
*/
|
|
ResponseEndBlock.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) {
|
|
object.validatorUpdates = [];
|
|
object.events = [];
|
|
}
|
|
if (options.defaults)
|
|
object.consensusParamUpdates = null;
|
|
if (message.validatorUpdates && message.validatorUpdates.length) {
|
|
object.validatorUpdates = [];
|
|
for (var j = 0; j < message.validatorUpdates.length; ++j)
|
|
object.validatorUpdates[j] = $root.tendermint.abci.ValidatorUpdate.toObject(message.validatorUpdates[j], options);
|
|
}
|
|
if (message.consensusParamUpdates != null && message.hasOwnProperty("consensusParamUpdates"))
|
|
object.consensusParamUpdates = $root.tendermint.abci.ConsensusParams.toObject(message.consensusParamUpdates, 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.<string,*>} JSON object
|
|
*/
|
|
ResponseEndBlock.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ResponseEndBlock;
|
|
})(abci.ResponseEndBlock || {});
|
|
|
|
abci.ResponseCommit = (function(ResponseCommit) {
|
|
|
|
/**
|
|
* Properties of a ResponseCommit.
|
|
* @memberof tendermint.abci
|
|
* @interface IResponseCommit
|
|
* @property {Uint8Array|null} [data] ResponseCommit data
|
|
* @property {number|Long|null} [retainHeight] ResponseCommit retainHeight
|
|
*/
|
|
|
|
/**
|
|
* 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 retainHeight.
|
|
* @member {number|Long} retainHeight
|
|
* @memberof tendermint.abci.ResponseCommit
|
|
* @instance
|
|
*/
|
|
ResponseCommit.prototype.retainHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* Creates a new ResponseCommit instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.ResponseCommit
|
|
* @static
|
|
* @param {tendermint.abci.IResponseCommit=} [properties] Properties to set
|
|
* @returns {tendermint.abci.ResponseCommit} ResponseCommit instance
|
|
*/
|
|
ResponseCommit.create = function create(properties) {
|
|
return new ResponseCommit(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.retainHeight != null && Object.hasOwnProperty.call(message, "retainHeight"))
|
|
writer.uint32(/* id 3, wireType 0 =*/24).int64(message.retainHeight);
|
|
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.retainHeight = 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.<string,*>} 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.retainHeight != null && message.hasOwnProperty("retainHeight"))
|
|
if (!$util.isInteger(message.retainHeight) && !(message.retainHeight && $util.isInteger(message.retainHeight.low) && $util.isInteger(message.retainHeight.high)))
|
|
return "retainHeight: 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.<string,*>} 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.retainHeight != null)
|
|
if ($util.Long)
|
|
(message.retainHeight = $util.Long.fromValue(object.retainHeight)).unsigned = false;
|
|
else if (typeof object.retainHeight === "string")
|
|
message.retainHeight = parseInt(object.retainHeight, 10);
|
|
else if (typeof object.retainHeight === "number")
|
|
message.retainHeight = object.retainHeight;
|
|
else if (typeof object.retainHeight === "object")
|
|
message.retainHeight = new $util.LongBits(object.retainHeight.low >>> 0, object.retainHeight.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.<string,*>} 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.retainHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.retainHeight = 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.retainHeight != null && message.hasOwnProperty("retainHeight"))
|
|
if (typeof message.retainHeight === "number")
|
|
object.retainHeight = options.longs === String ? String(message.retainHeight) : message.retainHeight;
|
|
else
|
|
object.retainHeight = options.longs === String ? $util.Long.prototype.toString.call(message.retainHeight) : options.longs === Number ? new $util.LongBits(message.retainHeight.low >>> 0, message.retainHeight.high >>> 0).toNumber() : message.retainHeight;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this ResponseCommit to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.abci.ResponseCommit
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
ResponseCommit.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ResponseCommit;
|
|
})(abci.ResponseCommit || {});
|
|
|
|
abci.ResponseListSnapshots = (function(ResponseListSnapshots) {
|
|
|
|
/**
|
|
* Properties of a ResponseListSnapshots.
|
|
* @memberof tendermint.abci
|
|
* @interface IResponseListSnapshots
|
|
* @property {Array.<tendermint.abci.ISnapshot>|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.<tendermint.abci.ISnapshot>} snapshots
|
|
* @memberof tendermint.abci.ResponseListSnapshots
|
|
* @instance
|
|
*/
|
|
ResponseListSnapshots.prototype.snapshots = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new ResponseListSnapshots instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.ResponseListSnapshots
|
|
* @static
|
|
* @param {tendermint.abci.IResponseListSnapshots=} [properties] Properties to set
|
|
* @returns {tendermint.abci.ResponseListSnapshots} ResponseListSnapshots instance
|
|
*/
|
|
ResponseListSnapshots.create = function create(properties) {
|
|
return new ResponseListSnapshots(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
ResponseListSnapshots.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ResponseListSnapshots;
|
|
})(abci.ResponseListSnapshots || {});
|
|
|
|
abci.ResponseOfferSnapshot = (function(ResponseOfferSnapshot) {
|
|
|
|
/**
|
|
* 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;
|
|
|
|
/**
|
|
* Creates a new ResponseOfferSnapshot instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.ResponseOfferSnapshot
|
|
* @static
|
|
* @param {tendermint.abci.IResponseOfferSnapshot=} [properties] Properties to set
|
|
* @returns {tendermint.abci.ResponseOfferSnapshot} ResponseOfferSnapshot instance
|
|
*/
|
|
ResponseOfferSnapshot.create = function create(properties) {
|
|
return new ResponseOfferSnapshot(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
ResponseOfferSnapshot.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Result enum.
|
|
* @name tendermint.abci.ResponseOfferSnapshot.Result
|
|
* @enum {string}
|
|
* @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.ResponseOfferSnapshot || {});
|
|
|
|
abci.ResponseLoadSnapshotChunk = (function(ResponseLoadSnapshotChunk) {
|
|
|
|
/**
|
|
* 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([]);
|
|
|
|
/**
|
|
* Creates a new ResponseLoadSnapshotChunk instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.ResponseLoadSnapshotChunk
|
|
* @static
|
|
* @param {tendermint.abci.IResponseLoadSnapshotChunk=} [properties] Properties to set
|
|
* @returns {tendermint.abci.ResponseLoadSnapshotChunk} ResponseLoadSnapshotChunk instance
|
|
*/
|
|
ResponseLoadSnapshotChunk.create = function create(properties) {
|
|
return new ResponseLoadSnapshotChunk(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
ResponseLoadSnapshotChunk.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ResponseLoadSnapshotChunk;
|
|
})(abci.ResponseLoadSnapshotChunk || {});
|
|
|
|
abci.ResponseApplySnapshotChunk = (function(ResponseApplySnapshotChunk) {
|
|
|
|
/**
|
|
* Properties of a ResponseApplySnapshotChunk.
|
|
* @memberof tendermint.abci
|
|
* @interface IResponseApplySnapshotChunk
|
|
* @property {tendermint.abci.ResponseApplySnapshotChunk.Result|null} [result] ResponseApplySnapshotChunk result
|
|
* @property {Array.<number>|null} [refetchChunks] ResponseApplySnapshotChunk refetchChunks
|
|
* @property {Array.<string>|null} [rejectSenders] ResponseApplySnapshotChunk rejectSenders
|
|
*/
|
|
|
|
/**
|
|
* 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.refetchChunks = [];
|
|
this.rejectSenders = [];
|
|
if (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 refetchChunks.
|
|
* @member {Array.<number>} refetchChunks
|
|
* @memberof tendermint.abci.ResponseApplySnapshotChunk
|
|
* @instance
|
|
*/
|
|
ResponseApplySnapshotChunk.prototype.refetchChunks = $util.emptyArray;
|
|
|
|
/**
|
|
* ResponseApplySnapshotChunk rejectSenders.
|
|
* @member {Array.<string>} rejectSenders
|
|
* @memberof tendermint.abci.ResponseApplySnapshotChunk
|
|
* @instance
|
|
*/
|
|
ResponseApplySnapshotChunk.prototype.rejectSenders = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new ResponseApplySnapshotChunk instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.ResponseApplySnapshotChunk
|
|
* @static
|
|
* @param {tendermint.abci.IResponseApplySnapshotChunk=} [properties] Properties to set
|
|
* @returns {tendermint.abci.ResponseApplySnapshotChunk} ResponseApplySnapshotChunk instance
|
|
*/
|
|
ResponseApplySnapshotChunk.create = function create(properties) {
|
|
return new ResponseApplySnapshotChunk(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.refetchChunks != null && message.refetchChunks.length) {
|
|
writer.uint32(/* id 2, wireType 2 =*/18).fork();
|
|
for (var i = 0; i < message.refetchChunks.length; ++i)
|
|
writer.uint32(message.refetchChunks[i]);
|
|
writer.ldelim();
|
|
}
|
|
if (message.rejectSenders != null && message.rejectSenders.length)
|
|
for (var i = 0; i < message.rejectSenders.length; ++i)
|
|
writer.uint32(/* id 3, wireType 2 =*/26).string(message.rejectSenders[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.refetchChunks && message.refetchChunks.length))
|
|
message.refetchChunks = [];
|
|
if ((tag & 7) === 2) {
|
|
var end2 = reader.uint32() + reader.pos;
|
|
while (reader.pos < end2)
|
|
message.refetchChunks.push(reader.uint32());
|
|
} else
|
|
message.refetchChunks.push(reader.uint32());
|
|
break;
|
|
case 3:
|
|
if (!(message.rejectSenders && message.rejectSenders.length))
|
|
message.rejectSenders = [];
|
|
message.rejectSenders.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.<string,*>} 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.refetchChunks != null && message.hasOwnProperty("refetchChunks")) {
|
|
if (!Array.isArray(message.refetchChunks))
|
|
return "refetchChunks: array expected";
|
|
for (var i = 0; i < message.refetchChunks.length; ++i)
|
|
if (!$util.isInteger(message.refetchChunks[i]))
|
|
return "refetchChunks: integer[] expected";
|
|
}
|
|
if (message.rejectSenders != null && message.hasOwnProperty("rejectSenders")) {
|
|
if (!Array.isArray(message.rejectSenders))
|
|
return "rejectSenders: array expected";
|
|
for (var i = 0; i < message.rejectSenders.length; ++i)
|
|
if (!$util.isString(message.rejectSenders[i]))
|
|
return "rejectSenders: 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.<string,*>} 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.refetchChunks) {
|
|
if (!Array.isArray(object.refetchChunks))
|
|
throw TypeError(".tendermint.abci.ResponseApplySnapshotChunk.refetchChunks: array expected");
|
|
message.refetchChunks = [];
|
|
for (var i = 0; i < object.refetchChunks.length; ++i)
|
|
message.refetchChunks[i] = object.refetchChunks[i] >>> 0;
|
|
}
|
|
if (object.rejectSenders) {
|
|
if (!Array.isArray(object.rejectSenders))
|
|
throw TypeError(".tendermint.abci.ResponseApplySnapshotChunk.rejectSenders: array expected");
|
|
message.rejectSenders = [];
|
|
for (var i = 0; i < object.rejectSenders.length; ++i)
|
|
message.rejectSenders[i] = String(object.rejectSenders[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.<string,*>} Plain object
|
|
*/
|
|
ResponseApplySnapshotChunk.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) {
|
|
object.refetchChunks = [];
|
|
object.rejectSenders = [];
|
|
}
|
|
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.refetchChunks && message.refetchChunks.length) {
|
|
object.refetchChunks = [];
|
|
for (var j = 0; j < message.refetchChunks.length; ++j)
|
|
object.refetchChunks[j] = message.refetchChunks[j];
|
|
}
|
|
if (message.rejectSenders && message.rejectSenders.length) {
|
|
object.rejectSenders = [];
|
|
for (var j = 0; j < message.rejectSenders.length; ++j)
|
|
object.rejectSenders[j] = message.rejectSenders[j];
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this ResponseApplySnapshotChunk to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.abci.ResponseApplySnapshotChunk
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
ResponseApplySnapshotChunk.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
/**
|
|
* Result enum.
|
|
* @name tendermint.abci.ResponseApplySnapshotChunk.Result
|
|
* @enum {string}
|
|
* @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.ResponseApplySnapshotChunk || {});
|
|
|
|
abci.ConsensusParams = (function(ConsensusParams) {
|
|
|
|
/**
|
|
* 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;
|
|
|
|
/**
|
|
* Creates a new ConsensusParams instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.ConsensusParams
|
|
* @static
|
|
* @param {tendermint.abci.IConsensusParams=} [properties] Properties to set
|
|
* @returns {tendermint.abci.ConsensusParams} ConsensusParams instance
|
|
*/
|
|
ConsensusParams.create = function create(properties) {
|
|
return new ConsensusParams(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
ConsensusParams.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ConsensusParams;
|
|
})(abci.ConsensusParams || {});
|
|
|
|
abci.BlockParams = (function(BlockParams) {
|
|
|
|
/**
|
|
* Properties of a BlockParams.
|
|
* @memberof tendermint.abci
|
|
* @interface IBlockParams
|
|
* @property {number|Long|null} [maxBytes] BlockParams maxBytes
|
|
* @property {number|Long|null} [maxGas] BlockParams maxGas
|
|
*/
|
|
|
|
/**
|
|
* 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 maxBytes.
|
|
* @member {number|Long} maxBytes
|
|
* @memberof tendermint.abci.BlockParams
|
|
* @instance
|
|
*/
|
|
BlockParams.prototype.maxBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* BlockParams maxGas.
|
|
* @member {number|Long} maxGas
|
|
* @memberof tendermint.abci.BlockParams
|
|
* @instance
|
|
*/
|
|
BlockParams.prototype.maxGas = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* Creates a new BlockParams instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.BlockParams
|
|
* @static
|
|
* @param {tendermint.abci.IBlockParams=} [properties] Properties to set
|
|
* @returns {tendermint.abci.BlockParams} BlockParams instance
|
|
*/
|
|
BlockParams.create = function create(properties) {
|
|
return new BlockParams(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes"))
|
|
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.maxBytes);
|
|
if (message.maxGas != null && Object.hasOwnProperty.call(message, "maxGas"))
|
|
writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxGas);
|
|
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.maxBytes = reader.int64();
|
|
break;
|
|
case 2:
|
|
message.maxGas = 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.<string,*>} 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.maxBytes != null && message.hasOwnProperty("maxBytes"))
|
|
if (!$util.isInteger(message.maxBytes) && !(message.maxBytes && $util.isInteger(message.maxBytes.low) && $util.isInteger(message.maxBytes.high)))
|
|
return "maxBytes: integer|Long expected";
|
|
if (message.maxGas != null && message.hasOwnProperty("maxGas"))
|
|
if (!$util.isInteger(message.maxGas) && !(message.maxGas && $util.isInteger(message.maxGas.low) && $util.isInteger(message.maxGas.high)))
|
|
return "maxGas: 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.<string,*>} 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.maxBytes != null)
|
|
if ($util.Long)
|
|
(message.maxBytes = $util.Long.fromValue(object.maxBytes)).unsigned = false;
|
|
else if (typeof object.maxBytes === "string")
|
|
message.maxBytes = parseInt(object.maxBytes, 10);
|
|
else if (typeof object.maxBytes === "number")
|
|
message.maxBytes = object.maxBytes;
|
|
else if (typeof object.maxBytes === "object")
|
|
message.maxBytes = new $util.LongBits(object.maxBytes.low >>> 0, object.maxBytes.high >>> 0).toNumber();
|
|
if (object.maxGas != null)
|
|
if ($util.Long)
|
|
(message.maxGas = $util.Long.fromValue(object.maxGas)).unsigned = false;
|
|
else if (typeof object.maxGas === "string")
|
|
message.maxGas = parseInt(object.maxGas, 10);
|
|
else if (typeof object.maxGas === "number")
|
|
message.maxGas = object.maxGas;
|
|
else if (typeof object.maxGas === "object")
|
|
message.maxGas = new $util.LongBits(object.maxGas.low >>> 0, object.maxGas.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.<string,*>} 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.maxBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.maxBytes = options.longs === String ? "0" : 0;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.maxGas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.maxGas = options.longs === String ? "0" : 0;
|
|
}
|
|
if (message.maxBytes != null && message.hasOwnProperty("maxBytes"))
|
|
if (typeof message.maxBytes === "number")
|
|
object.maxBytes = options.longs === String ? String(message.maxBytes) : message.maxBytes;
|
|
else
|
|
object.maxBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxBytes) : options.longs === Number ? new $util.LongBits(message.maxBytes.low >>> 0, message.maxBytes.high >>> 0).toNumber() : message.maxBytes;
|
|
if (message.maxGas != null && message.hasOwnProperty("maxGas"))
|
|
if (typeof message.maxGas === "number")
|
|
object.maxGas = options.longs === String ? String(message.maxGas) : message.maxGas;
|
|
else
|
|
object.maxGas = options.longs === String ? $util.Long.prototype.toString.call(message.maxGas) : options.longs === Number ? new $util.LongBits(message.maxGas.low >>> 0, message.maxGas.high >>> 0).toNumber() : message.maxGas;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this BlockParams to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.abci.BlockParams
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
BlockParams.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return BlockParams;
|
|
})(abci.BlockParams || {});
|
|
|
|
abci.LastCommitInfo = (function(LastCommitInfo) {
|
|
|
|
/**
|
|
* Properties of a LastCommitInfo.
|
|
* @memberof tendermint.abci
|
|
* @interface ILastCommitInfo
|
|
* @property {number|null} [round] LastCommitInfo round
|
|
* @property {Array.<tendermint.abci.IVoteInfo>|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.<tendermint.abci.IVoteInfo>} votes
|
|
* @memberof tendermint.abci.LastCommitInfo
|
|
* @instance
|
|
*/
|
|
LastCommitInfo.prototype.votes = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new LastCommitInfo instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.LastCommitInfo
|
|
* @static
|
|
* @param {tendermint.abci.ILastCommitInfo=} [properties] Properties to set
|
|
* @returns {tendermint.abci.LastCommitInfo} LastCommitInfo instance
|
|
*/
|
|
LastCommitInfo.create = function create(properties) {
|
|
return new LastCommitInfo(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
LastCommitInfo.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return LastCommitInfo;
|
|
})(abci.LastCommitInfo || {});
|
|
|
|
abci.Event = (function(Event) {
|
|
|
|
/**
|
|
* Properties of an Event.
|
|
* @memberof tendermint.abci
|
|
* @interface IEvent
|
|
* @property {string|null} [type] Event type
|
|
* @property {Array.<tendermint.abci.IEventAttribute>|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.<tendermint.abci.IEventAttribute>} attributes
|
|
* @memberof tendermint.abci.Event
|
|
* @instance
|
|
*/
|
|
Event.prototype.attributes = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new Event instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.Event
|
|
* @static
|
|
* @param {tendermint.abci.IEvent=} [properties] Properties to set
|
|
* @returns {tendermint.abci.Event} Event instance
|
|
*/
|
|
Event.create = function create(properties) {
|
|
return new Event(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
Event.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Event;
|
|
})(abci.Event || {});
|
|
|
|
abci.EventAttribute = (function(EventAttribute) {
|
|
|
|
/**
|
|
* 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;
|
|
|
|
/**
|
|
* Creates a new EventAttribute instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.EventAttribute
|
|
* @static
|
|
* @param {tendermint.abci.IEventAttribute=} [properties] Properties to set
|
|
* @returns {tendermint.abci.EventAttribute} EventAttribute instance
|
|
*/
|
|
EventAttribute.create = function create(properties) {
|
|
return new EventAttribute(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
EventAttribute.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return EventAttribute;
|
|
})(abci.EventAttribute || {});
|
|
|
|
abci.TxResult = (function(TxResult) {
|
|
|
|
/**
|
|
* Properties of a TxResult.
|
|
* @memberof tendermint.abci
|
|
* @interface ITxResult
|
|
* @property {number|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 {number|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;
|
|
|
|
/**
|
|
* Creates a new TxResult instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.TxResult
|
|
* @static
|
|
* @param {tendermint.abci.ITxResult=} [properties] Properties to set
|
|
* @returns {tendermint.abci.TxResult} TxResult instance
|
|
*/
|
|
TxResult.create = function create(properties) {
|
|
return new TxResult(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
TxResult.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return TxResult;
|
|
})(abci.TxResult || {});
|
|
|
|
abci.Validator = (function(Validator) {
|
|
|
|
/**
|
|
* Properties of a Validator.
|
|
* @memberof tendermint.abci
|
|
* @interface IValidator
|
|
* @property {Uint8Array|null} [address] Validator address
|
|
* @property {number|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 {number|Long} power
|
|
* @memberof tendermint.abci.Validator
|
|
* @instance
|
|
*/
|
|
Validator.prototype.power = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* Creates a new Validator instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.Validator
|
|
* @static
|
|
* @param {tendermint.abci.IValidator=} [properties] Properties to set
|
|
* @returns {tendermint.abci.Validator} Validator instance
|
|
*/
|
|
Validator.create = function create(properties) {
|
|
return new Validator(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
Validator.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Validator;
|
|
})(abci.Validator || {});
|
|
|
|
abci.ValidatorUpdate = (function(ValidatorUpdate) {
|
|
|
|
/**
|
|
* Properties of a ValidatorUpdate.
|
|
* @memberof tendermint.abci
|
|
* @interface IValidatorUpdate
|
|
* @property {tendermint.crypto.IPublicKey|null} [pubKey] ValidatorUpdate pubKey
|
|
* @property {number|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 pubKey.
|
|
* @member {tendermint.crypto.IPublicKey|null|undefined} pubKey
|
|
* @memberof tendermint.abci.ValidatorUpdate
|
|
* @instance
|
|
*/
|
|
ValidatorUpdate.prototype.pubKey = null;
|
|
|
|
/**
|
|
* ValidatorUpdate power.
|
|
* @member {number|Long} power
|
|
* @memberof tendermint.abci.ValidatorUpdate
|
|
* @instance
|
|
*/
|
|
ValidatorUpdate.prototype.power = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* Creates a new ValidatorUpdate instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.ValidatorUpdate
|
|
* @static
|
|
* @param {tendermint.abci.IValidatorUpdate=} [properties] Properties to set
|
|
* @returns {tendermint.abci.ValidatorUpdate} ValidatorUpdate instance
|
|
*/
|
|
ValidatorUpdate.create = function create(properties) {
|
|
return new ValidatorUpdate(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.pubKey != null && Object.hasOwnProperty.call(message, "pubKey"))
|
|
$root.tendermint.crypto.PublicKey.encode(message.pubKey, 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.pubKey = $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.<string,*>} 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.pubKey != null && message.hasOwnProperty("pubKey")) {
|
|
var error = $root.tendermint.crypto.PublicKey.verify(message.pubKey);
|
|
if (error)
|
|
return "pubKey." + 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.<string,*>} 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.pubKey != null) {
|
|
if (typeof object.pubKey !== "object")
|
|
throw TypeError(".tendermint.abci.ValidatorUpdate.pubKey: object expected");
|
|
message.pubKey = $root.tendermint.crypto.PublicKey.fromObject(object.pubKey);
|
|
}
|
|
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.<string,*>} Plain object
|
|
*/
|
|
ValidatorUpdate.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.pubKey = 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.pubKey != null && message.hasOwnProperty("pubKey"))
|
|
object.pubKey = $root.tendermint.crypto.PublicKey.toObject(message.pubKey, 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.<string,*>} JSON object
|
|
*/
|
|
ValidatorUpdate.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ValidatorUpdate;
|
|
})(abci.ValidatorUpdate || {});
|
|
|
|
abci.VoteInfo = (function(VoteInfo) {
|
|
|
|
/**
|
|
* Properties of a VoteInfo.
|
|
* @memberof tendermint.abci
|
|
* @interface IVoteInfo
|
|
* @property {tendermint.abci.IValidator|null} [validator] VoteInfo validator
|
|
* @property {boolean|null} [signedLastBlock] VoteInfo signedLastBlock
|
|
*/
|
|
|
|
/**
|
|
* 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 signedLastBlock.
|
|
* @member {boolean} signedLastBlock
|
|
* @memberof tendermint.abci.VoteInfo
|
|
* @instance
|
|
*/
|
|
VoteInfo.prototype.signedLastBlock = false;
|
|
|
|
/**
|
|
* Creates a new VoteInfo instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.VoteInfo
|
|
* @static
|
|
* @param {tendermint.abci.IVoteInfo=} [properties] Properties to set
|
|
* @returns {tendermint.abci.VoteInfo} VoteInfo instance
|
|
*/
|
|
VoteInfo.create = function create(properties) {
|
|
return new VoteInfo(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.signedLastBlock != null && Object.hasOwnProperty.call(message, "signedLastBlock"))
|
|
writer.uint32(/* id 2, wireType 0 =*/16).bool(message.signedLastBlock);
|
|
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.signedLastBlock = 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.<string,*>} 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.signedLastBlock != null && message.hasOwnProperty("signedLastBlock"))
|
|
if (typeof message.signedLastBlock !== "boolean")
|
|
return "signedLastBlock: 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.<string,*>} 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.signedLastBlock != null)
|
|
message.signedLastBlock = Boolean(object.signedLastBlock);
|
|
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.<string,*>} Plain object
|
|
*/
|
|
VoteInfo.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.validator = null;
|
|
object.signedLastBlock = false;
|
|
}
|
|
if (message.validator != null && message.hasOwnProperty("validator"))
|
|
object.validator = $root.tendermint.abci.Validator.toObject(message.validator, options);
|
|
if (message.signedLastBlock != null && message.hasOwnProperty("signedLastBlock"))
|
|
object.signedLastBlock = message.signedLastBlock;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this VoteInfo to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.abci.VoteInfo
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
VoteInfo.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return VoteInfo;
|
|
})(abci.VoteInfo || {});
|
|
|
|
/**
|
|
* EvidenceType enum.
|
|
* @name tendermint.abci.EvidenceType
|
|
* @enum {string}
|
|
* @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(Evidence) {
|
|
|
|
/**
|
|
* 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 {number|Long|null} [height] Evidence height
|
|
* @property {google.protobuf.ITimestamp|null} [time] Evidence time
|
|
* @property {number|Long|null} [totalVotingPower] Evidence totalVotingPower
|
|
*/
|
|
|
|
/**
|
|
* 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 {number|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 totalVotingPower.
|
|
* @member {number|Long} totalVotingPower
|
|
* @memberof tendermint.abci.Evidence
|
|
* @instance
|
|
*/
|
|
Evidence.prototype.totalVotingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* Creates a new Evidence instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.Evidence
|
|
* @static
|
|
* @param {tendermint.abci.IEvidence=} [properties] Properties to set
|
|
* @returns {tendermint.abci.Evidence} Evidence instance
|
|
*/
|
|
Evidence.create = function create(properties) {
|
|
return new Evidence(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.totalVotingPower != null && Object.hasOwnProperty.call(message, "totalVotingPower"))
|
|
writer.uint32(/* id 5, wireType 0 =*/40).int64(message.totalVotingPower);
|
|
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.totalVotingPower = 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.<string,*>} 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.totalVotingPower != null && message.hasOwnProperty("totalVotingPower"))
|
|
if (!$util.isInteger(message.totalVotingPower) && !(message.totalVotingPower && $util.isInteger(message.totalVotingPower.low) && $util.isInteger(message.totalVotingPower.high)))
|
|
return "totalVotingPower: 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.<string,*>} 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.totalVotingPower != null)
|
|
if ($util.Long)
|
|
(message.totalVotingPower = $util.Long.fromValue(object.totalVotingPower)).unsigned = false;
|
|
else if (typeof object.totalVotingPower === "string")
|
|
message.totalVotingPower = parseInt(object.totalVotingPower, 10);
|
|
else if (typeof object.totalVotingPower === "number")
|
|
message.totalVotingPower = object.totalVotingPower;
|
|
else if (typeof object.totalVotingPower === "object")
|
|
message.totalVotingPower = new $util.LongBits(object.totalVotingPower.low >>> 0, object.totalVotingPower.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.<string,*>} 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.totalVotingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.totalVotingPower = 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.totalVotingPower != null && message.hasOwnProperty("totalVotingPower"))
|
|
if (typeof message.totalVotingPower === "number")
|
|
object.totalVotingPower = options.longs === String ? String(message.totalVotingPower) : message.totalVotingPower;
|
|
else
|
|
object.totalVotingPower = options.longs === String ? $util.Long.prototype.toString.call(message.totalVotingPower) : options.longs === Number ? new $util.LongBits(message.totalVotingPower.low >>> 0, message.totalVotingPower.high >>> 0).toNumber() : message.totalVotingPower;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Evidence to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.abci.Evidence
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Evidence.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Evidence;
|
|
})(abci.Evidence || {});
|
|
|
|
abci.Snapshot = (function(Snapshot) {
|
|
|
|
/**
|
|
* Properties of a Snapshot.
|
|
* @memberof tendermint.abci
|
|
* @interface ISnapshot
|
|
* @property {number|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 {number|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([]);
|
|
|
|
/**
|
|
* Creates a new Snapshot instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.abci.Snapshot
|
|
* @static
|
|
* @param {tendermint.abci.ISnapshot=} [properties] Properties to set
|
|
* @returns {tendermint.abci.Snapshot} Snapshot instance
|
|
*/
|
|
Snapshot.create = function create(properties) {
|
|
return new Snapshot(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
Snapshot.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Snapshot;
|
|
})(abci.Snapshot || {});
|
|
|
|
abci.ABCIApplication = (function(ABCIApplication) {
|
|
|
|
/**
|
|
* 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;
|
|
|
|
/**
|
|
* Creates new ABCIApplication service using the specified rpc implementation.
|
|
* @function create
|
|
* @memberof tendermint.abci.ABCIApplication
|
|
* @static
|
|
* @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
|
* @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
|
* @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
|
* @returns {ABCIApplication} RPC service. Useful where requests and/or responses are streamed.
|
|
*/
|
|
ABCIApplication.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
|
return new this(rpcImpl, requestDelimited, responseDelimited);
|
|
};
|
|
|
|
/**
|
|
* 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.IResponseEcho} [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<tendermint.abci.IResponseEcho>} 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.IResponseFlush} [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<tendermint.abci.IResponseFlush>} 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.IResponseInfo} [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<tendermint.abci.IResponseInfo>} 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.IResponseSetOption} [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<tendermint.abci.IResponseSetOption>} 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.IResponseDeliverTx} [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<tendermint.abci.IResponseDeliverTx>} 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.IResponseCheckTx} [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<tendermint.abci.IResponseCheckTx>} 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.IResponseQuery} [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<tendermint.abci.IResponseQuery>} 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.IResponseCommit} [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<tendermint.abci.IResponseCommit>} 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.IResponseInitChain} [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<tendermint.abci.IResponseInitChain>} 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.IResponseBeginBlock} [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<tendermint.abci.IResponseBeginBlock>} 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.IResponseEndBlock} [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<tendermint.abci.IResponseEndBlock>} 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.IResponseListSnapshots} [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<tendermint.abci.IResponseListSnapshots>} 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.IResponseOfferSnapshot} [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<tendermint.abci.IResponseOfferSnapshot>} 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.IResponseLoadSnapshotChunk} [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<tendermint.abci.IResponseLoadSnapshotChunk>} 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.IResponseApplySnapshotChunk} [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<tendermint.abci.IResponseApplySnapshotChunk>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
return ABCIApplication;
|
|
})(abci.ABCIApplication || {});
|
|
|
|
return abci;
|
|
})(tendermint.abci || {});
|
|
|
|
/**
|
|
* Namespace crypto.
|
|
* @memberof tendermint
|
|
* @namespace
|
|
*/
|
|
|
|
tendermint.crypto = (function(crypto) {
|
|
|
|
crypto.PublicKey = (function(PublicKey) {
|
|
|
|
/**
|
|
* 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} ed25519
|
|
* @memberof tendermint.crypto.PublicKey
|
|
* @instance
|
|
*/
|
|
PublicKey.prototype.ed25519 = $util.newBuffer([]);
|
|
|
|
/**
|
|
* PublicKey secp256k1.
|
|
* @member {Uint8Array} secp256k1
|
|
* @memberof tendermint.crypto.PublicKey
|
|
* @instance
|
|
*/
|
|
PublicKey.prototype.secp256k1 = $util.newBuffer([]);
|
|
|
|
// 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)
|
|
});
|
|
|
|
/**
|
|
* Creates a new PublicKey instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.crypto.PublicKey
|
|
* @static
|
|
* @param {tendermint.crypto.IPublicKey=} [properties] Properties to set
|
|
* @returns {tendermint.crypto.PublicKey} PublicKey instance
|
|
*/
|
|
PublicKey.create = function create(properties) {
|
|
return new PublicKey(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
PublicKey.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return PublicKey;
|
|
})(crypto.PublicKey || {});
|
|
|
|
crypto.Proof = (function(Proof) {
|
|
|
|
/**
|
|
* Properties of a Proof.
|
|
* @memberof tendermint.crypto
|
|
* @interface IProof
|
|
* @property {number|Long|null} [total] Proof total
|
|
* @property {number|Long|null} [index] Proof index
|
|
* @property {Uint8Array|null} [leafHash] Proof leafHash
|
|
* @property {Array.<Uint8Array>|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 {number|Long} total
|
|
* @memberof tendermint.crypto.Proof
|
|
* @instance
|
|
*/
|
|
Proof.prototype.total = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* Proof index.
|
|
* @member {number|Long} index
|
|
* @memberof tendermint.crypto.Proof
|
|
* @instance
|
|
*/
|
|
Proof.prototype.index = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* Proof leafHash.
|
|
* @member {Uint8Array} leafHash
|
|
* @memberof tendermint.crypto.Proof
|
|
* @instance
|
|
*/
|
|
Proof.prototype.leafHash = $util.newBuffer([]);
|
|
|
|
/**
|
|
* Proof aunts.
|
|
* @member {Array.<Uint8Array>} aunts
|
|
* @memberof tendermint.crypto.Proof
|
|
* @instance
|
|
*/
|
|
Proof.prototype.aunts = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new Proof instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.crypto.Proof
|
|
* @static
|
|
* @param {tendermint.crypto.IProof=} [properties] Properties to set
|
|
* @returns {tendermint.crypto.Proof} Proof instance
|
|
*/
|
|
Proof.create = function create(properties) {
|
|
return new Proof(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.leafHash != null && Object.hasOwnProperty.call(message, "leafHash"))
|
|
writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.leafHash);
|
|
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.leafHash = 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.<string,*>} 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.leafHash != null && message.hasOwnProperty("leafHash"))
|
|
if (!(message.leafHash && typeof message.leafHash.length === "number" || $util.isString(message.leafHash)))
|
|
return "leafHash: 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.<string,*>} 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.leafHash != null)
|
|
if (typeof object.leafHash === "string")
|
|
$util.base64.decode(object.leafHash, message.leafHash = $util.newBuffer($util.base64.length(object.leafHash)), 0);
|
|
else if (object.leafHash.length)
|
|
message.leafHash = object.leafHash;
|
|
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.<string,*>} 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.leafHash = "";
|
|
else {
|
|
object.leafHash = [];
|
|
if (options.bytes !== Array)
|
|
object.leafHash = $util.newBuffer(object.leafHash);
|
|
}
|
|
}
|
|
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.leafHash != null && message.hasOwnProperty("leafHash"))
|
|
object.leafHash = options.bytes === String ? $util.base64.encode(message.leafHash, 0, message.leafHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.leafHash) : message.leafHash;
|
|
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.<string,*>} JSON object
|
|
*/
|
|
Proof.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Proof;
|
|
})(crypto.Proof || {});
|
|
|
|
crypto.ValueOp = (function(ValueOp) {
|
|
|
|
/**
|
|
* 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;
|
|
|
|
/**
|
|
* Creates a new ValueOp instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.crypto.ValueOp
|
|
* @static
|
|
* @param {tendermint.crypto.IValueOp=} [properties] Properties to set
|
|
* @returns {tendermint.crypto.ValueOp} ValueOp instance
|
|
*/
|
|
ValueOp.create = function create(properties) {
|
|
return new ValueOp(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
ValueOp.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ValueOp;
|
|
})(crypto.ValueOp || {});
|
|
|
|
crypto.DominoOp = (function(DominoOp) {
|
|
|
|
/**
|
|
* 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 = "";
|
|
|
|
/**
|
|
* Creates a new DominoOp instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.crypto.DominoOp
|
|
* @static
|
|
* @param {tendermint.crypto.IDominoOp=} [properties] Properties to set
|
|
* @returns {tendermint.crypto.DominoOp} DominoOp instance
|
|
*/
|
|
DominoOp.create = function create(properties) {
|
|
return new DominoOp(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
DominoOp.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return DominoOp;
|
|
})(crypto.DominoOp || {});
|
|
|
|
crypto.ProofOp = (function(ProofOp) {
|
|
|
|
/**
|
|
* 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([]);
|
|
|
|
/**
|
|
* Creates a new ProofOp instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.crypto.ProofOp
|
|
* @static
|
|
* @param {tendermint.crypto.IProofOp=} [properties] Properties to set
|
|
* @returns {tendermint.crypto.ProofOp} ProofOp instance
|
|
*/
|
|
ProofOp.create = function create(properties) {
|
|
return new ProofOp(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
ProofOp.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ProofOp;
|
|
})(crypto.ProofOp || {});
|
|
|
|
crypto.ProofOps = (function(ProofOps) {
|
|
|
|
/**
|
|
* Properties of a ProofOps.
|
|
* @memberof tendermint.crypto
|
|
* @interface IProofOps
|
|
* @property {Array.<tendermint.crypto.IProofOp>|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.<tendermint.crypto.IProofOp>} ops
|
|
* @memberof tendermint.crypto.ProofOps
|
|
* @instance
|
|
*/
|
|
ProofOps.prototype.ops = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new ProofOps instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.crypto.ProofOps
|
|
* @static
|
|
* @param {tendermint.crypto.IProofOps=} [properties] Properties to set
|
|
* @returns {tendermint.crypto.ProofOps} ProofOps instance
|
|
*/
|
|
ProofOps.create = function create(properties) {
|
|
return new ProofOps(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
ProofOps.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ProofOps;
|
|
})(crypto.ProofOps || {});
|
|
|
|
return crypto;
|
|
})(tendermint.crypto || {});
|
|
|
|
/**
|
|
* Namespace p2p.
|
|
* @memberof tendermint
|
|
* @namespace
|
|
*/
|
|
|
|
tendermint.p2p = (function(p2p) {
|
|
|
|
p2p.NetAddress = (function(NetAddress) {
|
|
|
|
/**
|
|
* Properties of a NetAddress.
|
|
* @memberof tendermint.p2p
|
|
* @interface INetAddress
|
|
* @property {string|null} [id] NetAddress id
|
|
* @property {string|null} [ip] NetAddress ip
|
|
* @property {number|null} [port] NetAddress port
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new NetAddress.
|
|
* @memberof tendermint.p2p
|
|
* @classdesc Represents a NetAddress.
|
|
* @implements INetAddress
|
|
* @constructor
|
|
* @param {tendermint.p2p.INetAddress=} [properties] Properties to set
|
|
*/
|
|
function NetAddress(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* NetAddress id.
|
|
* @member {string} id
|
|
* @memberof tendermint.p2p.NetAddress
|
|
* @instance
|
|
*/
|
|
NetAddress.prototype.id = "";
|
|
|
|
/**
|
|
* NetAddress ip.
|
|
* @member {string} ip
|
|
* @memberof tendermint.p2p.NetAddress
|
|
* @instance
|
|
*/
|
|
NetAddress.prototype.ip = "";
|
|
|
|
/**
|
|
* NetAddress port.
|
|
* @member {number} port
|
|
* @memberof tendermint.p2p.NetAddress
|
|
* @instance
|
|
*/
|
|
NetAddress.prototype.port = 0;
|
|
|
|
/**
|
|
* Creates a new NetAddress instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.p2p.NetAddress
|
|
* @static
|
|
* @param {tendermint.p2p.INetAddress=} [properties] Properties to set
|
|
* @returns {tendermint.p2p.NetAddress} NetAddress instance
|
|
*/
|
|
NetAddress.create = function create(properties) {
|
|
return new NetAddress(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified NetAddress message. Does not implicitly {@link tendermint.p2p.NetAddress.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof tendermint.p2p.NetAddress
|
|
* @static
|
|
* @param {tendermint.p2p.INetAddress} message NetAddress message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
NetAddress.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.ip != null && Object.hasOwnProperty.call(message, "ip"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.ip);
|
|
if (message.port != null && Object.hasOwnProperty.call(message, "port"))
|
|
writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.port);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified NetAddress message, length delimited. Does not implicitly {@link tendermint.p2p.NetAddress.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof tendermint.p2p.NetAddress
|
|
* @static
|
|
* @param {tendermint.p2p.INetAddress} message NetAddress message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
NetAddress.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a NetAddress message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof tendermint.p2p.NetAddress
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {tendermint.p2p.NetAddress} NetAddress
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
NetAddress.decode = 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.p2p.NetAddress();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.id = reader.string();
|
|
break;
|
|
case 2:
|
|
message.ip = reader.string();
|
|
break;
|
|
case 3:
|
|
message.port = reader.uint32();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a NetAddress message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof tendermint.p2p.NetAddress
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {tendermint.p2p.NetAddress} NetAddress
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
NetAddress.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a NetAddress message.
|
|
* @function verify
|
|
* @memberof tendermint.p2p.NetAddress
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
NetAddress.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.ip != null && message.hasOwnProperty("ip"))
|
|
if (!$util.isString(message.ip))
|
|
return "ip: string expected";
|
|
if (message.port != null && message.hasOwnProperty("port"))
|
|
if (!$util.isInteger(message.port))
|
|
return "port: integer expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a NetAddress message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof tendermint.p2p.NetAddress
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {tendermint.p2p.NetAddress} NetAddress
|
|
*/
|
|
NetAddress.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.tendermint.p2p.NetAddress)
|
|
return object;
|
|
var message = new $root.tendermint.p2p.NetAddress();
|
|
if (object.id != null)
|
|
message.id = String(object.id);
|
|
if (object.ip != null)
|
|
message.ip = String(object.ip);
|
|
if (object.port != null)
|
|
message.port = object.port >>> 0;
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a NetAddress message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof tendermint.p2p.NetAddress
|
|
* @static
|
|
* @param {tendermint.p2p.NetAddress} message NetAddress
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
NetAddress.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.id = "";
|
|
object.ip = "";
|
|
object.port = 0;
|
|
}
|
|
if (message.id != null && message.hasOwnProperty("id"))
|
|
object.id = message.id;
|
|
if (message.ip != null && message.hasOwnProperty("ip"))
|
|
object.ip = message.ip;
|
|
if (message.port != null && message.hasOwnProperty("port"))
|
|
object.port = message.port;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this NetAddress to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.p2p.NetAddress
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
NetAddress.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return NetAddress;
|
|
})(p2p.NetAddress || {});
|
|
|
|
p2p.ProtocolVersion = (function(ProtocolVersion) {
|
|
|
|
/**
|
|
* Properties of a ProtocolVersion.
|
|
* @memberof tendermint.p2p
|
|
* @interface IProtocolVersion
|
|
* @property {number|Long|null} [p2p] ProtocolVersion p2p
|
|
* @property {number|Long|null} [block] ProtocolVersion block
|
|
* @property {number|Long|null} [app] ProtocolVersion app
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new ProtocolVersion.
|
|
* @memberof tendermint.p2p
|
|
* @classdesc Represents a ProtocolVersion.
|
|
* @implements IProtocolVersion
|
|
* @constructor
|
|
* @param {tendermint.p2p.IProtocolVersion=} [properties] Properties to set
|
|
*/
|
|
function ProtocolVersion(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* ProtocolVersion p2p.
|
|
* @member {number|Long} p2p
|
|
* @memberof tendermint.p2p.ProtocolVersion
|
|
* @instance
|
|
*/
|
|
ProtocolVersion.prototype.p2p = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* ProtocolVersion block.
|
|
* @member {number|Long} block
|
|
* @memberof tendermint.p2p.ProtocolVersion
|
|
* @instance
|
|
*/
|
|
ProtocolVersion.prototype.block = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* ProtocolVersion app.
|
|
* @member {number|Long} app
|
|
* @memberof tendermint.p2p.ProtocolVersion
|
|
* @instance
|
|
*/
|
|
ProtocolVersion.prototype.app = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* Creates a new ProtocolVersion instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.p2p.ProtocolVersion
|
|
* @static
|
|
* @param {tendermint.p2p.IProtocolVersion=} [properties] Properties to set
|
|
* @returns {tendermint.p2p.ProtocolVersion} ProtocolVersion instance
|
|
*/
|
|
ProtocolVersion.create = function create(properties) {
|
|
return new ProtocolVersion(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified ProtocolVersion message. Does not implicitly {@link tendermint.p2p.ProtocolVersion.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof tendermint.p2p.ProtocolVersion
|
|
* @static
|
|
* @param {tendermint.p2p.IProtocolVersion} message ProtocolVersion message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
ProtocolVersion.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.p2p != null && Object.hasOwnProperty.call(message, "p2p"))
|
|
writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.p2p);
|
|
if (message.block != null && Object.hasOwnProperty.call(message, "block"))
|
|
writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.block);
|
|
if (message.app != null && Object.hasOwnProperty.call(message, "app"))
|
|
writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.app);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified ProtocolVersion message, length delimited. Does not implicitly {@link tendermint.p2p.ProtocolVersion.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof tendermint.p2p.ProtocolVersion
|
|
* @static
|
|
* @param {tendermint.p2p.IProtocolVersion} message ProtocolVersion message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
ProtocolVersion.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a ProtocolVersion message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof tendermint.p2p.ProtocolVersion
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {tendermint.p2p.ProtocolVersion} ProtocolVersion
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
ProtocolVersion.decode = 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.p2p.ProtocolVersion();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.p2p = reader.uint64();
|
|
break;
|
|
case 2:
|
|
message.block = reader.uint64();
|
|
break;
|
|
case 3:
|
|
message.app = reader.uint64();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a ProtocolVersion message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof tendermint.p2p.ProtocolVersion
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {tendermint.p2p.ProtocolVersion} ProtocolVersion
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
ProtocolVersion.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a ProtocolVersion message.
|
|
* @function verify
|
|
* @memberof tendermint.p2p.ProtocolVersion
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
ProtocolVersion.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.p2p != null && message.hasOwnProperty("p2p"))
|
|
if (!$util.isInteger(message.p2p) && !(message.p2p && $util.isInteger(message.p2p.low) && $util.isInteger(message.p2p.high)))
|
|
return "p2p: integer|Long 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 ProtocolVersion message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof tendermint.p2p.ProtocolVersion
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {tendermint.p2p.ProtocolVersion} ProtocolVersion
|
|
*/
|
|
ProtocolVersion.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.tendermint.p2p.ProtocolVersion)
|
|
return object;
|
|
var message = new $root.tendermint.p2p.ProtocolVersion();
|
|
if (object.p2p != null)
|
|
if ($util.Long)
|
|
(message.p2p = $util.Long.fromValue(object.p2p)).unsigned = true;
|
|
else if (typeof object.p2p === "string")
|
|
message.p2p = parseInt(object.p2p, 10);
|
|
else if (typeof object.p2p === "number")
|
|
message.p2p = object.p2p;
|
|
else if (typeof object.p2p === "object")
|
|
message.p2p = new $util.LongBits(object.p2p.low >>> 0, object.p2p.high >>> 0).toNumber(true);
|
|
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 ProtocolVersion message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof tendermint.p2p.ProtocolVersion
|
|
* @static
|
|
* @param {tendermint.p2p.ProtocolVersion} message ProtocolVersion
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
ProtocolVersion.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.p2p = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.p2p = options.longs === String ? "0" : 0;
|
|
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.p2p != null && message.hasOwnProperty("p2p"))
|
|
if (typeof message.p2p === "number")
|
|
object.p2p = options.longs === String ? String(message.p2p) : message.p2p;
|
|
else
|
|
object.p2p = options.longs === String ? $util.Long.prototype.toString.call(message.p2p) : options.longs === Number ? new $util.LongBits(message.p2p.low >>> 0, message.p2p.high >>> 0).toNumber(true) : message.p2p;
|
|
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 ProtocolVersion to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.p2p.ProtocolVersion
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
ProtocolVersion.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ProtocolVersion;
|
|
})(p2p.ProtocolVersion || {});
|
|
|
|
p2p.DefaultNodeInfo = (function(DefaultNodeInfo) {
|
|
|
|
/**
|
|
* Properties of a DefaultNodeInfo.
|
|
* @memberof tendermint.p2p
|
|
* @interface IDefaultNodeInfo
|
|
* @property {tendermint.p2p.IProtocolVersion|null} [protocolVersion] DefaultNodeInfo protocolVersion
|
|
* @property {string|null} [defaultNodeId] DefaultNodeInfo defaultNodeId
|
|
* @property {string|null} [listenAddr] DefaultNodeInfo listenAddr
|
|
* @property {string|null} [network] DefaultNodeInfo network
|
|
* @property {string|null} [version] DefaultNodeInfo version
|
|
* @property {Uint8Array|null} [channels] DefaultNodeInfo channels
|
|
* @property {string|null} [moniker] DefaultNodeInfo moniker
|
|
* @property {tendermint.p2p.IDefaultNodeInfoOther|null} [other] DefaultNodeInfo other
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new DefaultNodeInfo.
|
|
* @memberof tendermint.p2p
|
|
* @classdesc Represents a DefaultNodeInfo.
|
|
* @implements IDefaultNodeInfo
|
|
* @constructor
|
|
* @param {tendermint.p2p.IDefaultNodeInfo=} [properties] Properties to set
|
|
*/
|
|
function DefaultNodeInfo(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* DefaultNodeInfo protocolVersion.
|
|
* @member {tendermint.p2p.IProtocolVersion|null|undefined} protocolVersion
|
|
* @memberof tendermint.p2p.DefaultNodeInfo
|
|
* @instance
|
|
*/
|
|
DefaultNodeInfo.prototype.protocolVersion = null;
|
|
|
|
/**
|
|
* DefaultNodeInfo defaultNodeId.
|
|
* @member {string} defaultNodeId
|
|
* @memberof tendermint.p2p.DefaultNodeInfo
|
|
* @instance
|
|
*/
|
|
DefaultNodeInfo.prototype.defaultNodeId = "";
|
|
|
|
/**
|
|
* DefaultNodeInfo listenAddr.
|
|
* @member {string} listenAddr
|
|
* @memberof tendermint.p2p.DefaultNodeInfo
|
|
* @instance
|
|
*/
|
|
DefaultNodeInfo.prototype.listenAddr = "";
|
|
|
|
/**
|
|
* DefaultNodeInfo network.
|
|
* @member {string} network
|
|
* @memberof tendermint.p2p.DefaultNodeInfo
|
|
* @instance
|
|
*/
|
|
DefaultNodeInfo.prototype.network = "";
|
|
|
|
/**
|
|
* DefaultNodeInfo version.
|
|
* @member {string} version
|
|
* @memberof tendermint.p2p.DefaultNodeInfo
|
|
* @instance
|
|
*/
|
|
DefaultNodeInfo.prototype.version = "";
|
|
|
|
/**
|
|
* DefaultNodeInfo channels.
|
|
* @member {Uint8Array} channels
|
|
* @memberof tendermint.p2p.DefaultNodeInfo
|
|
* @instance
|
|
*/
|
|
DefaultNodeInfo.prototype.channels = $util.newBuffer([]);
|
|
|
|
/**
|
|
* DefaultNodeInfo moniker.
|
|
* @member {string} moniker
|
|
* @memberof tendermint.p2p.DefaultNodeInfo
|
|
* @instance
|
|
*/
|
|
DefaultNodeInfo.prototype.moniker = "";
|
|
|
|
/**
|
|
* DefaultNodeInfo other.
|
|
* @member {tendermint.p2p.IDefaultNodeInfoOther|null|undefined} other
|
|
* @memberof tendermint.p2p.DefaultNodeInfo
|
|
* @instance
|
|
*/
|
|
DefaultNodeInfo.prototype.other = null;
|
|
|
|
/**
|
|
* Creates a new DefaultNodeInfo instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.p2p.DefaultNodeInfo
|
|
* @static
|
|
* @param {tendermint.p2p.IDefaultNodeInfo=} [properties] Properties to set
|
|
* @returns {tendermint.p2p.DefaultNodeInfo} DefaultNodeInfo instance
|
|
*/
|
|
DefaultNodeInfo.create = function create(properties) {
|
|
return new DefaultNodeInfo(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified DefaultNodeInfo message. Does not implicitly {@link tendermint.p2p.DefaultNodeInfo.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof tendermint.p2p.DefaultNodeInfo
|
|
* @static
|
|
* @param {tendermint.p2p.IDefaultNodeInfo} message DefaultNodeInfo message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
DefaultNodeInfo.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.protocolVersion != null && Object.hasOwnProperty.call(message, "protocolVersion"))
|
|
$root.tendermint.p2p.ProtocolVersion.encode(message.protocolVersion, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.defaultNodeId != null && Object.hasOwnProperty.call(message, "defaultNodeId"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.defaultNodeId);
|
|
if (message.listenAddr != null && Object.hasOwnProperty.call(message, "listenAddr"))
|
|
writer.uint32(/* id 3, wireType 2 =*/26).string(message.listenAddr);
|
|
if (message.network != null && Object.hasOwnProperty.call(message, "network"))
|
|
writer.uint32(/* id 4, wireType 2 =*/34).string(message.network);
|
|
if (message.version != null && Object.hasOwnProperty.call(message, "version"))
|
|
writer.uint32(/* id 5, wireType 2 =*/42).string(message.version);
|
|
if (message.channels != null && Object.hasOwnProperty.call(message, "channels"))
|
|
writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.channels);
|
|
if (message.moniker != null && Object.hasOwnProperty.call(message, "moniker"))
|
|
writer.uint32(/* id 7, wireType 2 =*/58).string(message.moniker);
|
|
if (message.other != null && Object.hasOwnProperty.call(message, "other"))
|
|
$root.tendermint.p2p.DefaultNodeInfoOther.encode(message.other, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified DefaultNodeInfo message, length delimited. Does not implicitly {@link tendermint.p2p.DefaultNodeInfo.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof tendermint.p2p.DefaultNodeInfo
|
|
* @static
|
|
* @param {tendermint.p2p.IDefaultNodeInfo} message DefaultNodeInfo message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
DefaultNodeInfo.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a DefaultNodeInfo message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof tendermint.p2p.DefaultNodeInfo
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {tendermint.p2p.DefaultNodeInfo} DefaultNodeInfo
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
DefaultNodeInfo.decode = 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.p2p.DefaultNodeInfo();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.protocolVersion = $root.tendermint.p2p.ProtocolVersion.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
message.defaultNodeId = reader.string();
|
|
break;
|
|
case 3:
|
|
message.listenAddr = reader.string();
|
|
break;
|
|
case 4:
|
|
message.network = reader.string();
|
|
break;
|
|
case 5:
|
|
message.version = reader.string();
|
|
break;
|
|
case 6:
|
|
message.channels = reader.bytes();
|
|
break;
|
|
case 7:
|
|
message.moniker = reader.string();
|
|
break;
|
|
case 8:
|
|
message.other = $root.tendermint.p2p.DefaultNodeInfoOther.decode(reader, reader.uint32());
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a DefaultNodeInfo message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof tendermint.p2p.DefaultNodeInfo
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {tendermint.p2p.DefaultNodeInfo} DefaultNodeInfo
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
DefaultNodeInfo.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a DefaultNodeInfo message.
|
|
* @function verify
|
|
* @memberof tendermint.p2p.DefaultNodeInfo
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
DefaultNodeInfo.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion")) {
|
|
var error = $root.tendermint.p2p.ProtocolVersion.verify(message.protocolVersion);
|
|
if (error)
|
|
return "protocolVersion." + error;
|
|
}
|
|
if (message.defaultNodeId != null && message.hasOwnProperty("defaultNodeId"))
|
|
if (!$util.isString(message.defaultNodeId))
|
|
return "defaultNodeId: string expected";
|
|
if (message.listenAddr != null && message.hasOwnProperty("listenAddr"))
|
|
if (!$util.isString(message.listenAddr))
|
|
return "listenAddr: string expected";
|
|
if (message.network != null && message.hasOwnProperty("network"))
|
|
if (!$util.isString(message.network))
|
|
return "network: string expected";
|
|
if (message.version != null && message.hasOwnProperty("version"))
|
|
if (!$util.isString(message.version))
|
|
return "version: string expected";
|
|
if (message.channels != null && message.hasOwnProperty("channels"))
|
|
if (!(message.channels && typeof message.channels.length === "number" || $util.isString(message.channels)))
|
|
return "channels: buffer expected";
|
|
if (message.moniker != null && message.hasOwnProperty("moniker"))
|
|
if (!$util.isString(message.moniker))
|
|
return "moniker: string expected";
|
|
if (message.other != null && message.hasOwnProperty("other")) {
|
|
var error = $root.tendermint.p2p.DefaultNodeInfoOther.verify(message.other);
|
|
if (error)
|
|
return "other." + error;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a DefaultNodeInfo message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof tendermint.p2p.DefaultNodeInfo
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {tendermint.p2p.DefaultNodeInfo} DefaultNodeInfo
|
|
*/
|
|
DefaultNodeInfo.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.tendermint.p2p.DefaultNodeInfo)
|
|
return object;
|
|
var message = new $root.tendermint.p2p.DefaultNodeInfo();
|
|
if (object.protocolVersion != null) {
|
|
if (typeof object.protocolVersion !== "object")
|
|
throw TypeError(".tendermint.p2p.DefaultNodeInfo.protocolVersion: object expected");
|
|
message.protocolVersion = $root.tendermint.p2p.ProtocolVersion.fromObject(object.protocolVersion);
|
|
}
|
|
if (object.defaultNodeId != null)
|
|
message.defaultNodeId = String(object.defaultNodeId);
|
|
if (object.listenAddr != null)
|
|
message.listenAddr = String(object.listenAddr);
|
|
if (object.network != null)
|
|
message.network = String(object.network);
|
|
if (object.version != null)
|
|
message.version = String(object.version);
|
|
if (object.channels != null)
|
|
if (typeof object.channels === "string")
|
|
$util.base64.decode(object.channels, message.channels = $util.newBuffer($util.base64.length(object.channels)), 0);
|
|
else if (object.channels.length)
|
|
message.channels = object.channels;
|
|
if (object.moniker != null)
|
|
message.moniker = String(object.moniker);
|
|
if (object.other != null) {
|
|
if (typeof object.other !== "object")
|
|
throw TypeError(".tendermint.p2p.DefaultNodeInfo.other: object expected");
|
|
message.other = $root.tendermint.p2p.DefaultNodeInfoOther.fromObject(object.other);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a DefaultNodeInfo message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof tendermint.p2p.DefaultNodeInfo
|
|
* @static
|
|
* @param {tendermint.p2p.DefaultNodeInfo} message DefaultNodeInfo
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
DefaultNodeInfo.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.protocolVersion = null;
|
|
object.defaultNodeId = "";
|
|
object.listenAddr = "";
|
|
object.network = "";
|
|
object.version = "";
|
|
if (options.bytes === String)
|
|
object.channels = "";
|
|
else {
|
|
object.channels = [];
|
|
if (options.bytes !== Array)
|
|
object.channels = $util.newBuffer(object.channels);
|
|
}
|
|
object.moniker = "";
|
|
object.other = null;
|
|
}
|
|
if (message.protocolVersion != null && message.hasOwnProperty("protocolVersion"))
|
|
object.protocolVersion = $root.tendermint.p2p.ProtocolVersion.toObject(message.protocolVersion, options);
|
|
if (message.defaultNodeId != null && message.hasOwnProperty("defaultNodeId"))
|
|
object.defaultNodeId = message.defaultNodeId;
|
|
if (message.listenAddr != null && message.hasOwnProperty("listenAddr"))
|
|
object.listenAddr = message.listenAddr;
|
|
if (message.network != null && message.hasOwnProperty("network"))
|
|
object.network = message.network;
|
|
if (message.version != null && message.hasOwnProperty("version"))
|
|
object.version = message.version;
|
|
if (message.channels != null && message.hasOwnProperty("channels"))
|
|
object.channels = options.bytes === String ? $util.base64.encode(message.channels, 0, message.channels.length) : options.bytes === Array ? Array.prototype.slice.call(message.channels) : message.channels;
|
|
if (message.moniker != null && message.hasOwnProperty("moniker"))
|
|
object.moniker = message.moniker;
|
|
if (message.other != null && message.hasOwnProperty("other"))
|
|
object.other = $root.tendermint.p2p.DefaultNodeInfoOther.toObject(message.other, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this DefaultNodeInfo to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.p2p.DefaultNodeInfo
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
DefaultNodeInfo.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return DefaultNodeInfo;
|
|
})(p2p.DefaultNodeInfo || {});
|
|
|
|
p2p.DefaultNodeInfoOther = (function(DefaultNodeInfoOther) {
|
|
|
|
/**
|
|
* Properties of a DefaultNodeInfoOther.
|
|
* @memberof tendermint.p2p
|
|
* @interface IDefaultNodeInfoOther
|
|
* @property {string|null} [txIndex] DefaultNodeInfoOther txIndex
|
|
* @property {string|null} [rpcAddress] DefaultNodeInfoOther rpcAddress
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new DefaultNodeInfoOther.
|
|
* @memberof tendermint.p2p
|
|
* @classdesc Represents a DefaultNodeInfoOther.
|
|
* @implements IDefaultNodeInfoOther
|
|
* @constructor
|
|
* @param {tendermint.p2p.IDefaultNodeInfoOther=} [properties] Properties to set
|
|
*/
|
|
function DefaultNodeInfoOther(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* DefaultNodeInfoOther txIndex.
|
|
* @member {string} txIndex
|
|
* @memberof tendermint.p2p.DefaultNodeInfoOther
|
|
* @instance
|
|
*/
|
|
DefaultNodeInfoOther.prototype.txIndex = "";
|
|
|
|
/**
|
|
* DefaultNodeInfoOther rpcAddress.
|
|
* @member {string} rpcAddress
|
|
* @memberof tendermint.p2p.DefaultNodeInfoOther
|
|
* @instance
|
|
*/
|
|
DefaultNodeInfoOther.prototype.rpcAddress = "";
|
|
|
|
/**
|
|
* Creates a new DefaultNodeInfoOther instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.p2p.DefaultNodeInfoOther
|
|
* @static
|
|
* @param {tendermint.p2p.IDefaultNodeInfoOther=} [properties] Properties to set
|
|
* @returns {tendermint.p2p.DefaultNodeInfoOther} DefaultNodeInfoOther instance
|
|
*/
|
|
DefaultNodeInfoOther.create = function create(properties) {
|
|
return new DefaultNodeInfoOther(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified DefaultNodeInfoOther message. Does not implicitly {@link tendermint.p2p.DefaultNodeInfoOther.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof tendermint.p2p.DefaultNodeInfoOther
|
|
* @static
|
|
* @param {tendermint.p2p.IDefaultNodeInfoOther} message DefaultNodeInfoOther message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
DefaultNodeInfoOther.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.txIndex != null && Object.hasOwnProperty.call(message, "txIndex"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.txIndex);
|
|
if (message.rpcAddress != null && Object.hasOwnProperty.call(message, "rpcAddress"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.rpcAddress);
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified DefaultNodeInfoOther message, length delimited. Does not implicitly {@link tendermint.p2p.DefaultNodeInfoOther.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof tendermint.p2p.DefaultNodeInfoOther
|
|
* @static
|
|
* @param {tendermint.p2p.IDefaultNodeInfoOther} message DefaultNodeInfoOther message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
DefaultNodeInfoOther.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a DefaultNodeInfoOther message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof tendermint.p2p.DefaultNodeInfoOther
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {tendermint.p2p.DefaultNodeInfoOther} DefaultNodeInfoOther
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
DefaultNodeInfoOther.decode = 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.p2p.DefaultNodeInfoOther();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.txIndex = reader.string();
|
|
break;
|
|
case 2:
|
|
message.rpcAddress = reader.string();
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a DefaultNodeInfoOther message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof tendermint.p2p.DefaultNodeInfoOther
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {tendermint.p2p.DefaultNodeInfoOther} DefaultNodeInfoOther
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
DefaultNodeInfoOther.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a DefaultNodeInfoOther message.
|
|
* @function verify
|
|
* @memberof tendermint.p2p.DefaultNodeInfoOther
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
DefaultNodeInfoOther.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.txIndex != null && message.hasOwnProperty("txIndex"))
|
|
if (!$util.isString(message.txIndex))
|
|
return "txIndex: string expected";
|
|
if (message.rpcAddress != null && message.hasOwnProperty("rpcAddress"))
|
|
if (!$util.isString(message.rpcAddress))
|
|
return "rpcAddress: string expected";
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a DefaultNodeInfoOther message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof tendermint.p2p.DefaultNodeInfoOther
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {tendermint.p2p.DefaultNodeInfoOther} DefaultNodeInfoOther
|
|
*/
|
|
DefaultNodeInfoOther.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.tendermint.p2p.DefaultNodeInfoOther)
|
|
return object;
|
|
var message = new $root.tendermint.p2p.DefaultNodeInfoOther();
|
|
if (object.txIndex != null)
|
|
message.txIndex = String(object.txIndex);
|
|
if (object.rpcAddress != null)
|
|
message.rpcAddress = String(object.rpcAddress);
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a DefaultNodeInfoOther message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof tendermint.p2p.DefaultNodeInfoOther
|
|
* @static
|
|
* @param {tendermint.p2p.DefaultNodeInfoOther} message DefaultNodeInfoOther
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
DefaultNodeInfoOther.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.txIndex = "";
|
|
object.rpcAddress = "";
|
|
}
|
|
if (message.txIndex != null && message.hasOwnProperty("txIndex"))
|
|
object.txIndex = message.txIndex;
|
|
if (message.rpcAddress != null && message.hasOwnProperty("rpcAddress"))
|
|
object.rpcAddress = message.rpcAddress;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this DefaultNodeInfoOther to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.p2p.DefaultNodeInfoOther
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
DefaultNodeInfoOther.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return DefaultNodeInfoOther;
|
|
})(p2p.DefaultNodeInfoOther || {});
|
|
|
|
return p2p;
|
|
})(tendermint.p2p || {});
|
|
|
|
/**
|
|
* Namespace types.
|
|
* @memberof tendermint
|
|
* @namespace
|
|
*/
|
|
|
|
tendermint.types = (function(types) {
|
|
|
|
types.Block = (function(Block) {
|
|
|
|
/**
|
|
* Properties of a Block.
|
|
* @memberof tendermint.types
|
|
* @interface IBlock
|
|
* @property {tendermint.types.IHeader|null} [header] Block header
|
|
* @property {tendermint.types.IData|null} [data] Block data
|
|
* @property {tendermint.types.IEvidenceList|null} [evidence] Block evidence
|
|
* @property {tendermint.types.ICommit|null} [lastCommit] Block lastCommit
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Block.
|
|
* @memberof tendermint.types
|
|
* @classdesc Represents a Block.
|
|
* @implements IBlock
|
|
* @constructor
|
|
* @param {tendermint.types.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 header.
|
|
* @member {tendermint.types.IHeader|null|undefined} header
|
|
* @memberof tendermint.types.Block
|
|
* @instance
|
|
*/
|
|
Block.prototype.header = null;
|
|
|
|
/**
|
|
* Block data.
|
|
* @member {tendermint.types.IData|null|undefined} data
|
|
* @memberof tendermint.types.Block
|
|
* @instance
|
|
*/
|
|
Block.prototype.data = null;
|
|
|
|
/**
|
|
* Block evidence.
|
|
* @member {tendermint.types.IEvidenceList|null|undefined} evidence
|
|
* @memberof tendermint.types.Block
|
|
* @instance
|
|
*/
|
|
Block.prototype.evidence = null;
|
|
|
|
/**
|
|
* Block lastCommit.
|
|
* @member {tendermint.types.ICommit|null|undefined} lastCommit
|
|
* @memberof tendermint.types.Block
|
|
* @instance
|
|
*/
|
|
Block.prototype.lastCommit = null;
|
|
|
|
/**
|
|
* Creates a new Block instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.Block
|
|
* @static
|
|
* @param {tendermint.types.IBlock=} [properties] Properties to set
|
|
* @returns {tendermint.types.Block} Block instance
|
|
*/
|
|
Block.create = function create(properties) {
|
|
return new Block(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Block message. Does not implicitly {@link tendermint.types.Block.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof tendermint.types.Block
|
|
* @static
|
|
* @param {tendermint.types.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.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.data != null && Object.hasOwnProperty.call(message, "data"))
|
|
$root.tendermint.types.Data.encode(message.data, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence"))
|
|
$root.tendermint.types.EvidenceList.encode(message.evidence, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
|
if (message.lastCommit != null && Object.hasOwnProperty.call(message, "lastCommit"))
|
|
$root.tendermint.types.Commit.encode(message.lastCommit, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Block message, length delimited. Does not implicitly {@link tendermint.types.Block.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof tendermint.types.Block
|
|
* @static
|
|
* @param {tendermint.types.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 tendermint.types.Block
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {tendermint.types.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.tendermint.types.Block();
|
|
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.data = $root.tendermint.types.Data.decode(reader, reader.uint32());
|
|
break;
|
|
case 3:
|
|
message.evidence = $root.tendermint.types.EvidenceList.decode(reader, reader.uint32());
|
|
break;
|
|
case 4:
|
|
message.lastCommit = $root.tendermint.types.Commit.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 tendermint.types.Block
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {tendermint.types.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 tendermint.types.Block
|
|
* @static
|
|
* @param {Object.<string,*>} 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.header != null && message.hasOwnProperty("header")) {
|
|
var error = $root.tendermint.types.Header.verify(message.header);
|
|
if (error)
|
|
return "header." + error;
|
|
}
|
|
if (message.data != null && message.hasOwnProperty("data")) {
|
|
var error = $root.tendermint.types.Data.verify(message.data);
|
|
if (error)
|
|
return "data." + error;
|
|
}
|
|
if (message.evidence != null && message.hasOwnProperty("evidence")) {
|
|
var error = $root.tendermint.types.EvidenceList.verify(message.evidence);
|
|
if (error)
|
|
return "evidence." + error;
|
|
}
|
|
if (message.lastCommit != null && message.hasOwnProperty("lastCommit")) {
|
|
var error = $root.tendermint.types.Commit.verify(message.lastCommit);
|
|
if (error)
|
|
return "lastCommit." + error;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a Block message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof tendermint.types.Block
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {tendermint.types.Block} Block
|
|
*/
|
|
Block.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.tendermint.types.Block)
|
|
return object;
|
|
var message = new $root.tendermint.types.Block();
|
|
if (object.header != null) {
|
|
if (typeof object.header !== "object")
|
|
throw TypeError(".tendermint.types.Block.header: object expected");
|
|
message.header = $root.tendermint.types.Header.fromObject(object.header);
|
|
}
|
|
if (object.data != null) {
|
|
if (typeof object.data !== "object")
|
|
throw TypeError(".tendermint.types.Block.data: object expected");
|
|
message.data = $root.tendermint.types.Data.fromObject(object.data);
|
|
}
|
|
if (object.evidence != null) {
|
|
if (typeof object.evidence !== "object")
|
|
throw TypeError(".tendermint.types.Block.evidence: object expected");
|
|
message.evidence = $root.tendermint.types.EvidenceList.fromObject(object.evidence);
|
|
}
|
|
if (object.lastCommit != null) {
|
|
if (typeof object.lastCommit !== "object")
|
|
throw TypeError(".tendermint.types.Block.lastCommit: object expected");
|
|
message.lastCommit = $root.tendermint.types.Commit.fromObject(object.lastCommit);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a Block message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof tendermint.types.Block
|
|
* @static
|
|
* @param {tendermint.types.Block} message Block
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Block.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.header = null;
|
|
object.data = null;
|
|
object.evidence = null;
|
|
object.lastCommit = null;
|
|
}
|
|
if (message.header != null && message.hasOwnProperty("header"))
|
|
object.header = $root.tendermint.types.Header.toObject(message.header, options);
|
|
if (message.data != null && message.hasOwnProperty("data"))
|
|
object.data = $root.tendermint.types.Data.toObject(message.data, options);
|
|
if (message.evidence != null && message.hasOwnProperty("evidence"))
|
|
object.evidence = $root.tendermint.types.EvidenceList.toObject(message.evidence, options);
|
|
if (message.lastCommit != null && message.hasOwnProperty("lastCommit"))
|
|
object.lastCommit = $root.tendermint.types.Commit.toObject(message.lastCommit, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Block to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.types.Block
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Block.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Block;
|
|
})(types.Block || {});
|
|
|
|
types.Evidence = (function(Evidence) {
|
|
|
|
/**
|
|
* Properties of an Evidence.
|
|
* @memberof tendermint.types
|
|
* @interface IEvidence
|
|
* @property {tendermint.types.IDuplicateVoteEvidence|null} [duplicateVoteEvidence] Evidence duplicateVoteEvidence
|
|
* @property {tendermint.types.ILightClientAttackEvidence|null} [lightClientAttackEvidence] Evidence lightClientAttackEvidence
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new Evidence.
|
|
* @memberof tendermint.types
|
|
* @classdesc Represents an Evidence.
|
|
* @implements IEvidence
|
|
* @constructor
|
|
* @param {tendermint.types.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 duplicateVoteEvidence.
|
|
* @member {tendermint.types.IDuplicateVoteEvidence|null|undefined} duplicateVoteEvidence
|
|
* @memberof tendermint.types.Evidence
|
|
* @instance
|
|
*/
|
|
Evidence.prototype.duplicateVoteEvidence = null;
|
|
|
|
/**
|
|
* Evidence lightClientAttackEvidence.
|
|
* @member {tendermint.types.ILightClientAttackEvidence|null|undefined} lightClientAttackEvidence
|
|
* @memberof tendermint.types.Evidence
|
|
* @instance
|
|
*/
|
|
Evidence.prototype.lightClientAttackEvidence = null;
|
|
|
|
// OneOf field names bound to virtual getters and setters
|
|
var $oneOfFields;
|
|
|
|
/**
|
|
* Evidence sum.
|
|
* @member {"duplicateVoteEvidence"|"lightClientAttackEvidence"|undefined} sum
|
|
* @memberof tendermint.types.Evidence
|
|
* @instance
|
|
*/
|
|
Object.defineProperty(Evidence.prototype, "sum", {
|
|
get: $util.oneOfGetter($oneOfFields = ["duplicateVoteEvidence", "lightClientAttackEvidence"]),
|
|
set: $util.oneOfSetter($oneOfFields)
|
|
});
|
|
|
|
/**
|
|
* Creates a new Evidence instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.Evidence
|
|
* @static
|
|
* @param {tendermint.types.IEvidence=} [properties] Properties to set
|
|
* @returns {tendermint.types.Evidence} Evidence instance
|
|
*/
|
|
Evidence.create = function create(properties) {
|
|
return new Evidence(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Evidence message. Does not implicitly {@link tendermint.types.Evidence.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof tendermint.types.Evidence
|
|
* @static
|
|
* @param {tendermint.types.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.duplicateVoteEvidence != null && Object.hasOwnProperty.call(message, "duplicateVoteEvidence"))
|
|
$root.tendermint.types.DuplicateVoteEvidence.encode(message.duplicateVoteEvidence, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.lightClientAttackEvidence != null && Object.hasOwnProperty.call(message, "lightClientAttackEvidence"))
|
|
$root.tendermint.types.LightClientAttackEvidence.encode(message.lightClientAttackEvidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified Evidence message, length delimited. Does not implicitly {@link tendermint.types.Evidence.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof tendermint.types.Evidence
|
|
* @static
|
|
* @param {tendermint.types.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.types.Evidence
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {tendermint.types.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.types.Evidence();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.duplicateVoteEvidence = $root.tendermint.types.DuplicateVoteEvidence.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
message.lightClientAttackEvidence = $root.tendermint.types.LightClientAttackEvidence.decode(reader, reader.uint32());
|
|
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.types.Evidence
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {tendermint.types.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.types.Evidence
|
|
* @static
|
|
* @param {Object.<string,*>} 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";
|
|
var properties = {};
|
|
if (message.duplicateVoteEvidence != null && message.hasOwnProperty("duplicateVoteEvidence")) {
|
|
properties.sum = 1;
|
|
{
|
|
var error = $root.tendermint.types.DuplicateVoteEvidence.verify(message.duplicateVoteEvidence);
|
|
if (error)
|
|
return "duplicateVoteEvidence." + error;
|
|
}
|
|
}
|
|
if (message.lightClientAttackEvidence != null && message.hasOwnProperty("lightClientAttackEvidence")) {
|
|
if (properties.sum === 1)
|
|
return "sum: multiple values";
|
|
properties.sum = 1;
|
|
{
|
|
var error = $root.tendermint.types.LightClientAttackEvidence.verify(message.lightClientAttackEvidence);
|
|
if (error)
|
|
return "lightClientAttackEvidence." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates an Evidence message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof tendermint.types.Evidence
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {tendermint.types.Evidence} Evidence
|
|
*/
|
|
Evidence.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.tendermint.types.Evidence)
|
|
return object;
|
|
var message = new $root.tendermint.types.Evidence();
|
|
if (object.duplicateVoteEvidence != null) {
|
|
if (typeof object.duplicateVoteEvidence !== "object")
|
|
throw TypeError(".tendermint.types.Evidence.duplicateVoteEvidence: object expected");
|
|
message.duplicateVoteEvidence = $root.tendermint.types.DuplicateVoteEvidence.fromObject(object.duplicateVoteEvidence);
|
|
}
|
|
if (object.lightClientAttackEvidence != null) {
|
|
if (typeof object.lightClientAttackEvidence !== "object")
|
|
throw TypeError(".tendermint.types.Evidence.lightClientAttackEvidence: object expected");
|
|
message.lightClientAttackEvidence = $root.tendermint.types.LightClientAttackEvidence.fromObject(object.lightClientAttackEvidence);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from an Evidence message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof tendermint.types.Evidence
|
|
* @static
|
|
* @param {tendermint.types.Evidence} message Evidence
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
Evidence.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (message.duplicateVoteEvidence != null && message.hasOwnProperty("duplicateVoteEvidence")) {
|
|
object.duplicateVoteEvidence = $root.tendermint.types.DuplicateVoteEvidence.toObject(message.duplicateVoteEvidence, options);
|
|
if (options.oneofs)
|
|
object.sum = "duplicateVoteEvidence";
|
|
}
|
|
if (message.lightClientAttackEvidence != null && message.hasOwnProperty("lightClientAttackEvidence")) {
|
|
object.lightClientAttackEvidence = $root.tendermint.types.LightClientAttackEvidence.toObject(message.lightClientAttackEvidence, options);
|
|
if (options.oneofs)
|
|
object.sum = "lightClientAttackEvidence";
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Evidence to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.types.Evidence
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Evidence.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Evidence;
|
|
})(types.Evidence || {});
|
|
|
|
types.DuplicateVoteEvidence = (function(DuplicateVoteEvidence) {
|
|
|
|
/**
|
|
* Properties of a DuplicateVoteEvidence.
|
|
* @memberof tendermint.types
|
|
* @interface IDuplicateVoteEvidence
|
|
* @property {tendermint.types.IVote|null} [voteA] DuplicateVoteEvidence voteA
|
|
* @property {tendermint.types.IVote|null} [voteB] DuplicateVoteEvidence voteB
|
|
* @property {number|Long|null} [totalVotingPower] DuplicateVoteEvidence totalVotingPower
|
|
* @property {number|Long|null} [validatorPower] DuplicateVoteEvidence validatorPower
|
|
* @property {google.protobuf.ITimestamp|null} [timestamp] DuplicateVoteEvidence timestamp
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new DuplicateVoteEvidence.
|
|
* @memberof tendermint.types
|
|
* @classdesc Represents a DuplicateVoteEvidence.
|
|
* @implements IDuplicateVoteEvidence
|
|
* @constructor
|
|
* @param {tendermint.types.IDuplicateVoteEvidence=} [properties] Properties to set
|
|
*/
|
|
function DuplicateVoteEvidence(properties) {
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* DuplicateVoteEvidence voteA.
|
|
* @member {tendermint.types.IVote|null|undefined} voteA
|
|
* @memberof tendermint.types.DuplicateVoteEvidence
|
|
* @instance
|
|
*/
|
|
DuplicateVoteEvidence.prototype.voteA = null;
|
|
|
|
/**
|
|
* DuplicateVoteEvidence voteB.
|
|
* @member {tendermint.types.IVote|null|undefined} voteB
|
|
* @memberof tendermint.types.DuplicateVoteEvidence
|
|
* @instance
|
|
*/
|
|
DuplicateVoteEvidence.prototype.voteB = null;
|
|
|
|
/**
|
|
* DuplicateVoteEvidence totalVotingPower.
|
|
* @member {number|Long} totalVotingPower
|
|
* @memberof tendermint.types.DuplicateVoteEvidence
|
|
* @instance
|
|
*/
|
|
DuplicateVoteEvidence.prototype.totalVotingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* DuplicateVoteEvidence validatorPower.
|
|
* @member {number|Long} validatorPower
|
|
* @memberof tendermint.types.DuplicateVoteEvidence
|
|
* @instance
|
|
*/
|
|
DuplicateVoteEvidence.prototype.validatorPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* DuplicateVoteEvidence timestamp.
|
|
* @member {google.protobuf.ITimestamp|null|undefined} timestamp
|
|
* @memberof tendermint.types.DuplicateVoteEvidence
|
|
* @instance
|
|
*/
|
|
DuplicateVoteEvidence.prototype.timestamp = null;
|
|
|
|
/**
|
|
* Creates a new DuplicateVoteEvidence instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.DuplicateVoteEvidence
|
|
* @static
|
|
* @param {tendermint.types.IDuplicateVoteEvidence=} [properties] Properties to set
|
|
* @returns {tendermint.types.DuplicateVoteEvidence} DuplicateVoteEvidence instance
|
|
*/
|
|
DuplicateVoteEvidence.create = function create(properties) {
|
|
return new DuplicateVoteEvidence(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified DuplicateVoteEvidence message. Does not implicitly {@link tendermint.types.DuplicateVoteEvidence.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof tendermint.types.DuplicateVoteEvidence
|
|
* @static
|
|
* @param {tendermint.types.IDuplicateVoteEvidence} message DuplicateVoteEvidence message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
DuplicateVoteEvidence.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.voteA != null && Object.hasOwnProperty.call(message, "voteA"))
|
|
$root.tendermint.types.Vote.encode(message.voteA, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.voteB != null && Object.hasOwnProperty.call(message, "voteB"))
|
|
$root.tendermint.types.Vote.encode(message.voteB, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
if (message.totalVotingPower != null && Object.hasOwnProperty.call(message, "totalVotingPower"))
|
|
writer.uint32(/* id 3, wireType 0 =*/24).int64(message.totalVotingPower);
|
|
if (message.validatorPower != null && Object.hasOwnProperty.call(message, "validatorPower"))
|
|
writer.uint32(/* id 4, wireType 0 =*/32).int64(message.validatorPower);
|
|
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();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified DuplicateVoteEvidence message, length delimited. Does not implicitly {@link tendermint.types.DuplicateVoteEvidence.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof tendermint.types.DuplicateVoteEvidence
|
|
* @static
|
|
* @param {tendermint.types.IDuplicateVoteEvidence} message DuplicateVoteEvidence message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
DuplicateVoteEvidence.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a DuplicateVoteEvidence message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof tendermint.types.DuplicateVoteEvidence
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {tendermint.types.DuplicateVoteEvidence} DuplicateVoteEvidence
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
DuplicateVoteEvidence.decode = 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.DuplicateVoteEvidence();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.voteA = $root.tendermint.types.Vote.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
message.voteB = $root.tendermint.types.Vote.decode(reader, reader.uint32());
|
|
break;
|
|
case 3:
|
|
message.totalVotingPower = reader.int64();
|
|
break;
|
|
case 4:
|
|
message.validatorPower = reader.int64();
|
|
break;
|
|
case 5:
|
|
message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a DuplicateVoteEvidence message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof tendermint.types.DuplicateVoteEvidence
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {tendermint.types.DuplicateVoteEvidence} DuplicateVoteEvidence
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
DuplicateVoteEvidence.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a DuplicateVoteEvidence message.
|
|
* @function verify
|
|
* @memberof tendermint.types.DuplicateVoteEvidence
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
DuplicateVoteEvidence.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.voteA != null && message.hasOwnProperty("voteA")) {
|
|
var error = $root.tendermint.types.Vote.verify(message.voteA);
|
|
if (error)
|
|
return "voteA." + error;
|
|
}
|
|
if (message.voteB != null && message.hasOwnProperty("voteB")) {
|
|
var error = $root.tendermint.types.Vote.verify(message.voteB);
|
|
if (error)
|
|
return "voteB." + error;
|
|
}
|
|
if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower"))
|
|
if (!$util.isInteger(message.totalVotingPower) && !(message.totalVotingPower && $util.isInteger(message.totalVotingPower.low) && $util.isInteger(message.totalVotingPower.high)))
|
|
return "totalVotingPower: integer|Long expected";
|
|
if (message.validatorPower != null && message.hasOwnProperty("validatorPower"))
|
|
if (!$util.isInteger(message.validatorPower) && !(message.validatorPower && $util.isInteger(message.validatorPower.low) && $util.isInteger(message.validatorPower.high)))
|
|
return "validatorPower: integer|Long expected";
|
|
if (message.timestamp != null && message.hasOwnProperty("timestamp")) {
|
|
var error = $root.google.protobuf.Timestamp.verify(message.timestamp);
|
|
if (error)
|
|
return "timestamp." + error;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a DuplicateVoteEvidence message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof tendermint.types.DuplicateVoteEvidence
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {tendermint.types.DuplicateVoteEvidence} DuplicateVoteEvidence
|
|
*/
|
|
DuplicateVoteEvidence.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.tendermint.types.DuplicateVoteEvidence)
|
|
return object;
|
|
var message = new $root.tendermint.types.DuplicateVoteEvidence();
|
|
if (object.voteA != null) {
|
|
if (typeof object.voteA !== "object")
|
|
throw TypeError(".tendermint.types.DuplicateVoteEvidence.voteA: object expected");
|
|
message.voteA = $root.tendermint.types.Vote.fromObject(object.voteA);
|
|
}
|
|
if (object.voteB != null) {
|
|
if (typeof object.voteB !== "object")
|
|
throw TypeError(".tendermint.types.DuplicateVoteEvidence.voteB: object expected");
|
|
message.voteB = $root.tendermint.types.Vote.fromObject(object.voteB);
|
|
}
|
|
if (object.totalVotingPower != null)
|
|
if ($util.Long)
|
|
(message.totalVotingPower = $util.Long.fromValue(object.totalVotingPower)).unsigned = false;
|
|
else if (typeof object.totalVotingPower === "string")
|
|
message.totalVotingPower = parseInt(object.totalVotingPower, 10);
|
|
else if (typeof object.totalVotingPower === "number")
|
|
message.totalVotingPower = object.totalVotingPower;
|
|
else if (typeof object.totalVotingPower === "object")
|
|
message.totalVotingPower = new $util.LongBits(object.totalVotingPower.low >>> 0, object.totalVotingPower.high >>> 0).toNumber();
|
|
if (object.validatorPower != null)
|
|
if ($util.Long)
|
|
(message.validatorPower = $util.Long.fromValue(object.validatorPower)).unsigned = false;
|
|
else if (typeof object.validatorPower === "string")
|
|
message.validatorPower = parseInt(object.validatorPower, 10);
|
|
else if (typeof object.validatorPower === "number")
|
|
message.validatorPower = object.validatorPower;
|
|
else if (typeof object.validatorPower === "object")
|
|
message.validatorPower = new $util.LongBits(object.validatorPower.low >>> 0, object.validatorPower.high >>> 0).toNumber();
|
|
if (object.timestamp != null) {
|
|
if (typeof object.timestamp !== "object")
|
|
throw TypeError(".tendermint.types.DuplicateVoteEvidence.timestamp: object expected");
|
|
message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a DuplicateVoteEvidence message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof tendermint.types.DuplicateVoteEvidence
|
|
* @static
|
|
* @param {tendermint.types.DuplicateVoteEvidence} message DuplicateVoteEvidence
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
DuplicateVoteEvidence.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.voteA = null;
|
|
object.voteB = null;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.totalVotingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.totalVotingPower = options.longs === String ? "0" : 0;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.validatorPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.validatorPower = options.longs === String ? "0" : 0;
|
|
object.timestamp = null;
|
|
}
|
|
if (message.voteA != null && message.hasOwnProperty("voteA"))
|
|
object.voteA = $root.tendermint.types.Vote.toObject(message.voteA, options);
|
|
if (message.voteB != null && message.hasOwnProperty("voteB"))
|
|
object.voteB = $root.tendermint.types.Vote.toObject(message.voteB, options);
|
|
if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower"))
|
|
if (typeof message.totalVotingPower === "number")
|
|
object.totalVotingPower = options.longs === String ? String(message.totalVotingPower) : message.totalVotingPower;
|
|
else
|
|
object.totalVotingPower = options.longs === String ? $util.Long.prototype.toString.call(message.totalVotingPower) : options.longs === Number ? new $util.LongBits(message.totalVotingPower.low >>> 0, message.totalVotingPower.high >>> 0).toNumber() : message.totalVotingPower;
|
|
if (message.validatorPower != null && message.hasOwnProperty("validatorPower"))
|
|
if (typeof message.validatorPower === "number")
|
|
object.validatorPower = options.longs === String ? String(message.validatorPower) : message.validatorPower;
|
|
else
|
|
object.validatorPower = options.longs === String ? $util.Long.prototype.toString.call(message.validatorPower) : options.longs === Number ? new $util.LongBits(message.validatorPower.low >>> 0, message.validatorPower.high >>> 0).toNumber() : message.validatorPower;
|
|
if (message.timestamp != null && message.hasOwnProperty("timestamp"))
|
|
object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this DuplicateVoteEvidence to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.types.DuplicateVoteEvidence
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
DuplicateVoteEvidence.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return DuplicateVoteEvidence;
|
|
})(types.DuplicateVoteEvidence || {});
|
|
|
|
types.LightClientAttackEvidence = (function(LightClientAttackEvidence) {
|
|
|
|
/**
|
|
* Properties of a LightClientAttackEvidence.
|
|
* @memberof tendermint.types
|
|
* @interface ILightClientAttackEvidence
|
|
* @property {tendermint.types.ILightBlock|null} [conflictingBlock] LightClientAttackEvidence conflictingBlock
|
|
* @property {number|Long|null} [commonHeight] LightClientAttackEvidence commonHeight
|
|
* @property {Array.<tendermint.types.IValidator>|null} [byzantineValidators] LightClientAttackEvidence byzantineValidators
|
|
* @property {number|Long|null} [totalVotingPower] LightClientAttackEvidence totalVotingPower
|
|
* @property {google.protobuf.ITimestamp|null} [timestamp] LightClientAttackEvidence timestamp
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new LightClientAttackEvidence.
|
|
* @memberof tendermint.types
|
|
* @classdesc Represents a LightClientAttackEvidence.
|
|
* @implements ILightClientAttackEvidence
|
|
* @constructor
|
|
* @param {tendermint.types.ILightClientAttackEvidence=} [properties] Properties to set
|
|
*/
|
|
function LightClientAttackEvidence(properties) {
|
|
this.byzantineValidators = [];
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* LightClientAttackEvidence conflictingBlock.
|
|
* @member {tendermint.types.ILightBlock|null|undefined} conflictingBlock
|
|
* @memberof tendermint.types.LightClientAttackEvidence
|
|
* @instance
|
|
*/
|
|
LightClientAttackEvidence.prototype.conflictingBlock = null;
|
|
|
|
/**
|
|
* LightClientAttackEvidence commonHeight.
|
|
* @member {number|Long} commonHeight
|
|
* @memberof tendermint.types.LightClientAttackEvidence
|
|
* @instance
|
|
*/
|
|
LightClientAttackEvidence.prototype.commonHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* LightClientAttackEvidence byzantineValidators.
|
|
* @member {Array.<tendermint.types.IValidator>} byzantineValidators
|
|
* @memberof tendermint.types.LightClientAttackEvidence
|
|
* @instance
|
|
*/
|
|
LightClientAttackEvidence.prototype.byzantineValidators = $util.emptyArray;
|
|
|
|
/**
|
|
* LightClientAttackEvidence totalVotingPower.
|
|
* @member {number|Long} totalVotingPower
|
|
* @memberof tendermint.types.LightClientAttackEvidence
|
|
* @instance
|
|
*/
|
|
LightClientAttackEvidence.prototype.totalVotingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* LightClientAttackEvidence timestamp.
|
|
* @member {google.protobuf.ITimestamp|null|undefined} timestamp
|
|
* @memberof tendermint.types.LightClientAttackEvidence
|
|
* @instance
|
|
*/
|
|
LightClientAttackEvidence.prototype.timestamp = null;
|
|
|
|
/**
|
|
* Creates a new LightClientAttackEvidence instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.LightClientAttackEvidence
|
|
* @static
|
|
* @param {tendermint.types.ILightClientAttackEvidence=} [properties] Properties to set
|
|
* @returns {tendermint.types.LightClientAttackEvidence} LightClientAttackEvidence instance
|
|
*/
|
|
LightClientAttackEvidence.create = function create(properties) {
|
|
return new LightClientAttackEvidence(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified LightClientAttackEvidence message. Does not implicitly {@link tendermint.types.LightClientAttackEvidence.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof tendermint.types.LightClientAttackEvidence
|
|
* @static
|
|
* @param {tendermint.types.ILightClientAttackEvidence} message LightClientAttackEvidence message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
LightClientAttackEvidence.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.conflictingBlock != null && Object.hasOwnProperty.call(message, "conflictingBlock"))
|
|
$root.tendermint.types.LightBlock.encode(message.conflictingBlock, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.commonHeight != null && Object.hasOwnProperty.call(message, "commonHeight"))
|
|
writer.uint32(/* id 2, wireType 0 =*/16).int64(message.commonHeight);
|
|
if (message.byzantineValidators != null && message.byzantineValidators.length)
|
|
for (var i = 0; i < message.byzantineValidators.length; ++i)
|
|
$root.tendermint.types.Validator.encode(message.byzantineValidators[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
|
if (message.totalVotingPower != null && Object.hasOwnProperty.call(message, "totalVotingPower"))
|
|
writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalVotingPower);
|
|
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();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified LightClientAttackEvidence message, length delimited. Does not implicitly {@link tendermint.types.LightClientAttackEvidence.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof tendermint.types.LightClientAttackEvidence
|
|
* @static
|
|
* @param {tendermint.types.ILightClientAttackEvidence} message LightClientAttackEvidence message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
LightClientAttackEvidence.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes a LightClientAttackEvidence message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof tendermint.types.LightClientAttackEvidence
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {tendermint.types.LightClientAttackEvidence} LightClientAttackEvidence
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
LightClientAttackEvidence.decode = 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.LightClientAttackEvidence();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
message.conflictingBlock = $root.tendermint.types.LightBlock.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
message.commonHeight = reader.int64();
|
|
break;
|
|
case 3:
|
|
if (!(message.byzantineValidators && message.byzantineValidators.length))
|
|
message.byzantineValidators = [];
|
|
message.byzantineValidators.push($root.tendermint.types.Validator.decode(reader, reader.uint32()));
|
|
break;
|
|
case 4:
|
|
message.totalVotingPower = reader.int64();
|
|
break;
|
|
case 5:
|
|
message.timestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes a LightClientAttackEvidence message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof tendermint.types.LightClientAttackEvidence
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {tendermint.types.LightClientAttackEvidence} LightClientAttackEvidence
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
LightClientAttackEvidence.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies a LightClientAttackEvidence message.
|
|
* @function verify
|
|
* @memberof tendermint.types.LightClientAttackEvidence
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
LightClientAttackEvidence.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.conflictingBlock != null && message.hasOwnProperty("conflictingBlock")) {
|
|
var error = $root.tendermint.types.LightBlock.verify(message.conflictingBlock);
|
|
if (error)
|
|
return "conflictingBlock." + error;
|
|
}
|
|
if (message.commonHeight != null && message.hasOwnProperty("commonHeight"))
|
|
if (!$util.isInteger(message.commonHeight) && !(message.commonHeight && $util.isInteger(message.commonHeight.low) && $util.isInteger(message.commonHeight.high)))
|
|
return "commonHeight: integer|Long expected";
|
|
if (message.byzantineValidators != null && message.hasOwnProperty("byzantineValidators")) {
|
|
if (!Array.isArray(message.byzantineValidators))
|
|
return "byzantineValidators: array expected";
|
|
for (var i = 0; i < message.byzantineValidators.length; ++i) {
|
|
var error = $root.tendermint.types.Validator.verify(message.byzantineValidators[i]);
|
|
if (error)
|
|
return "byzantineValidators." + error;
|
|
}
|
|
}
|
|
if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower"))
|
|
if (!$util.isInteger(message.totalVotingPower) && !(message.totalVotingPower && $util.isInteger(message.totalVotingPower.low) && $util.isInteger(message.totalVotingPower.high)))
|
|
return "totalVotingPower: integer|Long expected";
|
|
if (message.timestamp != null && message.hasOwnProperty("timestamp")) {
|
|
var error = $root.google.protobuf.Timestamp.verify(message.timestamp);
|
|
if (error)
|
|
return "timestamp." + error;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates a LightClientAttackEvidence message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof tendermint.types.LightClientAttackEvidence
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {tendermint.types.LightClientAttackEvidence} LightClientAttackEvidence
|
|
*/
|
|
LightClientAttackEvidence.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.tendermint.types.LightClientAttackEvidence)
|
|
return object;
|
|
var message = new $root.tendermint.types.LightClientAttackEvidence();
|
|
if (object.conflictingBlock != null) {
|
|
if (typeof object.conflictingBlock !== "object")
|
|
throw TypeError(".tendermint.types.LightClientAttackEvidence.conflictingBlock: object expected");
|
|
message.conflictingBlock = $root.tendermint.types.LightBlock.fromObject(object.conflictingBlock);
|
|
}
|
|
if (object.commonHeight != null)
|
|
if ($util.Long)
|
|
(message.commonHeight = $util.Long.fromValue(object.commonHeight)).unsigned = false;
|
|
else if (typeof object.commonHeight === "string")
|
|
message.commonHeight = parseInt(object.commonHeight, 10);
|
|
else if (typeof object.commonHeight === "number")
|
|
message.commonHeight = object.commonHeight;
|
|
else if (typeof object.commonHeight === "object")
|
|
message.commonHeight = new $util.LongBits(object.commonHeight.low >>> 0, object.commonHeight.high >>> 0).toNumber();
|
|
if (object.byzantineValidators) {
|
|
if (!Array.isArray(object.byzantineValidators))
|
|
throw TypeError(".tendermint.types.LightClientAttackEvidence.byzantineValidators: array expected");
|
|
message.byzantineValidators = [];
|
|
for (var i = 0; i < object.byzantineValidators.length; ++i) {
|
|
if (typeof object.byzantineValidators[i] !== "object")
|
|
throw TypeError(".tendermint.types.LightClientAttackEvidence.byzantineValidators: object expected");
|
|
message.byzantineValidators[i] = $root.tendermint.types.Validator.fromObject(object.byzantineValidators[i]);
|
|
}
|
|
}
|
|
if (object.totalVotingPower != null)
|
|
if ($util.Long)
|
|
(message.totalVotingPower = $util.Long.fromValue(object.totalVotingPower)).unsigned = false;
|
|
else if (typeof object.totalVotingPower === "string")
|
|
message.totalVotingPower = parseInt(object.totalVotingPower, 10);
|
|
else if (typeof object.totalVotingPower === "number")
|
|
message.totalVotingPower = object.totalVotingPower;
|
|
else if (typeof object.totalVotingPower === "object")
|
|
message.totalVotingPower = new $util.LongBits(object.totalVotingPower.low >>> 0, object.totalVotingPower.high >>> 0).toNumber();
|
|
if (object.timestamp != null) {
|
|
if (typeof object.timestamp !== "object")
|
|
throw TypeError(".tendermint.types.LightClientAttackEvidence.timestamp: object expected");
|
|
message.timestamp = $root.google.protobuf.Timestamp.fromObject(object.timestamp);
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from a LightClientAttackEvidence message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof tendermint.types.LightClientAttackEvidence
|
|
* @static
|
|
* @param {tendermint.types.LightClientAttackEvidence} message LightClientAttackEvidence
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
LightClientAttackEvidence.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.byzantineValidators = [];
|
|
if (options.defaults) {
|
|
object.conflictingBlock = null;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.commonHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.commonHeight = options.longs === String ? "0" : 0;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.totalVotingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.totalVotingPower = options.longs === String ? "0" : 0;
|
|
object.timestamp = null;
|
|
}
|
|
if (message.conflictingBlock != null && message.hasOwnProperty("conflictingBlock"))
|
|
object.conflictingBlock = $root.tendermint.types.LightBlock.toObject(message.conflictingBlock, options);
|
|
if (message.commonHeight != null && message.hasOwnProperty("commonHeight"))
|
|
if (typeof message.commonHeight === "number")
|
|
object.commonHeight = options.longs === String ? String(message.commonHeight) : message.commonHeight;
|
|
else
|
|
object.commonHeight = options.longs === String ? $util.Long.prototype.toString.call(message.commonHeight) : options.longs === Number ? new $util.LongBits(message.commonHeight.low >>> 0, message.commonHeight.high >>> 0).toNumber() : message.commonHeight;
|
|
if (message.byzantineValidators && message.byzantineValidators.length) {
|
|
object.byzantineValidators = [];
|
|
for (var j = 0; j < message.byzantineValidators.length; ++j)
|
|
object.byzantineValidators[j] = $root.tendermint.types.Validator.toObject(message.byzantineValidators[j], options);
|
|
}
|
|
if (message.totalVotingPower != null && message.hasOwnProperty("totalVotingPower"))
|
|
if (typeof message.totalVotingPower === "number")
|
|
object.totalVotingPower = options.longs === String ? String(message.totalVotingPower) : message.totalVotingPower;
|
|
else
|
|
object.totalVotingPower = options.longs === String ? $util.Long.prototype.toString.call(message.totalVotingPower) : options.longs === Number ? new $util.LongBits(message.totalVotingPower.low >>> 0, message.totalVotingPower.high >>> 0).toNumber() : message.totalVotingPower;
|
|
if (message.timestamp != null && message.hasOwnProperty("timestamp"))
|
|
object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this LightClientAttackEvidence to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.types.LightClientAttackEvidence
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
LightClientAttackEvidence.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return LightClientAttackEvidence;
|
|
})(types.LightClientAttackEvidence || {});
|
|
|
|
types.EvidenceList = (function(EvidenceList) {
|
|
|
|
/**
|
|
* Properties of an EvidenceList.
|
|
* @memberof tendermint.types
|
|
* @interface IEvidenceList
|
|
* @property {Array.<tendermint.types.IEvidence>|null} [evidence] EvidenceList evidence
|
|
*/
|
|
|
|
/**
|
|
* Constructs a new EvidenceList.
|
|
* @memberof tendermint.types
|
|
* @classdesc Represents an EvidenceList.
|
|
* @implements IEvidenceList
|
|
* @constructor
|
|
* @param {tendermint.types.IEvidenceList=} [properties] Properties to set
|
|
*/
|
|
function EvidenceList(properties) {
|
|
this.evidence = [];
|
|
if (properties)
|
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
if (properties[keys[i]] != null)
|
|
this[keys[i]] = properties[keys[i]];
|
|
}
|
|
|
|
/**
|
|
* EvidenceList evidence.
|
|
* @member {Array.<tendermint.types.IEvidence>} evidence
|
|
* @memberof tendermint.types.EvidenceList
|
|
* @instance
|
|
*/
|
|
EvidenceList.prototype.evidence = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new EvidenceList instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.EvidenceList
|
|
* @static
|
|
* @param {tendermint.types.IEvidenceList=} [properties] Properties to set
|
|
* @returns {tendermint.types.EvidenceList} EvidenceList instance
|
|
*/
|
|
EvidenceList.create = function create(properties) {
|
|
return new EvidenceList(properties);
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified EvidenceList message. Does not implicitly {@link tendermint.types.EvidenceList.verify|verify} messages.
|
|
* @function encode
|
|
* @memberof tendermint.types.EvidenceList
|
|
* @static
|
|
* @param {tendermint.types.IEvidenceList} message EvidenceList message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
EvidenceList.encode = function encode(message, writer) {
|
|
if (!writer)
|
|
writer = $Writer.create();
|
|
if (message.evidence != null && message.evidence.length)
|
|
for (var i = 0; i < message.evidence.length; ++i)
|
|
$root.tendermint.types.Evidence.encode(message.evidence[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
return writer;
|
|
};
|
|
|
|
/**
|
|
* Encodes the specified EvidenceList message, length delimited. Does not implicitly {@link tendermint.types.EvidenceList.verify|verify} messages.
|
|
* @function encodeDelimited
|
|
* @memberof tendermint.types.EvidenceList
|
|
* @static
|
|
* @param {tendermint.types.IEvidenceList} message EvidenceList message or plain object to encode
|
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
* @returns {$protobuf.Writer} Writer
|
|
*/
|
|
EvidenceList.encodeDelimited = function encodeDelimited(message, writer) {
|
|
return this.encode(message, writer).ldelim();
|
|
};
|
|
|
|
/**
|
|
* Decodes an EvidenceList message from the specified reader or buffer.
|
|
* @function decode
|
|
* @memberof tendermint.types.EvidenceList
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @param {number} [length] Message length if known beforehand
|
|
* @returns {tendermint.types.EvidenceList} EvidenceList
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
EvidenceList.decode = 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.EvidenceList();
|
|
while (reader.pos < end) {
|
|
var tag = reader.uint32();
|
|
switch (tag >>> 3) {
|
|
case 1:
|
|
if (!(message.evidence && message.evidence.length))
|
|
message.evidence = [];
|
|
message.evidence.push($root.tendermint.types.Evidence.decode(reader, reader.uint32()));
|
|
break;
|
|
default:
|
|
reader.skipType(tag & 7);
|
|
break;
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Decodes an EvidenceList message from the specified reader or buffer, length delimited.
|
|
* @function decodeDelimited
|
|
* @memberof tendermint.types.EvidenceList
|
|
* @static
|
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
* @returns {tendermint.types.EvidenceList} EvidenceList
|
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
*/
|
|
EvidenceList.decodeDelimited = function decodeDelimited(reader) {
|
|
if (!(reader instanceof $Reader))
|
|
reader = new $Reader(reader);
|
|
return this.decode(reader, reader.uint32());
|
|
};
|
|
|
|
/**
|
|
* Verifies an EvidenceList message.
|
|
* @function verify
|
|
* @memberof tendermint.types.EvidenceList
|
|
* @static
|
|
* @param {Object.<string,*>} message Plain object to verify
|
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
*/
|
|
EvidenceList.verify = function verify(message) {
|
|
if (typeof message !== "object" || message === null)
|
|
return "object expected";
|
|
if (message.evidence != null && message.hasOwnProperty("evidence")) {
|
|
if (!Array.isArray(message.evidence))
|
|
return "evidence: array expected";
|
|
for (var i = 0; i < message.evidence.length; ++i) {
|
|
var error = $root.tendermint.types.Evidence.verify(message.evidence[i]);
|
|
if (error)
|
|
return "evidence." + error;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
|
|
/**
|
|
* Creates an EvidenceList message from a plain object. Also converts values to their respective internal types.
|
|
* @function fromObject
|
|
* @memberof tendermint.types.EvidenceList
|
|
* @static
|
|
* @param {Object.<string,*>} object Plain object
|
|
* @returns {tendermint.types.EvidenceList} EvidenceList
|
|
*/
|
|
EvidenceList.fromObject = function fromObject(object) {
|
|
if (object instanceof $root.tendermint.types.EvidenceList)
|
|
return object;
|
|
var message = new $root.tendermint.types.EvidenceList();
|
|
if (object.evidence) {
|
|
if (!Array.isArray(object.evidence))
|
|
throw TypeError(".tendermint.types.EvidenceList.evidence: array expected");
|
|
message.evidence = [];
|
|
for (var i = 0; i < object.evidence.length; ++i) {
|
|
if (typeof object.evidence[i] !== "object")
|
|
throw TypeError(".tendermint.types.EvidenceList.evidence: object expected");
|
|
message.evidence[i] = $root.tendermint.types.Evidence.fromObject(object.evidence[i]);
|
|
}
|
|
}
|
|
return message;
|
|
};
|
|
|
|
/**
|
|
* Creates a plain object from an EvidenceList message. Also converts values to other types if specified.
|
|
* @function toObject
|
|
* @memberof tendermint.types.EvidenceList
|
|
* @static
|
|
* @param {tendermint.types.EvidenceList} message EvidenceList
|
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
* @returns {Object.<string,*>} Plain object
|
|
*/
|
|
EvidenceList.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.evidence = [];
|
|
if (message.evidence && message.evidence.length) {
|
|
object.evidence = [];
|
|
for (var j = 0; j < message.evidence.length; ++j)
|
|
object.evidence[j] = $root.tendermint.types.Evidence.toObject(message.evidence[j], options);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this EvidenceList to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.types.EvidenceList
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
EvidenceList.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return EvidenceList;
|
|
})(types.EvidenceList || {});
|
|
|
|
types.ConsensusParams = (function(ConsensusParams) {
|
|
|
|
/**
|
|
* 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;
|
|
|
|
/**
|
|
* Creates a new ConsensusParams instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.ConsensusParams
|
|
* @static
|
|
* @param {tendermint.types.IConsensusParams=} [properties] Properties to set
|
|
* @returns {tendermint.types.ConsensusParams} ConsensusParams instance
|
|
*/
|
|
ConsensusParams.create = function create(properties) {
|
|
return new ConsensusParams(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
ConsensusParams.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ConsensusParams;
|
|
})(types.ConsensusParams || {});
|
|
|
|
types.BlockParams = (function(BlockParams) {
|
|
|
|
/**
|
|
* Properties of a BlockParams.
|
|
* @memberof tendermint.types
|
|
* @interface IBlockParams
|
|
* @property {number|Long|null} [maxBytes] BlockParams maxBytes
|
|
* @property {number|Long|null} [maxGas] BlockParams maxGas
|
|
* @property {number|Long|null} [timeIotaMs] BlockParams timeIotaMs
|
|
*/
|
|
|
|
/**
|
|
* 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 maxBytes.
|
|
* @member {number|Long} maxBytes
|
|
* @memberof tendermint.types.BlockParams
|
|
* @instance
|
|
*/
|
|
BlockParams.prototype.maxBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* BlockParams maxGas.
|
|
* @member {number|Long} maxGas
|
|
* @memberof tendermint.types.BlockParams
|
|
* @instance
|
|
*/
|
|
BlockParams.prototype.maxGas = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* BlockParams timeIotaMs.
|
|
* @member {number|Long} timeIotaMs
|
|
* @memberof tendermint.types.BlockParams
|
|
* @instance
|
|
*/
|
|
BlockParams.prototype.timeIotaMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* Creates a new BlockParams instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.BlockParams
|
|
* @static
|
|
* @param {tendermint.types.IBlockParams=} [properties] Properties to set
|
|
* @returns {tendermint.types.BlockParams} BlockParams instance
|
|
*/
|
|
BlockParams.create = function create(properties) {
|
|
return new BlockParams(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes"))
|
|
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.maxBytes);
|
|
if (message.maxGas != null && Object.hasOwnProperty.call(message, "maxGas"))
|
|
writer.uint32(/* id 2, wireType 0 =*/16).int64(message.maxGas);
|
|
if (message.timeIotaMs != null && Object.hasOwnProperty.call(message, "timeIotaMs"))
|
|
writer.uint32(/* id 3, wireType 0 =*/24).int64(message.timeIotaMs);
|
|
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.maxBytes = reader.int64();
|
|
break;
|
|
case 2:
|
|
message.maxGas = reader.int64();
|
|
break;
|
|
case 3:
|
|
message.timeIotaMs = 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.<string,*>} 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.maxBytes != null && message.hasOwnProperty("maxBytes"))
|
|
if (!$util.isInteger(message.maxBytes) && !(message.maxBytes && $util.isInteger(message.maxBytes.low) && $util.isInteger(message.maxBytes.high)))
|
|
return "maxBytes: integer|Long expected";
|
|
if (message.maxGas != null && message.hasOwnProperty("maxGas"))
|
|
if (!$util.isInteger(message.maxGas) && !(message.maxGas && $util.isInteger(message.maxGas.low) && $util.isInteger(message.maxGas.high)))
|
|
return "maxGas: integer|Long expected";
|
|
if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs"))
|
|
if (!$util.isInteger(message.timeIotaMs) && !(message.timeIotaMs && $util.isInteger(message.timeIotaMs.low) && $util.isInteger(message.timeIotaMs.high)))
|
|
return "timeIotaMs: 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.<string,*>} 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.maxBytes != null)
|
|
if ($util.Long)
|
|
(message.maxBytes = $util.Long.fromValue(object.maxBytes)).unsigned = false;
|
|
else if (typeof object.maxBytes === "string")
|
|
message.maxBytes = parseInt(object.maxBytes, 10);
|
|
else if (typeof object.maxBytes === "number")
|
|
message.maxBytes = object.maxBytes;
|
|
else if (typeof object.maxBytes === "object")
|
|
message.maxBytes = new $util.LongBits(object.maxBytes.low >>> 0, object.maxBytes.high >>> 0).toNumber();
|
|
if (object.maxGas != null)
|
|
if ($util.Long)
|
|
(message.maxGas = $util.Long.fromValue(object.maxGas)).unsigned = false;
|
|
else if (typeof object.maxGas === "string")
|
|
message.maxGas = parseInt(object.maxGas, 10);
|
|
else if (typeof object.maxGas === "number")
|
|
message.maxGas = object.maxGas;
|
|
else if (typeof object.maxGas === "object")
|
|
message.maxGas = new $util.LongBits(object.maxGas.low >>> 0, object.maxGas.high >>> 0).toNumber();
|
|
if (object.timeIotaMs != null)
|
|
if ($util.Long)
|
|
(message.timeIotaMs = $util.Long.fromValue(object.timeIotaMs)).unsigned = false;
|
|
else if (typeof object.timeIotaMs === "string")
|
|
message.timeIotaMs = parseInt(object.timeIotaMs, 10);
|
|
else if (typeof object.timeIotaMs === "number")
|
|
message.timeIotaMs = object.timeIotaMs;
|
|
else if (typeof object.timeIotaMs === "object")
|
|
message.timeIotaMs = new $util.LongBits(object.timeIotaMs.low >>> 0, object.timeIotaMs.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.<string,*>} 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.maxBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.maxBytes = options.longs === String ? "0" : 0;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.maxGas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.maxGas = options.longs === String ? "0" : 0;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.timeIotaMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.timeIotaMs = options.longs === String ? "0" : 0;
|
|
}
|
|
if (message.maxBytes != null && message.hasOwnProperty("maxBytes"))
|
|
if (typeof message.maxBytes === "number")
|
|
object.maxBytes = options.longs === String ? String(message.maxBytes) : message.maxBytes;
|
|
else
|
|
object.maxBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxBytes) : options.longs === Number ? new $util.LongBits(message.maxBytes.low >>> 0, message.maxBytes.high >>> 0).toNumber() : message.maxBytes;
|
|
if (message.maxGas != null && message.hasOwnProperty("maxGas"))
|
|
if (typeof message.maxGas === "number")
|
|
object.maxGas = options.longs === String ? String(message.maxGas) : message.maxGas;
|
|
else
|
|
object.maxGas = options.longs === String ? $util.Long.prototype.toString.call(message.maxGas) : options.longs === Number ? new $util.LongBits(message.maxGas.low >>> 0, message.maxGas.high >>> 0).toNumber() : message.maxGas;
|
|
if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs"))
|
|
if (typeof message.timeIotaMs === "number")
|
|
object.timeIotaMs = options.longs === String ? String(message.timeIotaMs) : message.timeIotaMs;
|
|
else
|
|
object.timeIotaMs = options.longs === String ? $util.Long.prototype.toString.call(message.timeIotaMs) : options.longs === Number ? new $util.LongBits(message.timeIotaMs.low >>> 0, message.timeIotaMs.high >>> 0).toNumber() : message.timeIotaMs;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this BlockParams to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.types.BlockParams
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
BlockParams.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return BlockParams;
|
|
})(types.BlockParams || {});
|
|
|
|
types.EvidenceParams = (function(EvidenceParams) {
|
|
|
|
/**
|
|
* Properties of an EvidenceParams.
|
|
* @memberof tendermint.types
|
|
* @interface IEvidenceParams
|
|
* @property {number|Long|null} [maxAgeNumBlocks] EvidenceParams maxAgeNumBlocks
|
|
* @property {google.protobuf.IDuration|null} [maxAgeDuration] EvidenceParams maxAgeDuration
|
|
* @property {number|Long|null} [maxBytes] EvidenceParams maxBytes
|
|
*/
|
|
|
|
/**
|
|
* 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 maxAgeNumBlocks.
|
|
* @member {number|Long} maxAgeNumBlocks
|
|
* @memberof tendermint.types.EvidenceParams
|
|
* @instance
|
|
*/
|
|
EvidenceParams.prototype.maxAgeNumBlocks = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* EvidenceParams maxAgeDuration.
|
|
* @member {google.protobuf.IDuration|null|undefined} maxAgeDuration
|
|
* @memberof tendermint.types.EvidenceParams
|
|
* @instance
|
|
*/
|
|
EvidenceParams.prototype.maxAgeDuration = null;
|
|
|
|
/**
|
|
* EvidenceParams maxBytes.
|
|
* @member {number|Long} maxBytes
|
|
* @memberof tendermint.types.EvidenceParams
|
|
* @instance
|
|
*/
|
|
EvidenceParams.prototype.maxBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* Creates a new EvidenceParams instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.EvidenceParams
|
|
* @static
|
|
* @param {tendermint.types.IEvidenceParams=} [properties] Properties to set
|
|
* @returns {tendermint.types.EvidenceParams} EvidenceParams instance
|
|
*/
|
|
EvidenceParams.create = function create(properties) {
|
|
return new EvidenceParams(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.maxAgeNumBlocks != null && Object.hasOwnProperty.call(message, "maxAgeNumBlocks"))
|
|
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.maxAgeNumBlocks);
|
|
if (message.maxAgeDuration != null && Object.hasOwnProperty.call(message, "maxAgeDuration"))
|
|
$root.google.protobuf.Duration.encode(message.maxAgeDuration, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes"))
|
|
writer.uint32(/* id 3, wireType 0 =*/24).int64(message.maxBytes);
|
|
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.maxAgeNumBlocks = reader.int64();
|
|
break;
|
|
case 2:
|
|
message.maxAgeDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32());
|
|
break;
|
|
case 3:
|
|
message.maxBytes = 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.<string,*>} 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.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks"))
|
|
if (!$util.isInteger(message.maxAgeNumBlocks) && !(message.maxAgeNumBlocks && $util.isInteger(message.maxAgeNumBlocks.low) && $util.isInteger(message.maxAgeNumBlocks.high)))
|
|
return "maxAgeNumBlocks: integer|Long expected";
|
|
if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) {
|
|
var error = $root.google.protobuf.Duration.verify(message.maxAgeDuration);
|
|
if (error)
|
|
return "maxAgeDuration." + error;
|
|
}
|
|
if (message.maxBytes != null && message.hasOwnProperty("maxBytes"))
|
|
if (!$util.isInteger(message.maxBytes) && !(message.maxBytes && $util.isInteger(message.maxBytes.low) && $util.isInteger(message.maxBytes.high)))
|
|
return "maxBytes: 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.<string,*>} 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.maxAgeNumBlocks != null)
|
|
if ($util.Long)
|
|
(message.maxAgeNumBlocks = $util.Long.fromValue(object.maxAgeNumBlocks)).unsigned = false;
|
|
else if (typeof object.maxAgeNumBlocks === "string")
|
|
message.maxAgeNumBlocks = parseInt(object.maxAgeNumBlocks, 10);
|
|
else if (typeof object.maxAgeNumBlocks === "number")
|
|
message.maxAgeNumBlocks = object.maxAgeNumBlocks;
|
|
else if (typeof object.maxAgeNumBlocks === "object")
|
|
message.maxAgeNumBlocks = new $util.LongBits(object.maxAgeNumBlocks.low >>> 0, object.maxAgeNumBlocks.high >>> 0).toNumber();
|
|
if (object.maxAgeDuration != null) {
|
|
if (typeof object.maxAgeDuration !== "object")
|
|
throw TypeError(".tendermint.types.EvidenceParams.maxAgeDuration: object expected");
|
|
message.maxAgeDuration = $root.google.protobuf.Duration.fromObject(object.maxAgeDuration);
|
|
}
|
|
if (object.maxBytes != null)
|
|
if ($util.Long)
|
|
(message.maxBytes = $util.Long.fromValue(object.maxBytes)).unsigned = false;
|
|
else if (typeof object.maxBytes === "string")
|
|
message.maxBytes = parseInt(object.maxBytes, 10);
|
|
else if (typeof object.maxBytes === "number")
|
|
message.maxBytes = object.maxBytes;
|
|
else if (typeof object.maxBytes === "object")
|
|
message.maxBytes = new $util.LongBits(object.maxBytes.low >>> 0, object.maxBytes.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.<string,*>} 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.maxAgeNumBlocks = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.maxAgeNumBlocks = options.longs === String ? "0" : 0;
|
|
object.maxAgeDuration = null;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.maxBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.maxBytes = options.longs === String ? "0" : 0;
|
|
}
|
|
if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks"))
|
|
if (typeof message.maxAgeNumBlocks === "number")
|
|
object.maxAgeNumBlocks = options.longs === String ? String(message.maxAgeNumBlocks) : message.maxAgeNumBlocks;
|
|
else
|
|
object.maxAgeNumBlocks = options.longs === String ? $util.Long.prototype.toString.call(message.maxAgeNumBlocks) : options.longs === Number ? new $util.LongBits(message.maxAgeNumBlocks.low >>> 0, message.maxAgeNumBlocks.high >>> 0).toNumber() : message.maxAgeNumBlocks;
|
|
if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration"))
|
|
object.maxAgeDuration = $root.google.protobuf.Duration.toObject(message.maxAgeDuration, options);
|
|
if (message.maxBytes != null && message.hasOwnProperty("maxBytes"))
|
|
if (typeof message.maxBytes === "number")
|
|
object.maxBytes = options.longs === String ? String(message.maxBytes) : message.maxBytes;
|
|
else
|
|
object.maxBytes = options.longs === String ? $util.Long.prototype.toString.call(message.maxBytes) : options.longs === Number ? new $util.LongBits(message.maxBytes.low >>> 0, message.maxBytes.high >>> 0).toNumber() : message.maxBytes;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this EvidenceParams to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.types.EvidenceParams
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
EvidenceParams.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return EvidenceParams;
|
|
})(types.EvidenceParams || {});
|
|
|
|
types.ValidatorParams = (function(ValidatorParams) {
|
|
|
|
/**
|
|
* Properties of a ValidatorParams.
|
|
* @memberof tendermint.types
|
|
* @interface IValidatorParams
|
|
* @property {Array.<string>|null} [pubKeyTypes] ValidatorParams pubKeyTypes
|
|
*/
|
|
|
|
/**
|
|
* 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.pubKeyTypes = [];
|
|
if (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 pubKeyTypes.
|
|
* @member {Array.<string>} pubKeyTypes
|
|
* @memberof tendermint.types.ValidatorParams
|
|
* @instance
|
|
*/
|
|
ValidatorParams.prototype.pubKeyTypes = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new ValidatorParams instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.ValidatorParams
|
|
* @static
|
|
* @param {tendermint.types.IValidatorParams=} [properties] Properties to set
|
|
* @returns {tendermint.types.ValidatorParams} ValidatorParams instance
|
|
*/
|
|
ValidatorParams.create = function create(properties) {
|
|
return new ValidatorParams(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.pubKeyTypes != null && message.pubKeyTypes.length)
|
|
for (var i = 0; i < message.pubKeyTypes.length; ++i)
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubKeyTypes[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.pubKeyTypes && message.pubKeyTypes.length))
|
|
message.pubKeyTypes = [];
|
|
message.pubKeyTypes.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.<string,*>} 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.pubKeyTypes != null && message.hasOwnProperty("pubKeyTypes")) {
|
|
if (!Array.isArray(message.pubKeyTypes))
|
|
return "pubKeyTypes: array expected";
|
|
for (var i = 0; i < message.pubKeyTypes.length; ++i)
|
|
if (!$util.isString(message.pubKeyTypes[i]))
|
|
return "pubKeyTypes: 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.<string,*>} 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.pubKeyTypes) {
|
|
if (!Array.isArray(object.pubKeyTypes))
|
|
throw TypeError(".tendermint.types.ValidatorParams.pubKeyTypes: array expected");
|
|
message.pubKeyTypes = [];
|
|
for (var i = 0; i < object.pubKeyTypes.length; ++i)
|
|
message.pubKeyTypes[i] = String(object.pubKeyTypes[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.<string,*>} Plain object
|
|
*/
|
|
ValidatorParams.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.pubKeyTypes = [];
|
|
if (message.pubKeyTypes && message.pubKeyTypes.length) {
|
|
object.pubKeyTypes = [];
|
|
for (var j = 0; j < message.pubKeyTypes.length; ++j)
|
|
object.pubKeyTypes[j] = message.pubKeyTypes[j];
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this ValidatorParams to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.types.ValidatorParams
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
ValidatorParams.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ValidatorParams;
|
|
})(types.ValidatorParams || {});
|
|
|
|
types.VersionParams = (function(VersionParams) {
|
|
|
|
/**
|
|
* Properties of a VersionParams.
|
|
* @memberof tendermint.types
|
|
* @interface IVersionParams
|
|
* @property {number|Long|null} [appVersion] VersionParams appVersion
|
|
*/
|
|
|
|
/**
|
|
* 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 appVersion.
|
|
* @member {number|Long} appVersion
|
|
* @memberof tendermint.types.VersionParams
|
|
* @instance
|
|
*/
|
|
VersionParams.prototype.appVersion = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* Creates a new VersionParams instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.VersionParams
|
|
* @static
|
|
* @param {tendermint.types.IVersionParams=} [properties] Properties to set
|
|
* @returns {tendermint.types.VersionParams} VersionParams instance
|
|
*/
|
|
VersionParams.create = function create(properties) {
|
|
return new VersionParams(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.appVersion != null && Object.hasOwnProperty.call(message, "appVersion"))
|
|
writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.appVersion);
|
|
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.appVersion = 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.<string,*>} 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.appVersion != null && message.hasOwnProperty("appVersion"))
|
|
if (!$util.isInteger(message.appVersion) && !(message.appVersion && $util.isInteger(message.appVersion.low) && $util.isInteger(message.appVersion.high)))
|
|
return "appVersion: 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.<string,*>} 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.appVersion != null)
|
|
if ($util.Long)
|
|
(message.appVersion = $util.Long.fromValue(object.appVersion)).unsigned = true;
|
|
else if (typeof object.appVersion === "string")
|
|
message.appVersion = parseInt(object.appVersion, 10);
|
|
else if (typeof object.appVersion === "number")
|
|
message.appVersion = object.appVersion;
|
|
else if (typeof object.appVersion === "object")
|
|
message.appVersion = new $util.LongBits(object.appVersion.low >>> 0, object.appVersion.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.<string,*>} 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.appVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.appVersion = options.longs === String ? "0" : 0;
|
|
if (message.appVersion != null && message.hasOwnProperty("appVersion"))
|
|
if (typeof message.appVersion === "number")
|
|
object.appVersion = options.longs === String ? String(message.appVersion) : message.appVersion;
|
|
else
|
|
object.appVersion = options.longs === String ? $util.Long.prototype.toString.call(message.appVersion) : options.longs === Number ? new $util.LongBits(message.appVersion.low >>> 0, message.appVersion.high >>> 0).toNumber(true) : message.appVersion;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this VersionParams to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.types.VersionParams
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
VersionParams.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return VersionParams;
|
|
})(types.VersionParams || {});
|
|
|
|
types.HashedParams = (function(HashedParams) {
|
|
|
|
/**
|
|
* Properties of a HashedParams.
|
|
* @memberof tendermint.types
|
|
* @interface IHashedParams
|
|
* @property {number|Long|null} [blockMaxBytes] HashedParams blockMaxBytes
|
|
* @property {number|Long|null} [blockMaxGas] HashedParams blockMaxGas
|
|
*/
|
|
|
|
/**
|
|
* 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 blockMaxBytes.
|
|
* @member {number|Long} blockMaxBytes
|
|
* @memberof tendermint.types.HashedParams
|
|
* @instance
|
|
*/
|
|
HashedParams.prototype.blockMaxBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* HashedParams blockMaxGas.
|
|
* @member {number|Long} blockMaxGas
|
|
* @memberof tendermint.types.HashedParams
|
|
* @instance
|
|
*/
|
|
HashedParams.prototype.blockMaxGas = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* Creates a new HashedParams instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.HashedParams
|
|
* @static
|
|
* @param {tendermint.types.IHashedParams=} [properties] Properties to set
|
|
* @returns {tendermint.types.HashedParams} HashedParams instance
|
|
*/
|
|
HashedParams.create = function create(properties) {
|
|
return new HashedParams(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.blockMaxBytes != null && Object.hasOwnProperty.call(message, "blockMaxBytes"))
|
|
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.blockMaxBytes);
|
|
if (message.blockMaxGas != null && Object.hasOwnProperty.call(message, "blockMaxGas"))
|
|
writer.uint32(/* id 2, wireType 0 =*/16).int64(message.blockMaxGas);
|
|
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.blockMaxBytes = reader.int64();
|
|
break;
|
|
case 2:
|
|
message.blockMaxGas = 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.<string,*>} 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.blockMaxBytes != null && message.hasOwnProperty("blockMaxBytes"))
|
|
if (!$util.isInteger(message.blockMaxBytes) && !(message.blockMaxBytes && $util.isInteger(message.blockMaxBytes.low) && $util.isInteger(message.blockMaxBytes.high)))
|
|
return "blockMaxBytes: integer|Long expected";
|
|
if (message.blockMaxGas != null && message.hasOwnProperty("blockMaxGas"))
|
|
if (!$util.isInteger(message.blockMaxGas) && !(message.blockMaxGas && $util.isInteger(message.blockMaxGas.low) && $util.isInteger(message.blockMaxGas.high)))
|
|
return "blockMaxGas: 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.<string,*>} 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.blockMaxBytes != null)
|
|
if ($util.Long)
|
|
(message.blockMaxBytes = $util.Long.fromValue(object.blockMaxBytes)).unsigned = false;
|
|
else if (typeof object.blockMaxBytes === "string")
|
|
message.blockMaxBytes = parseInt(object.blockMaxBytes, 10);
|
|
else if (typeof object.blockMaxBytes === "number")
|
|
message.blockMaxBytes = object.blockMaxBytes;
|
|
else if (typeof object.blockMaxBytes === "object")
|
|
message.blockMaxBytes = new $util.LongBits(object.blockMaxBytes.low >>> 0, object.blockMaxBytes.high >>> 0).toNumber();
|
|
if (object.blockMaxGas != null)
|
|
if ($util.Long)
|
|
(message.blockMaxGas = $util.Long.fromValue(object.blockMaxGas)).unsigned = false;
|
|
else if (typeof object.blockMaxGas === "string")
|
|
message.blockMaxGas = parseInt(object.blockMaxGas, 10);
|
|
else if (typeof object.blockMaxGas === "number")
|
|
message.blockMaxGas = object.blockMaxGas;
|
|
else if (typeof object.blockMaxGas === "object")
|
|
message.blockMaxGas = new $util.LongBits(object.blockMaxGas.low >>> 0, object.blockMaxGas.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.<string,*>} 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.blockMaxBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.blockMaxBytes = options.longs === String ? "0" : 0;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.blockMaxGas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.blockMaxGas = options.longs === String ? "0" : 0;
|
|
}
|
|
if (message.blockMaxBytes != null && message.hasOwnProperty("blockMaxBytes"))
|
|
if (typeof message.blockMaxBytes === "number")
|
|
object.blockMaxBytes = options.longs === String ? String(message.blockMaxBytes) : message.blockMaxBytes;
|
|
else
|
|
object.blockMaxBytes = options.longs === String ? $util.Long.prototype.toString.call(message.blockMaxBytes) : options.longs === Number ? new $util.LongBits(message.blockMaxBytes.low >>> 0, message.blockMaxBytes.high >>> 0).toNumber() : message.blockMaxBytes;
|
|
if (message.blockMaxGas != null && message.hasOwnProperty("blockMaxGas"))
|
|
if (typeof message.blockMaxGas === "number")
|
|
object.blockMaxGas = options.longs === String ? String(message.blockMaxGas) : message.blockMaxGas;
|
|
else
|
|
object.blockMaxGas = options.longs === String ? $util.Long.prototype.toString.call(message.blockMaxGas) : options.longs === Number ? new $util.LongBits(message.blockMaxGas.low >>> 0, message.blockMaxGas.high >>> 0).toNumber() : message.blockMaxGas;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this HashedParams to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.types.HashedParams
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
HashedParams.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return HashedParams;
|
|
})(types.HashedParams || {});
|
|
|
|
/**
|
|
* BlockIDFlag enum.
|
|
* @name tendermint.types.BlockIDFlag
|
|
* @enum {string}
|
|
* @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 {string}
|
|
* @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(PartSetHeader) {
|
|
|
|
/**
|
|
* 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([]);
|
|
|
|
/**
|
|
* Creates a new PartSetHeader instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.PartSetHeader
|
|
* @static
|
|
* @param {tendermint.types.IPartSetHeader=} [properties] Properties to set
|
|
* @returns {tendermint.types.PartSetHeader} PartSetHeader instance
|
|
*/
|
|
PartSetHeader.create = function create(properties) {
|
|
return new PartSetHeader(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
PartSetHeader.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return PartSetHeader;
|
|
})(types.PartSetHeader || {});
|
|
|
|
types.Part = (function(Part) {
|
|
|
|
/**
|
|
* 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;
|
|
|
|
/**
|
|
* Creates a new Part instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.Part
|
|
* @static
|
|
* @param {tendermint.types.IPart=} [properties] Properties to set
|
|
* @returns {tendermint.types.Part} Part instance
|
|
*/
|
|
Part.create = function create(properties) {
|
|
return new Part(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
Part.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Part;
|
|
})(types.Part || {});
|
|
|
|
types.BlockID = (function(BlockID) {
|
|
|
|
/**
|
|
* Properties of a BlockID.
|
|
* @memberof tendermint.types
|
|
* @interface IBlockID
|
|
* @property {Uint8Array|null} [hash] BlockID hash
|
|
* @property {tendermint.types.IPartSetHeader|null} [partSetHeader] BlockID partSetHeader
|
|
*/
|
|
|
|
/**
|
|
* 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 partSetHeader.
|
|
* @member {tendermint.types.IPartSetHeader|null|undefined} partSetHeader
|
|
* @memberof tendermint.types.BlockID
|
|
* @instance
|
|
*/
|
|
BlockID.prototype.partSetHeader = null;
|
|
|
|
/**
|
|
* Creates a new BlockID instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.BlockID
|
|
* @static
|
|
* @param {tendermint.types.IBlockID=} [properties] Properties to set
|
|
* @returns {tendermint.types.BlockID} BlockID instance
|
|
*/
|
|
BlockID.create = function create(properties) {
|
|
return new BlockID(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.partSetHeader != null && Object.hasOwnProperty.call(message, "partSetHeader"))
|
|
$root.tendermint.types.PartSetHeader.encode(message.partSetHeader, 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.partSetHeader = $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.<string,*>} 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.partSetHeader != null && message.hasOwnProperty("partSetHeader")) {
|
|
var error = $root.tendermint.types.PartSetHeader.verify(message.partSetHeader);
|
|
if (error)
|
|
return "partSetHeader." + 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.<string,*>} 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.partSetHeader != null) {
|
|
if (typeof object.partSetHeader !== "object")
|
|
throw TypeError(".tendermint.types.BlockID.partSetHeader: object expected");
|
|
message.partSetHeader = $root.tendermint.types.PartSetHeader.fromObject(object.partSetHeader);
|
|
}
|
|
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.<string,*>} 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.partSetHeader = 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.partSetHeader != null && message.hasOwnProperty("partSetHeader"))
|
|
object.partSetHeader = $root.tendermint.types.PartSetHeader.toObject(message.partSetHeader, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this BlockID to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.types.BlockID
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
BlockID.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return BlockID;
|
|
})(types.BlockID || {});
|
|
|
|
types.Header = (function(Header) {
|
|
|
|
/**
|
|
* Properties of a Header.
|
|
* @memberof tendermint.types
|
|
* @interface IHeader
|
|
* @property {tendermint.version.IConsensus|null} [version] Header version
|
|
* @property {string|null} [chainId] Header chainId
|
|
* @property {number|Long|null} [height] Header height
|
|
* @property {google.protobuf.ITimestamp|null} [time] Header time
|
|
* @property {tendermint.types.IBlockID|null} [lastBlockId] Header lastBlockId
|
|
* @property {Uint8Array|null} [lastCommitHash] Header lastCommitHash
|
|
* @property {Uint8Array|null} [dataHash] Header dataHash
|
|
* @property {Uint8Array|null} [validatorsHash] Header validatorsHash
|
|
* @property {Uint8Array|null} [nextValidatorsHash] Header nextValidatorsHash
|
|
* @property {Uint8Array|null} [consensusHash] Header consensusHash
|
|
* @property {Uint8Array|null} [appHash] Header appHash
|
|
* @property {Uint8Array|null} [lastResultsHash] Header lastResultsHash
|
|
* @property {Uint8Array|null} [evidenceHash] Header evidenceHash
|
|
* @property {Uint8Array|null} [proposerAddress] Header proposerAddress
|
|
*/
|
|
|
|
/**
|
|
* 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 chainId.
|
|
* @member {string} chainId
|
|
* @memberof tendermint.types.Header
|
|
* @instance
|
|
*/
|
|
Header.prototype.chainId = "";
|
|
|
|
/**
|
|
* Header height.
|
|
* @member {number|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 lastBlockId.
|
|
* @member {tendermint.types.IBlockID|null|undefined} lastBlockId
|
|
* @memberof tendermint.types.Header
|
|
* @instance
|
|
*/
|
|
Header.prototype.lastBlockId = null;
|
|
|
|
/**
|
|
* Header lastCommitHash.
|
|
* @member {Uint8Array} lastCommitHash
|
|
* @memberof tendermint.types.Header
|
|
* @instance
|
|
*/
|
|
Header.prototype.lastCommitHash = $util.newBuffer([]);
|
|
|
|
/**
|
|
* Header dataHash.
|
|
* @member {Uint8Array} dataHash
|
|
* @memberof tendermint.types.Header
|
|
* @instance
|
|
*/
|
|
Header.prototype.dataHash = $util.newBuffer([]);
|
|
|
|
/**
|
|
* Header validatorsHash.
|
|
* @member {Uint8Array} validatorsHash
|
|
* @memberof tendermint.types.Header
|
|
* @instance
|
|
*/
|
|
Header.prototype.validatorsHash = $util.newBuffer([]);
|
|
|
|
/**
|
|
* Header nextValidatorsHash.
|
|
* @member {Uint8Array} nextValidatorsHash
|
|
* @memberof tendermint.types.Header
|
|
* @instance
|
|
*/
|
|
Header.prototype.nextValidatorsHash = $util.newBuffer([]);
|
|
|
|
/**
|
|
* Header consensusHash.
|
|
* @member {Uint8Array} consensusHash
|
|
* @memberof tendermint.types.Header
|
|
* @instance
|
|
*/
|
|
Header.prototype.consensusHash = $util.newBuffer([]);
|
|
|
|
/**
|
|
* Header appHash.
|
|
* @member {Uint8Array} appHash
|
|
* @memberof tendermint.types.Header
|
|
* @instance
|
|
*/
|
|
Header.prototype.appHash = $util.newBuffer([]);
|
|
|
|
/**
|
|
* Header lastResultsHash.
|
|
* @member {Uint8Array} lastResultsHash
|
|
* @memberof tendermint.types.Header
|
|
* @instance
|
|
*/
|
|
Header.prototype.lastResultsHash = $util.newBuffer([]);
|
|
|
|
/**
|
|
* Header evidenceHash.
|
|
* @member {Uint8Array} evidenceHash
|
|
* @memberof tendermint.types.Header
|
|
* @instance
|
|
*/
|
|
Header.prototype.evidenceHash = $util.newBuffer([]);
|
|
|
|
/**
|
|
* Header proposerAddress.
|
|
* @member {Uint8Array} proposerAddress
|
|
* @memberof tendermint.types.Header
|
|
* @instance
|
|
*/
|
|
Header.prototype.proposerAddress = $util.newBuffer([]);
|
|
|
|
/**
|
|
* Creates a new Header instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.Header
|
|
* @static
|
|
* @param {tendermint.types.IHeader=} [properties] Properties to set
|
|
* @returns {tendermint.types.Header} Header instance
|
|
*/
|
|
Header.create = function create(properties) {
|
|
return new Header(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.chainId != null && Object.hasOwnProperty.call(message, "chainId"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.chainId);
|
|
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.lastBlockId != null && Object.hasOwnProperty.call(message, "lastBlockId"))
|
|
$root.tendermint.types.BlockID.encode(message.lastBlockId, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
|
if (message.lastCommitHash != null && Object.hasOwnProperty.call(message, "lastCommitHash"))
|
|
writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.lastCommitHash);
|
|
if (message.dataHash != null && Object.hasOwnProperty.call(message, "dataHash"))
|
|
writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.dataHash);
|
|
if (message.validatorsHash != null && Object.hasOwnProperty.call(message, "validatorsHash"))
|
|
writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.validatorsHash);
|
|
if (message.nextValidatorsHash != null && Object.hasOwnProperty.call(message, "nextValidatorsHash"))
|
|
writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.nextValidatorsHash);
|
|
if (message.consensusHash != null && Object.hasOwnProperty.call(message, "consensusHash"))
|
|
writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.consensusHash);
|
|
if (message.appHash != null && Object.hasOwnProperty.call(message, "appHash"))
|
|
writer.uint32(/* id 11, wireType 2 =*/90).bytes(message.appHash);
|
|
if (message.lastResultsHash != null && Object.hasOwnProperty.call(message, "lastResultsHash"))
|
|
writer.uint32(/* id 12, wireType 2 =*/98).bytes(message.lastResultsHash);
|
|
if (message.evidenceHash != null && Object.hasOwnProperty.call(message, "evidenceHash"))
|
|
writer.uint32(/* id 13, wireType 2 =*/106).bytes(message.evidenceHash);
|
|
if (message.proposerAddress != null && Object.hasOwnProperty.call(message, "proposerAddress"))
|
|
writer.uint32(/* id 14, wireType 2 =*/114).bytes(message.proposerAddress);
|
|
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.chainId = 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.lastBlockId = $root.tendermint.types.BlockID.decode(reader, reader.uint32());
|
|
break;
|
|
case 6:
|
|
message.lastCommitHash = reader.bytes();
|
|
break;
|
|
case 7:
|
|
message.dataHash = reader.bytes();
|
|
break;
|
|
case 8:
|
|
message.validatorsHash = reader.bytes();
|
|
break;
|
|
case 9:
|
|
message.nextValidatorsHash = reader.bytes();
|
|
break;
|
|
case 10:
|
|
message.consensusHash = reader.bytes();
|
|
break;
|
|
case 11:
|
|
message.appHash = reader.bytes();
|
|
break;
|
|
case 12:
|
|
message.lastResultsHash = reader.bytes();
|
|
break;
|
|
case 13:
|
|
message.evidenceHash = reader.bytes();
|
|
break;
|
|
case 14:
|
|
message.proposerAddress = 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.<string,*>} 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.chainId != null && message.hasOwnProperty("chainId"))
|
|
if (!$util.isString(message.chainId))
|
|
return "chainId: 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.lastBlockId != null && message.hasOwnProperty("lastBlockId")) {
|
|
var error = $root.tendermint.types.BlockID.verify(message.lastBlockId);
|
|
if (error)
|
|
return "lastBlockId." + error;
|
|
}
|
|
if (message.lastCommitHash != null && message.hasOwnProperty("lastCommitHash"))
|
|
if (!(message.lastCommitHash && typeof message.lastCommitHash.length === "number" || $util.isString(message.lastCommitHash)))
|
|
return "lastCommitHash: buffer expected";
|
|
if (message.dataHash != null && message.hasOwnProperty("dataHash"))
|
|
if (!(message.dataHash && typeof message.dataHash.length === "number" || $util.isString(message.dataHash)))
|
|
return "dataHash: buffer expected";
|
|
if (message.validatorsHash != null && message.hasOwnProperty("validatorsHash"))
|
|
if (!(message.validatorsHash && typeof message.validatorsHash.length === "number" || $util.isString(message.validatorsHash)))
|
|
return "validatorsHash: buffer expected";
|
|
if (message.nextValidatorsHash != null && message.hasOwnProperty("nextValidatorsHash"))
|
|
if (!(message.nextValidatorsHash && typeof message.nextValidatorsHash.length === "number" || $util.isString(message.nextValidatorsHash)))
|
|
return "nextValidatorsHash: buffer expected";
|
|
if (message.consensusHash != null && message.hasOwnProperty("consensusHash"))
|
|
if (!(message.consensusHash && typeof message.consensusHash.length === "number" || $util.isString(message.consensusHash)))
|
|
return "consensusHash: buffer expected";
|
|
if (message.appHash != null && message.hasOwnProperty("appHash"))
|
|
if (!(message.appHash && typeof message.appHash.length === "number" || $util.isString(message.appHash)))
|
|
return "appHash: buffer expected";
|
|
if (message.lastResultsHash != null && message.hasOwnProperty("lastResultsHash"))
|
|
if (!(message.lastResultsHash && typeof message.lastResultsHash.length === "number" || $util.isString(message.lastResultsHash)))
|
|
return "lastResultsHash: buffer expected";
|
|
if (message.evidenceHash != null && message.hasOwnProperty("evidenceHash"))
|
|
if (!(message.evidenceHash && typeof message.evidenceHash.length === "number" || $util.isString(message.evidenceHash)))
|
|
return "evidenceHash: buffer expected";
|
|
if (message.proposerAddress != null && message.hasOwnProperty("proposerAddress"))
|
|
if (!(message.proposerAddress && typeof message.proposerAddress.length === "number" || $util.isString(message.proposerAddress)))
|
|
return "proposerAddress: 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.<string,*>} 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.chainId != null)
|
|
message.chainId = String(object.chainId);
|
|
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.lastBlockId != null) {
|
|
if (typeof object.lastBlockId !== "object")
|
|
throw TypeError(".tendermint.types.Header.lastBlockId: object expected");
|
|
message.lastBlockId = $root.tendermint.types.BlockID.fromObject(object.lastBlockId);
|
|
}
|
|
if (object.lastCommitHash != null)
|
|
if (typeof object.lastCommitHash === "string")
|
|
$util.base64.decode(object.lastCommitHash, message.lastCommitHash = $util.newBuffer($util.base64.length(object.lastCommitHash)), 0);
|
|
else if (object.lastCommitHash.length)
|
|
message.lastCommitHash = object.lastCommitHash;
|
|
if (object.dataHash != null)
|
|
if (typeof object.dataHash === "string")
|
|
$util.base64.decode(object.dataHash, message.dataHash = $util.newBuffer($util.base64.length(object.dataHash)), 0);
|
|
else if (object.dataHash.length)
|
|
message.dataHash = object.dataHash;
|
|
if (object.validatorsHash != null)
|
|
if (typeof object.validatorsHash === "string")
|
|
$util.base64.decode(object.validatorsHash, message.validatorsHash = $util.newBuffer($util.base64.length(object.validatorsHash)), 0);
|
|
else if (object.validatorsHash.length)
|
|
message.validatorsHash = object.validatorsHash;
|
|
if (object.nextValidatorsHash != null)
|
|
if (typeof object.nextValidatorsHash === "string")
|
|
$util.base64.decode(object.nextValidatorsHash, message.nextValidatorsHash = $util.newBuffer($util.base64.length(object.nextValidatorsHash)), 0);
|
|
else if (object.nextValidatorsHash.length)
|
|
message.nextValidatorsHash = object.nextValidatorsHash;
|
|
if (object.consensusHash != null)
|
|
if (typeof object.consensusHash === "string")
|
|
$util.base64.decode(object.consensusHash, message.consensusHash = $util.newBuffer($util.base64.length(object.consensusHash)), 0);
|
|
else if (object.consensusHash.length)
|
|
message.consensusHash = object.consensusHash;
|
|
if (object.appHash != null)
|
|
if (typeof object.appHash === "string")
|
|
$util.base64.decode(object.appHash, message.appHash = $util.newBuffer($util.base64.length(object.appHash)), 0);
|
|
else if (object.appHash.length)
|
|
message.appHash = object.appHash;
|
|
if (object.lastResultsHash != null)
|
|
if (typeof object.lastResultsHash === "string")
|
|
$util.base64.decode(object.lastResultsHash, message.lastResultsHash = $util.newBuffer($util.base64.length(object.lastResultsHash)), 0);
|
|
else if (object.lastResultsHash.length)
|
|
message.lastResultsHash = object.lastResultsHash;
|
|
if (object.evidenceHash != null)
|
|
if (typeof object.evidenceHash === "string")
|
|
$util.base64.decode(object.evidenceHash, message.evidenceHash = $util.newBuffer($util.base64.length(object.evidenceHash)), 0);
|
|
else if (object.evidenceHash.length)
|
|
message.evidenceHash = object.evidenceHash;
|
|
if (object.proposerAddress != null)
|
|
if (typeof object.proposerAddress === "string")
|
|
$util.base64.decode(object.proposerAddress, message.proposerAddress = $util.newBuffer($util.base64.length(object.proposerAddress)), 0);
|
|
else if (object.proposerAddress.length)
|
|
message.proposerAddress = object.proposerAddress;
|
|
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.<string,*>} Plain object
|
|
*/
|
|
Header.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.version = null;
|
|
object.chainId = "";
|
|
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.lastBlockId = null;
|
|
if (options.bytes === String)
|
|
object.lastCommitHash = "";
|
|
else {
|
|
object.lastCommitHash = [];
|
|
if (options.bytes !== Array)
|
|
object.lastCommitHash = $util.newBuffer(object.lastCommitHash);
|
|
}
|
|
if (options.bytes === String)
|
|
object.dataHash = "";
|
|
else {
|
|
object.dataHash = [];
|
|
if (options.bytes !== Array)
|
|
object.dataHash = $util.newBuffer(object.dataHash);
|
|
}
|
|
if (options.bytes === String)
|
|
object.validatorsHash = "";
|
|
else {
|
|
object.validatorsHash = [];
|
|
if (options.bytes !== Array)
|
|
object.validatorsHash = $util.newBuffer(object.validatorsHash);
|
|
}
|
|
if (options.bytes === String)
|
|
object.nextValidatorsHash = "";
|
|
else {
|
|
object.nextValidatorsHash = [];
|
|
if (options.bytes !== Array)
|
|
object.nextValidatorsHash = $util.newBuffer(object.nextValidatorsHash);
|
|
}
|
|
if (options.bytes === String)
|
|
object.consensusHash = "";
|
|
else {
|
|
object.consensusHash = [];
|
|
if (options.bytes !== Array)
|
|
object.consensusHash = $util.newBuffer(object.consensusHash);
|
|
}
|
|
if (options.bytes === String)
|
|
object.appHash = "";
|
|
else {
|
|
object.appHash = [];
|
|
if (options.bytes !== Array)
|
|
object.appHash = $util.newBuffer(object.appHash);
|
|
}
|
|
if (options.bytes === String)
|
|
object.lastResultsHash = "";
|
|
else {
|
|
object.lastResultsHash = [];
|
|
if (options.bytes !== Array)
|
|
object.lastResultsHash = $util.newBuffer(object.lastResultsHash);
|
|
}
|
|
if (options.bytes === String)
|
|
object.evidenceHash = "";
|
|
else {
|
|
object.evidenceHash = [];
|
|
if (options.bytes !== Array)
|
|
object.evidenceHash = $util.newBuffer(object.evidenceHash);
|
|
}
|
|
if (options.bytes === String)
|
|
object.proposerAddress = "";
|
|
else {
|
|
object.proposerAddress = [];
|
|
if (options.bytes !== Array)
|
|
object.proposerAddress = $util.newBuffer(object.proposerAddress);
|
|
}
|
|
}
|
|
if (message.version != null && message.hasOwnProperty("version"))
|
|
object.version = $root.tendermint.version.Consensus.toObject(message.version, options);
|
|
if (message.chainId != null && message.hasOwnProperty("chainId"))
|
|
object.chainId = message.chainId;
|
|
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.lastBlockId != null && message.hasOwnProperty("lastBlockId"))
|
|
object.lastBlockId = $root.tendermint.types.BlockID.toObject(message.lastBlockId, options);
|
|
if (message.lastCommitHash != null && message.hasOwnProperty("lastCommitHash"))
|
|
object.lastCommitHash = options.bytes === String ? $util.base64.encode(message.lastCommitHash, 0, message.lastCommitHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastCommitHash) : message.lastCommitHash;
|
|
if (message.dataHash != null && message.hasOwnProperty("dataHash"))
|
|
object.dataHash = options.bytes === String ? $util.base64.encode(message.dataHash, 0, message.dataHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataHash) : message.dataHash;
|
|
if (message.validatorsHash != null && message.hasOwnProperty("validatorsHash"))
|
|
object.validatorsHash = options.bytes === String ? $util.base64.encode(message.validatorsHash, 0, message.validatorsHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.validatorsHash) : message.validatorsHash;
|
|
if (message.nextValidatorsHash != null && message.hasOwnProperty("nextValidatorsHash"))
|
|
object.nextValidatorsHash = options.bytes === String ? $util.base64.encode(message.nextValidatorsHash, 0, message.nextValidatorsHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.nextValidatorsHash) : message.nextValidatorsHash;
|
|
if (message.consensusHash != null && message.hasOwnProperty("consensusHash"))
|
|
object.consensusHash = options.bytes === String ? $util.base64.encode(message.consensusHash, 0, message.consensusHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.consensusHash) : message.consensusHash;
|
|
if (message.appHash != null && message.hasOwnProperty("appHash"))
|
|
object.appHash = options.bytes === String ? $util.base64.encode(message.appHash, 0, message.appHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.appHash) : message.appHash;
|
|
if (message.lastResultsHash != null && message.hasOwnProperty("lastResultsHash"))
|
|
object.lastResultsHash = options.bytes === String ? $util.base64.encode(message.lastResultsHash, 0, message.lastResultsHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.lastResultsHash) : message.lastResultsHash;
|
|
if (message.evidenceHash != null && message.hasOwnProperty("evidenceHash"))
|
|
object.evidenceHash = options.bytes === String ? $util.base64.encode(message.evidenceHash, 0, message.evidenceHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.evidenceHash) : message.evidenceHash;
|
|
if (message.proposerAddress != null && message.hasOwnProperty("proposerAddress"))
|
|
object.proposerAddress = options.bytes === String ? $util.base64.encode(message.proposerAddress, 0, message.proposerAddress.length) : options.bytes === Array ? Array.prototype.slice.call(message.proposerAddress) : message.proposerAddress;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Header to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.types.Header
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Header.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Header;
|
|
})(types.Header || {});
|
|
|
|
types.Data = (function(Data) {
|
|
|
|
/**
|
|
* Properties of a Data.
|
|
* @memberof tendermint.types
|
|
* @interface IData
|
|
* @property {Array.<Uint8Array>|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.<Uint8Array>} txs
|
|
* @memberof tendermint.types.Data
|
|
* @instance
|
|
*/
|
|
Data.prototype.txs = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new Data instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.Data
|
|
* @static
|
|
* @param {tendermint.types.IData=} [properties] Properties to set
|
|
* @returns {tendermint.types.Data} Data instance
|
|
*/
|
|
Data.create = function create(properties) {
|
|
return new Data(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
Data.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Data;
|
|
})(types.Data || {});
|
|
|
|
types.Vote = (function(Vote) {
|
|
|
|
/**
|
|
* Properties of a Vote.
|
|
* @memberof tendermint.types
|
|
* @interface IVote
|
|
* @property {tendermint.types.SignedMsgType|null} [type] Vote type
|
|
* @property {number|Long|null} [height] Vote height
|
|
* @property {number|null} [round] Vote round
|
|
* @property {tendermint.types.IBlockID|null} [blockId] Vote blockId
|
|
* @property {google.protobuf.ITimestamp|null} [timestamp] Vote timestamp
|
|
* @property {Uint8Array|null} [validatorAddress] Vote validatorAddress
|
|
* @property {number|null} [validatorIndex] Vote validatorIndex
|
|
* @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 {number|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 blockId.
|
|
* @member {tendermint.types.IBlockID|null|undefined} blockId
|
|
* @memberof tendermint.types.Vote
|
|
* @instance
|
|
*/
|
|
Vote.prototype.blockId = null;
|
|
|
|
/**
|
|
* Vote timestamp.
|
|
* @member {google.protobuf.ITimestamp|null|undefined} timestamp
|
|
* @memberof tendermint.types.Vote
|
|
* @instance
|
|
*/
|
|
Vote.prototype.timestamp = null;
|
|
|
|
/**
|
|
* Vote validatorAddress.
|
|
* @member {Uint8Array} validatorAddress
|
|
* @memberof tendermint.types.Vote
|
|
* @instance
|
|
*/
|
|
Vote.prototype.validatorAddress = $util.newBuffer([]);
|
|
|
|
/**
|
|
* Vote validatorIndex.
|
|
* @member {number} validatorIndex
|
|
* @memberof tendermint.types.Vote
|
|
* @instance
|
|
*/
|
|
Vote.prototype.validatorIndex = 0;
|
|
|
|
/**
|
|
* Vote signature.
|
|
* @member {Uint8Array} signature
|
|
* @memberof tendermint.types.Vote
|
|
* @instance
|
|
*/
|
|
Vote.prototype.signature = $util.newBuffer([]);
|
|
|
|
/**
|
|
* Creates a new Vote instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.Vote
|
|
* @static
|
|
* @param {tendermint.types.IVote=} [properties] Properties to set
|
|
* @returns {tendermint.types.Vote} Vote instance
|
|
*/
|
|
Vote.create = function create(properties) {
|
|
return new Vote(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.blockId != null && Object.hasOwnProperty.call(message, "blockId"))
|
|
$root.tendermint.types.BlockID.encode(message.blockId, 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.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress"))
|
|
writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.validatorAddress);
|
|
if (message.validatorIndex != null && Object.hasOwnProperty.call(message, "validatorIndex"))
|
|
writer.uint32(/* id 7, wireType 0 =*/56).int32(message.validatorIndex);
|
|
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.blockId = $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.validatorAddress = reader.bytes();
|
|
break;
|
|
case 7:
|
|
message.validatorIndex = 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.<string,*>} 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.blockId != null && message.hasOwnProperty("blockId")) {
|
|
var error = $root.tendermint.types.BlockID.verify(message.blockId);
|
|
if (error)
|
|
return "blockId." + error;
|
|
}
|
|
if (message.timestamp != null && message.hasOwnProperty("timestamp")) {
|
|
var error = $root.google.protobuf.Timestamp.verify(message.timestamp);
|
|
if (error)
|
|
return "timestamp." + error;
|
|
}
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
if (!(message.validatorAddress && typeof message.validatorAddress.length === "number" || $util.isString(message.validatorAddress)))
|
|
return "validatorAddress: buffer expected";
|
|
if (message.validatorIndex != null && message.hasOwnProperty("validatorIndex"))
|
|
if (!$util.isInteger(message.validatorIndex))
|
|
return "validatorIndex: 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.<string,*>} 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.blockId != null) {
|
|
if (typeof object.blockId !== "object")
|
|
throw TypeError(".tendermint.types.Vote.blockId: object expected");
|
|
message.blockId = $root.tendermint.types.BlockID.fromObject(object.blockId);
|
|
}
|
|
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.validatorAddress != null)
|
|
if (typeof object.validatorAddress === "string")
|
|
$util.base64.decode(object.validatorAddress, message.validatorAddress = $util.newBuffer($util.base64.length(object.validatorAddress)), 0);
|
|
else if (object.validatorAddress.length)
|
|
message.validatorAddress = object.validatorAddress;
|
|
if (object.validatorIndex != null)
|
|
message.validatorIndex = object.validatorIndex | 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.<string,*>} 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.blockId = null;
|
|
object.timestamp = null;
|
|
if (options.bytes === String)
|
|
object.validatorAddress = "";
|
|
else {
|
|
object.validatorAddress = [];
|
|
if (options.bytes !== Array)
|
|
object.validatorAddress = $util.newBuffer(object.validatorAddress);
|
|
}
|
|
object.validatorIndex = 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.blockId != null && message.hasOwnProperty("blockId"))
|
|
object.blockId = $root.tendermint.types.BlockID.toObject(message.blockId, options);
|
|
if (message.timestamp != null && message.hasOwnProperty("timestamp"))
|
|
object.timestamp = $root.google.protobuf.Timestamp.toObject(message.timestamp, options);
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
object.validatorAddress = options.bytes === String ? $util.base64.encode(message.validatorAddress, 0, message.validatorAddress.length) : options.bytes === Array ? Array.prototype.slice.call(message.validatorAddress) : message.validatorAddress;
|
|
if (message.validatorIndex != null && message.hasOwnProperty("validatorIndex"))
|
|
object.validatorIndex = message.validatorIndex;
|
|
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.<string,*>} JSON object
|
|
*/
|
|
Vote.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Vote;
|
|
})(types.Vote || {});
|
|
|
|
types.Commit = (function(Commit) {
|
|
|
|
/**
|
|
* Properties of a Commit.
|
|
* @memberof tendermint.types
|
|
* @interface ICommit
|
|
* @property {number|Long|null} [height] Commit height
|
|
* @property {number|null} [round] Commit round
|
|
* @property {tendermint.types.IBlockID|null} [blockId] Commit blockId
|
|
* @property {Array.<tendermint.types.ICommitSig>|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 {number|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 blockId.
|
|
* @member {tendermint.types.IBlockID|null|undefined} blockId
|
|
* @memberof tendermint.types.Commit
|
|
* @instance
|
|
*/
|
|
Commit.prototype.blockId = null;
|
|
|
|
/**
|
|
* Commit signatures.
|
|
* @member {Array.<tendermint.types.ICommitSig>} signatures
|
|
* @memberof tendermint.types.Commit
|
|
* @instance
|
|
*/
|
|
Commit.prototype.signatures = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new Commit instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.Commit
|
|
* @static
|
|
* @param {tendermint.types.ICommit=} [properties] Properties to set
|
|
* @returns {tendermint.types.Commit} Commit instance
|
|
*/
|
|
Commit.create = function create(properties) {
|
|
return new Commit(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.blockId != null && Object.hasOwnProperty.call(message, "blockId"))
|
|
$root.tendermint.types.BlockID.encode(message.blockId, 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.blockId = $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.<string,*>} 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.blockId != null && message.hasOwnProperty("blockId")) {
|
|
var error = $root.tendermint.types.BlockID.verify(message.blockId);
|
|
if (error)
|
|
return "blockId." + 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.<string,*>} 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.blockId != null) {
|
|
if (typeof object.blockId !== "object")
|
|
throw TypeError(".tendermint.types.Commit.blockId: object expected");
|
|
message.blockId = $root.tendermint.types.BlockID.fromObject(object.blockId);
|
|
}
|
|
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.<string,*>} 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.blockId = 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.blockId != null && message.hasOwnProperty("blockId"))
|
|
object.blockId = $root.tendermint.types.BlockID.toObject(message.blockId, 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.<string,*>} JSON object
|
|
*/
|
|
Commit.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Commit;
|
|
})(types.Commit || {});
|
|
|
|
types.CommitSig = (function(CommitSig) {
|
|
|
|
/**
|
|
* Properties of a CommitSig.
|
|
* @memberof tendermint.types
|
|
* @interface ICommitSig
|
|
* @property {tendermint.types.BlockIDFlag|null} [blockIdFlag] CommitSig blockIdFlag
|
|
* @property {Uint8Array|null} [validatorAddress] CommitSig validatorAddress
|
|
* @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 blockIdFlag.
|
|
* @member {tendermint.types.BlockIDFlag} blockIdFlag
|
|
* @memberof tendermint.types.CommitSig
|
|
* @instance
|
|
*/
|
|
CommitSig.prototype.blockIdFlag = 0;
|
|
|
|
/**
|
|
* CommitSig validatorAddress.
|
|
* @member {Uint8Array} validatorAddress
|
|
* @memberof tendermint.types.CommitSig
|
|
* @instance
|
|
*/
|
|
CommitSig.prototype.validatorAddress = $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([]);
|
|
|
|
/**
|
|
* Creates a new CommitSig instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.CommitSig
|
|
* @static
|
|
* @param {tendermint.types.ICommitSig=} [properties] Properties to set
|
|
* @returns {tendermint.types.CommitSig} CommitSig instance
|
|
*/
|
|
CommitSig.create = function create(properties) {
|
|
return new CommitSig(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.blockIdFlag != null && Object.hasOwnProperty.call(message, "blockIdFlag"))
|
|
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.blockIdFlag);
|
|
if (message.validatorAddress != null && Object.hasOwnProperty.call(message, "validatorAddress"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.validatorAddress);
|
|
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.blockIdFlag = reader.int32();
|
|
break;
|
|
case 2:
|
|
message.validatorAddress = 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.<string,*>} 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.blockIdFlag != null && message.hasOwnProperty("blockIdFlag"))
|
|
switch (message.blockIdFlag) {
|
|
default:
|
|
return "blockIdFlag: enum value expected";
|
|
case 0:
|
|
case 1:
|
|
case 2:
|
|
case 3:
|
|
break;
|
|
}
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
if (!(message.validatorAddress && typeof message.validatorAddress.length === "number" || $util.isString(message.validatorAddress)))
|
|
return "validatorAddress: 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.<string,*>} 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.blockIdFlag) {
|
|
case "BLOCK_ID_FLAG_UNKNOWN":
|
|
case 0:
|
|
message.blockIdFlag = 0;
|
|
break;
|
|
case "BLOCK_ID_FLAG_ABSENT":
|
|
case 1:
|
|
message.blockIdFlag = 1;
|
|
break;
|
|
case "BLOCK_ID_FLAG_COMMIT":
|
|
case 2:
|
|
message.blockIdFlag = 2;
|
|
break;
|
|
case "BLOCK_ID_FLAG_NIL":
|
|
case 3:
|
|
message.blockIdFlag = 3;
|
|
break;
|
|
}
|
|
if (object.validatorAddress != null)
|
|
if (typeof object.validatorAddress === "string")
|
|
$util.base64.decode(object.validatorAddress, message.validatorAddress = $util.newBuffer($util.base64.length(object.validatorAddress)), 0);
|
|
else if (object.validatorAddress.length)
|
|
message.validatorAddress = object.validatorAddress;
|
|
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.<string,*>} Plain object
|
|
*/
|
|
CommitSig.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.blockIdFlag = options.enums === String ? "BLOCK_ID_FLAG_UNKNOWN" : 0;
|
|
if (options.bytes === String)
|
|
object.validatorAddress = "";
|
|
else {
|
|
object.validatorAddress = [];
|
|
if (options.bytes !== Array)
|
|
object.validatorAddress = $util.newBuffer(object.validatorAddress);
|
|
}
|
|
object.timestamp = null;
|
|
if (options.bytes === String)
|
|
object.signature = "";
|
|
else {
|
|
object.signature = [];
|
|
if (options.bytes !== Array)
|
|
object.signature = $util.newBuffer(object.signature);
|
|
}
|
|
}
|
|
if (message.blockIdFlag != null && message.hasOwnProperty("blockIdFlag"))
|
|
object.blockIdFlag = options.enums === String ? $root.tendermint.types.BlockIDFlag[message.blockIdFlag] : message.blockIdFlag;
|
|
if (message.validatorAddress != null && message.hasOwnProperty("validatorAddress"))
|
|
object.validatorAddress = options.bytes === String ? $util.base64.encode(message.validatorAddress, 0, message.validatorAddress.length) : options.bytes === Array ? Array.prototype.slice.call(message.validatorAddress) : message.validatorAddress;
|
|
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.<string,*>} JSON object
|
|
*/
|
|
CommitSig.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return CommitSig;
|
|
})(types.CommitSig || {});
|
|
|
|
types.Proposal = (function(Proposal) {
|
|
|
|
/**
|
|
* Properties of a Proposal.
|
|
* @memberof tendermint.types
|
|
* @interface IProposal
|
|
* @property {tendermint.types.SignedMsgType|null} [type] Proposal type
|
|
* @property {number|Long|null} [height] Proposal height
|
|
* @property {number|null} [round] Proposal round
|
|
* @property {number|null} [polRound] Proposal polRound
|
|
* @property {tendermint.types.IBlockID|null} [blockId] Proposal blockId
|
|
* @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 {number|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 polRound.
|
|
* @member {number} polRound
|
|
* @memberof tendermint.types.Proposal
|
|
* @instance
|
|
*/
|
|
Proposal.prototype.polRound = 0;
|
|
|
|
/**
|
|
* Proposal blockId.
|
|
* @member {tendermint.types.IBlockID|null|undefined} blockId
|
|
* @memberof tendermint.types.Proposal
|
|
* @instance
|
|
*/
|
|
Proposal.prototype.blockId = 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([]);
|
|
|
|
/**
|
|
* Creates a new Proposal instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.Proposal
|
|
* @static
|
|
* @param {tendermint.types.IProposal=} [properties] Properties to set
|
|
* @returns {tendermint.types.Proposal} Proposal instance
|
|
*/
|
|
Proposal.create = function create(properties) {
|
|
return new Proposal(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.polRound != null && Object.hasOwnProperty.call(message, "polRound"))
|
|
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.polRound);
|
|
if (message.blockId != null && Object.hasOwnProperty.call(message, "blockId"))
|
|
$root.tendermint.types.BlockID.encode(message.blockId, 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.polRound = reader.int32();
|
|
break;
|
|
case 5:
|
|
message.blockId = $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.<string,*>} 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.polRound != null && message.hasOwnProperty("polRound"))
|
|
if (!$util.isInteger(message.polRound))
|
|
return "polRound: integer expected";
|
|
if (message.blockId != null && message.hasOwnProperty("blockId")) {
|
|
var error = $root.tendermint.types.BlockID.verify(message.blockId);
|
|
if (error)
|
|
return "blockId." + 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.<string,*>} 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.polRound != null)
|
|
message.polRound = object.polRound | 0;
|
|
if (object.blockId != null) {
|
|
if (typeof object.blockId !== "object")
|
|
throw TypeError(".tendermint.types.Proposal.blockId: object expected");
|
|
message.blockId = $root.tendermint.types.BlockID.fromObject(object.blockId);
|
|
}
|
|
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.<string,*>} 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.polRound = 0;
|
|
object.blockId = 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.polRound != null && message.hasOwnProperty("polRound"))
|
|
object.polRound = message.polRound;
|
|
if (message.blockId != null && message.hasOwnProperty("blockId"))
|
|
object.blockId = $root.tendermint.types.BlockID.toObject(message.blockId, 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.<string,*>} JSON object
|
|
*/
|
|
Proposal.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Proposal;
|
|
})(types.Proposal || {});
|
|
|
|
types.SignedHeader = (function(SignedHeader) {
|
|
|
|
/**
|
|
* 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;
|
|
|
|
/**
|
|
* Creates a new SignedHeader instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.SignedHeader
|
|
* @static
|
|
* @param {tendermint.types.ISignedHeader=} [properties] Properties to set
|
|
* @returns {tendermint.types.SignedHeader} SignedHeader instance
|
|
*/
|
|
SignedHeader.create = function create(properties) {
|
|
return new SignedHeader(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
SignedHeader.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return SignedHeader;
|
|
})(types.SignedHeader || {});
|
|
|
|
types.LightBlock = (function(LightBlock) {
|
|
|
|
/**
|
|
* Properties of a LightBlock.
|
|
* @memberof tendermint.types
|
|
* @interface ILightBlock
|
|
* @property {tendermint.types.ISignedHeader|null} [signedHeader] LightBlock signedHeader
|
|
* @property {tendermint.types.IValidatorSet|null} [validatorSet] LightBlock validatorSet
|
|
*/
|
|
|
|
/**
|
|
* 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 signedHeader.
|
|
* @member {tendermint.types.ISignedHeader|null|undefined} signedHeader
|
|
* @memberof tendermint.types.LightBlock
|
|
* @instance
|
|
*/
|
|
LightBlock.prototype.signedHeader = null;
|
|
|
|
/**
|
|
* LightBlock validatorSet.
|
|
* @member {tendermint.types.IValidatorSet|null|undefined} validatorSet
|
|
* @memberof tendermint.types.LightBlock
|
|
* @instance
|
|
*/
|
|
LightBlock.prototype.validatorSet = null;
|
|
|
|
/**
|
|
* Creates a new LightBlock instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.LightBlock
|
|
* @static
|
|
* @param {tendermint.types.ILightBlock=} [properties] Properties to set
|
|
* @returns {tendermint.types.LightBlock} LightBlock instance
|
|
*/
|
|
LightBlock.create = function create(properties) {
|
|
return new LightBlock(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.signedHeader != null && Object.hasOwnProperty.call(message, "signedHeader"))
|
|
$root.tendermint.types.SignedHeader.encode(message.signedHeader, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.validatorSet != null && Object.hasOwnProperty.call(message, "validatorSet"))
|
|
$root.tendermint.types.ValidatorSet.encode(message.validatorSet, 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.signedHeader = $root.tendermint.types.SignedHeader.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
message.validatorSet = $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.<string,*>} 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.signedHeader != null && message.hasOwnProperty("signedHeader")) {
|
|
var error = $root.tendermint.types.SignedHeader.verify(message.signedHeader);
|
|
if (error)
|
|
return "signedHeader." + error;
|
|
}
|
|
if (message.validatorSet != null && message.hasOwnProperty("validatorSet")) {
|
|
var error = $root.tendermint.types.ValidatorSet.verify(message.validatorSet);
|
|
if (error)
|
|
return "validatorSet." + 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.<string,*>} 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.signedHeader != null) {
|
|
if (typeof object.signedHeader !== "object")
|
|
throw TypeError(".tendermint.types.LightBlock.signedHeader: object expected");
|
|
message.signedHeader = $root.tendermint.types.SignedHeader.fromObject(object.signedHeader);
|
|
}
|
|
if (object.validatorSet != null) {
|
|
if (typeof object.validatorSet !== "object")
|
|
throw TypeError(".tendermint.types.LightBlock.validatorSet: object expected");
|
|
message.validatorSet = $root.tendermint.types.ValidatorSet.fromObject(object.validatorSet);
|
|
}
|
|
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.<string,*>} Plain object
|
|
*/
|
|
LightBlock.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.signedHeader = null;
|
|
object.validatorSet = null;
|
|
}
|
|
if (message.signedHeader != null && message.hasOwnProperty("signedHeader"))
|
|
object.signedHeader = $root.tendermint.types.SignedHeader.toObject(message.signedHeader, options);
|
|
if (message.validatorSet != null && message.hasOwnProperty("validatorSet"))
|
|
object.validatorSet = $root.tendermint.types.ValidatorSet.toObject(message.validatorSet, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this LightBlock to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.types.LightBlock
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
LightBlock.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return LightBlock;
|
|
})(types.LightBlock || {});
|
|
|
|
types.BlockMeta = (function(BlockMeta) {
|
|
|
|
/**
|
|
* Properties of a BlockMeta.
|
|
* @memberof tendermint.types
|
|
* @interface IBlockMeta
|
|
* @property {tendermint.types.IBlockID|null} [blockId] BlockMeta blockId
|
|
* @property {number|Long|null} [blockSize] BlockMeta blockSize
|
|
* @property {tendermint.types.IHeader|null} [header] BlockMeta header
|
|
* @property {number|Long|null} [numTxs] BlockMeta numTxs
|
|
*/
|
|
|
|
/**
|
|
* 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 blockId.
|
|
* @member {tendermint.types.IBlockID|null|undefined} blockId
|
|
* @memberof tendermint.types.BlockMeta
|
|
* @instance
|
|
*/
|
|
BlockMeta.prototype.blockId = null;
|
|
|
|
/**
|
|
* BlockMeta blockSize.
|
|
* @member {number|Long} blockSize
|
|
* @memberof tendermint.types.BlockMeta
|
|
* @instance
|
|
*/
|
|
BlockMeta.prototype.blockSize = $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 numTxs.
|
|
* @member {number|Long} numTxs
|
|
* @memberof tendermint.types.BlockMeta
|
|
* @instance
|
|
*/
|
|
BlockMeta.prototype.numTxs = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* Creates a new BlockMeta instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.BlockMeta
|
|
* @static
|
|
* @param {tendermint.types.IBlockMeta=} [properties] Properties to set
|
|
* @returns {tendermint.types.BlockMeta} BlockMeta instance
|
|
*/
|
|
BlockMeta.create = function create(properties) {
|
|
return new BlockMeta(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.blockId != null && Object.hasOwnProperty.call(message, "blockId"))
|
|
$root.tendermint.types.BlockID.encode(message.blockId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.blockSize != null && Object.hasOwnProperty.call(message, "blockSize"))
|
|
writer.uint32(/* id 2, wireType 0 =*/16).int64(message.blockSize);
|
|
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.numTxs != null && Object.hasOwnProperty.call(message, "numTxs"))
|
|
writer.uint32(/* id 4, wireType 0 =*/32).int64(message.numTxs);
|
|
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.blockId = $root.tendermint.types.BlockID.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
message.blockSize = reader.int64();
|
|
break;
|
|
case 3:
|
|
message.header = $root.tendermint.types.Header.decode(reader, reader.uint32());
|
|
break;
|
|
case 4:
|
|
message.numTxs = 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.<string,*>} 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.blockId != null && message.hasOwnProperty("blockId")) {
|
|
var error = $root.tendermint.types.BlockID.verify(message.blockId);
|
|
if (error)
|
|
return "blockId." + error;
|
|
}
|
|
if (message.blockSize != null && message.hasOwnProperty("blockSize"))
|
|
if (!$util.isInteger(message.blockSize) && !(message.blockSize && $util.isInteger(message.blockSize.low) && $util.isInteger(message.blockSize.high)))
|
|
return "blockSize: 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.numTxs != null && message.hasOwnProperty("numTxs"))
|
|
if (!$util.isInteger(message.numTxs) && !(message.numTxs && $util.isInteger(message.numTxs.low) && $util.isInteger(message.numTxs.high)))
|
|
return "numTxs: 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.<string,*>} 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.blockId != null) {
|
|
if (typeof object.blockId !== "object")
|
|
throw TypeError(".tendermint.types.BlockMeta.blockId: object expected");
|
|
message.blockId = $root.tendermint.types.BlockID.fromObject(object.blockId);
|
|
}
|
|
if (object.blockSize != null)
|
|
if ($util.Long)
|
|
(message.blockSize = $util.Long.fromValue(object.blockSize)).unsigned = false;
|
|
else if (typeof object.blockSize === "string")
|
|
message.blockSize = parseInt(object.blockSize, 10);
|
|
else if (typeof object.blockSize === "number")
|
|
message.blockSize = object.blockSize;
|
|
else if (typeof object.blockSize === "object")
|
|
message.blockSize = new $util.LongBits(object.blockSize.low >>> 0, object.blockSize.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.numTxs != null)
|
|
if ($util.Long)
|
|
(message.numTxs = $util.Long.fromValue(object.numTxs)).unsigned = false;
|
|
else if (typeof object.numTxs === "string")
|
|
message.numTxs = parseInt(object.numTxs, 10);
|
|
else if (typeof object.numTxs === "number")
|
|
message.numTxs = object.numTxs;
|
|
else if (typeof object.numTxs === "object")
|
|
message.numTxs = new $util.LongBits(object.numTxs.low >>> 0, object.numTxs.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.<string,*>} Plain object
|
|
*/
|
|
BlockMeta.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.blockId = null;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.blockSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.blockSize = options.longs === String ? "0" : 0;
|
|
object.header = null;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.numTxs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.numTxs = options.longs === String ? "0" : 0;
|
|
}
|
|
if (message.blockId != null && message.hasOwnProperty("blockId"))
|
|
object.blockId = $root.tendermint.types.BlockID.toObject(message.blockId, options);
|
|
if (message.blockSize != null && message.hasOwnProperty("blockSize"))
|
|
if (typeof message.blockSize === "number")
|
|
object.blockSize = options.longs === String ? String(message.blockSize) : message.blockSize;
|
|
else
|
|
object.blockSize = options.longs === String ? $util.Long.prototype.toString.call(message.blockSize) : options.longs === Number ? new $util.LongBits(message.blockSize.low >>> 0, message.blockSize.high >>> 0).toNumber() : message.blockSize;
|
|
if (message.header != null && message.hasOwnProperty("header"))
|
|
object.header = $root.tendermint.types.Header.toObject(message.header, options);
|
|
if (message.numTxs != null && message.hasOwnProperty("numTxs"))
|
|
if (typeof message.numTxs === "number")
|
|
object.numTxs = options.longs === String ? String(message.numTxs) : message.numTxs;
|
|
else
|
|
object.numTxs = options.longs === String ? $util.Long.prototype.toString.call(message.numTxs) : options.longs === Number ? new $util.LongBits(message.numTxs.low >>> 0, message.numTxs.high >>> 0).toNumber() : message.numTxs;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this BlockMeta to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.types.BlockMeta
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
BlockMeta.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return BlockMeta;
|
|
})(types.BlockMeta || {});
|
|
|
|
types.TxProof = (function(TxProof) {
|
|
|
|
/**
|
|
* Properties of a TxProof.
|
|
* @memberof tendermint.types
|
|
* @interface ITxProof
|
|
* @property {Uint8Array|null} [rootHash] TxProof rootHash
|
|
* @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 rootHash.
|
|
* @member {Uint8Array} rootHash
|
|
* @memberof tendermint.types.TxProof
|
|
* @instance
|
|
*/
|
|
TxProof.prototype.rootHash = $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;
|
|
|
|
/**
|
|
* Creates a new TxProof instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.TxProof
|
|
* @static
|
|
* @param {tendermint.types.ITxProof=} [properties] Properties to set
|
|
* @returns {tendermint.types.TxProof} TxProof instance
|
|
*/
|
|
TxProof.create = function create(properties) {
|
|
return new TxProof(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.rootHash != null && Object.hasOwnProperty.call(message, "rootHash"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.rootHash);
|
|
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.rootHash = 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.<string,*>} 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.rootHash != null && message.hasOwnProperty("rootHash"))
|
|
if (!(message.rootHash && typeof message.rootHash.length === "number" || $util.isString(message.rootHash)))
|
|
return "rootHash: 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.<string,*>} 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.rootHash != null)
|
|
if (typeof object.rootHash === "string")
|
|
$util.base64.decode(object.rootHash, message.rootHash = $util.newBuffer($util.base64.length(object.rootHash)), 0);
|
|
else if (object.rootHash.length)
|
|
message.rootHash = object.rootHash;
|
|
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.<string,*>} Plain object
|
|
*/
|
|
TxProof.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
if (options.bytes === String)
|
|
object.rootHash = "";
|
|
else {
|
|
object.rootHash = [];
|
|
if (options.bytes !== Array)
|
|
object.rootHash = $util.newBuffer(object.rootHash);
|
|
}
|
|
if (options.bytes === String)
|
|
object.data = "";
|
|
else {
|
|
object.data = [];
|
|
if (options.bytes !== Array)
|
|
object.data = $util.newBuffer(object.data);
|
|
}
|
|
object.proof = null;
|
|
}
|
|
if (message.rootHash != null && message.hasOwnProperty("rootHash"))
|
|
object.rootHash = options.bytes === String ? $util.base64.encode(message.rootHash, 0, message.rootHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.rootHash) : message.rootHash;
|
|
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.<string,*>} JSON object
|
|
*/
|
|
TxProof.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return TxProof;
|
|
})(types.TxProof || {});
|
|
|
|
types.ValidatorSet = (function(ValidatorSet) {
|
|
|
|
/**
|
|
* Properties of a ValidatorSet.
|
|
* @memberof tendermint.types
|
|
* @interface IValidatorSet
|
|
* @property {Array.<tendermint.types.IValidator>|null} [validators] ValidatorSet validators
|
|
* @property {tendermint.types.IValidator|null} [proposer] ValidatorSet proposer
|
|
* @property {number|Long|null} [totalVotingPower] ValidatorSet totalVotingPower
|
|
*/
|
|
|
|
/**
|
|
* 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.<tendermint.types.IValidator>} 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 totalVotingPower.
|
|
* @member {number|Long} totalVotingPower
|
|
* @memberof tendermint.types.ValidatorSet
|
|
* @instance
|
|
*/
|
|
ValidatorSet.prototype.totalVotingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* Creates a new ValidatorSet instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.ValidatorSet
|
|
* @static
|
|
* @param {tendermint.types.IValidatorSet=} [properties] Properties to set
|
|
* @returns {tendermint.types.ValidatorSet} ValidatorSet instance
|
|
*/
|
|
ValidatorSet.create = function create(properties) {
|
|
return new ValidatorSet(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.totalVotingPower != null && Object.hasOwnProperty.call(message, "totalVotingPower"))
|
|
writer.uint32(/* id 3, wireType 0 =*/24).int64(message.totalVotingPower);
|
|
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.totalVotingPower = 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.<string,*>} 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.totalVotingPower != null && message.hasOwnProperty("totalVotingPower"))
|
|
if (!$util.isInteger(message.totalVotingPower) && !(message.totalVotingPower && $util.isInteger(message.totalVotingPower.low) && $util.isInteger(message.totalVotingPower.high)))
|
|
return "totalVotingPower: 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.<string,*>} 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.totalVotingPower != null)
|
|
if ($util.Long)
|
|
(message.totalVotingPower = $util.Long.fromValue(object.totalVotingPower)).unsigned = false;
|
|
else if (typeof object.totalVotingPower === "string")
|
|
message.totalVotingPower = parseInt(object.totalVotingPower, 10);
|
|
else if (typeof object.totalVotingPower === "number")
|
|
message.totalVotingPower = object.totalVotingPower;
|
|
else if (typeof object.totalVotingPower === "object")
|
|
message.totalVotingPower = new $util.LongBits(object.totalVotingPower.low >>> 0, object.totalVotingPower.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.<string,*>} 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.totalVotingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.totalVotingPower = 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.totalVotingPower != null && message.hasOwnProperty("totalVotingPower"))
|
|
if (typeof message.totalVotingPower === "number")
|
|
object.totalVotingPower = options.longs === String ? String(message.totalVotingPower) : message.totalVotingPower;
|
|
else
|
|
object.totalVotingPower = options.longs === String ? $util.Long.prototype.toString.call(message.totalVotingPower) : options.longs === Number ? new $util.LongBits(message.totalVotingPower.low >>> 0, message.totalVotingPower.high >>> 0).toNumber() : message.totalVotingPower;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this ValidatorSet to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.types.ValidatorSet
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
ValidatorSet.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ValidatorSet;
|
|
})(types.ValidatorSet || {});
|
|
|
|
types.Validator = (function(Validator) {
|
|
|
|
/**
|
|
* Properties of a Validator.
|
|
* @memberof tendermint.types
|
|
* @interface IValidator
|
|
* @property {Uint8Array|null} [address] Validator address
|
|
* @property {tendermint.crypto.IPublicKey|null} [pubKey] Validator pubKey
|
|
* @property {number|Long|null} [votingPower] Validator votingPower
|
|
* @property {number|Long|null} [proposerPriority] Validator proposerPriority
|
|
*/
|
|
|
|
/**
|
|
* 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 pubKey.
|
|
* @member {tendermint.crypto.IPublicKey|null|undefined} pubKey
|
|
* @memberof tendermint.types.Validator
|
|
* @instance
|
|
*/
|
|
Validator.prototype.pubKey = null;
|
|
|
|
/**
|
|
* Validator votingPower.
|
|
* @member {number|Long} votingPower
|
|
* @memberof tendermint.types.Validator
|
|
* @instance
|
|
*/
|
|
Validator.prototype.votingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* Validator proposerPriority.
|
|
* @member {number|Long} proposerPriority
|
|
* @memberof tendermint.types.Validator
|
|
* @instance
|
|
*/
|
|
Validator.prototype.proposerPriority = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* Creates a new Validator instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.Validator
|
|
* @static
|
|
* @param {tendermint.types.IValidator=} [properties] Properties to set
|
|
* @returns {tendermint.types.Validator} Validator instance
|
|
*/
|
|
Validator.create = function create(properties) {
|
|
return new Validator(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.pubKey != null && Object.hasOwnProperty.call(message, "pubKey"))
|
|
$root.tendermint.crypto.PublicKey.encode(message.pubKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
if (message.votingPower != null && Object.hasOwnProperty.call(message, "votingPower"))
|
|
writer.uint32(/* id 3, wireType 0 =*/24).int64(message.votingPower);
|
|
if (message.proposerPriority != null && Object.hasOwnProperty.call(message, "proposerPriority"))
|
|
writer.uint32(/* id 4, wireType 0 =*/32).int64(message.proposerPriority);
|
|
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.pubKey = $root.tendermint.crypto.PublicKey.decode(reader, reader.uint32());
|
|
break;
|
|
case 3:
|
|
message.votingPower = reader.int64();
|
|
break;
|
|
case 4:
|
|
message.proposerPriority = 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.<string,*>} 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.pubKey != null && message.hasOwnProperty("pubKey")) {
|
|
var error = $root.tendermint.crypto.PublicKey.verify(message.pubKey);
|
|
if (error)
|
|
return "pubKey." + error;
|
|
}
|
|
if (message.votingPower != null && message.hasOwnProperty("votingPower"))
|
|
if (!$util.isInteger(message.votingPower) && !(message.votingPower && $util.isInteger(message.votingPower.low) && $util.isInteger(message.votingPower.high)))
|
|
return "votingPower: integer|Long expected";
|
|
if (message.proposerPriority != null && message.hasOwnProperty("proposerPriority"))
|
|
if (!$util.isInteger(message.proposerPriority) && !(message.proposerPriority && $util.isInteger(message.proposerPriority.low) && $util.isInteger(message.proposerPriority.high)))
|
|
return "proposerPriority: 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.<string,*>} 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.pubKey != null) {
|
|
if (typeof object.pubKey !== "object")
|
|
throw TypeError(".tendermint.types.Validator.pubKey: object expected");
|
|
message.pubKey = $root.tendermint.crypto.PublicKey.fromObject(object.pubKey);
|
|
}
|
|
if (object.votingPower != null)
|
|
if ($util.Long)
|
|
(message.votingPower = $util.Long.fromValue(object.votingPower)).unsigned = false;
|
|
else if (typeof object.votingPower === "string")
|
|
message.votingPower = parseInt(object.votingPower, 10);
|
|
else if (typeof object.votingPower === "number")
|
|
message.votingPower = object.votingPower;
|
|
else if (typeof object.votingPower === "object")
|
|
message.votingPower = new $util.LongBits(object.votingPower.low >>> 0, object.votingPower.high >>> 0).toNumber();
|
|
if (object.proposerPriority != null)
|
|
if ($util.Long)
|
|
(message.proposerPriority = $util.Long.fromValue(object.proposerPriority)).unsigned = false;
|
|
else if (typeof object.proposerPriority === "string")
|
|
message.proposerPriority = parseInt(object.proposerPriority, 10);
|
|
else if (typeof object.proposerPriority === "number")
|
|
message.proposerPriority = object.proposerPriority;
|
|
else if (typeof object.proposerPriority === "object")
|
|
message.proposerPriority = new $util.LongBits(object.proposerPriority.low >>> 0, object.proposerPriority.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.<string,*>} 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.pubKey = null;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.votingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.votingPower = options.longs === String ? "0" : 0;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.proposerPriority = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.proposerPriority = 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.pubKey != null && message.hasOwnProperty("pubKey"))
|
|
object.pubKey = $root.tendermint.crypto.PublicKey.toObject(message.pubKey, options);
|
|
if (message.votingPower != null && message.hasOwnProperty("votingPower"))
|
|
if (typeof message.votingPower === "number")
|
|
object.votingPower = options.longs === String ? String(message.votingPower) : message.votingPower;
|
|
else
|
|
object.votingPower = options.longs === String ? $util.Long.prototype.toString.call(message.votingPower) : options.longs === Number ? new $util.LongBits(message.votingPower.low >>> 0, message.votingPower.high >>> 0).toNumber() : message.votingPower;
|
|
if (message.proposerPriority != null && message.hasOwnProperty("proposerPriority"))
|
|
if (typeof message.proposerPriority === "number")
|
|
object.proposerPriority = options.longs === String ? String(message.proposerPriority) : message.proposerPriority;
|
|
else
|
|
object.proposerPriority = options.longs === String ? $util.Long.prototype.toString.call(message.proposerPriority) : options.longs === Number ? new $util.LongBits(message.proposerPriority.low >>> 0, message.proposerPriority.high >>> 0).toNumber() : message.proposerPriority;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Validator to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.types.Validator
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Validator.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Validator;
|
|
})(types.Validator || {});
|
|
|
|
types.SimpleValidator = (function(SimpleValidator) {
|
|
|
|
/**
|
|
* Properties of a SimpleValidator.
|
|
* @memberof tendermint.types
|
|
* @interface ISimpleValidator
|
|
* @property {tendermint.crypto.IPublicKey|null} [pubKey] SimpleValidator pubKey
|
|
* @property {number|Long|null} [votingPower] SimpleValidator votingPower
|
|
*/
|
|
|
|
/**
|
|
* 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 pubKey.
|
|
* @member {tendermint.crypto.IPublicKey|null|undefined} pubKey
|
|
* @memberof tendermint.types.SimpleValidator
|
|
* @instance
|
|
*/
|
|
SimpleValidator.prototype.pubKey = null;
|
|
|
|
/**
|
|
* SimpleValidator votingPower.
|
|
* @member {number|Long} votingPower
|
|
* @memberof tendermint.types.SimpleValidator
|
|
* @instance
|
|
*/
|
|
SimpleValidator.prototype.votingPower = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
|
|
/**
|
|
* Creates a new SimpleValidator instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.types.SimpleValidator
|
|
* @static
|
|
* @param {tendermint.types.ISimpleValidator=} [properties] Properties to set
|
|
* @returns {tendermint.types.SimpleValidator} SimpleValidator instance
|
|
*/
|
|
SimpleValidator.create = function create(properties) {
|
|
return new SimpleValidator(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.pubKey != null && Object.hasOwnProperty.call(message, "pubKey"))
|
|
$root.tendermint.crypto.PublicKey.encode(message.pubKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.votingPower != null && Object.hasOwnProperty.call(message, "votingPower"))
|
|
writer.uint32(/* id 2, wireType 0 =*/16).int64(message.votingPower);
|
|
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.pubKey = $root.tendermint.crypto.PublicKey.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
message.votingPower = 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.<string,*>} 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.pubKey != null && message.hasOwnProperty("pubKey")) {
|
|
var error = $root.tendermint.crypto.PublicKey.verify(message.pubKey);
|
|
if (error)
|
|
return "pubKey." + error;
|
|
}
|
|
if (message.votingPower != null && message.hasOwnProperty("votingPower"))
|
|
if (!$util.isInteger(message.votingPower) && !(message.votingPower && $util.isInteger(message.votingPower.low) && $util.isInteger(message.votingPower.high)))
|
|
return "votingPower: 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.<string,*>} 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.pubKey != null) {
|
|
if (typeof object.pubKey !== "object")
|
|
throw TypeError(".tendermint.types.SimpleValidator.pubKey: object expected");
|
|
message.pubKey = $root.tendermint.crypto.PublicKey.fromObject(object.pubKey);
|
|
}
|
|
if (object.votingPower != null)
|
|
if ($util.Long)
|
|
(message.votingPower = $util.Long.fromValue(object.votingPower)).unsigned = false;
|
|
else if (typeof object.votingPower === "string")
|
|
message.votingPower = parseInt(object.votingPower, 10);
|
|
else if (typeof object.votingPower === "number")
|
|
message.votingPower = object.votingPower;
|
|
else if (typeof object.votingPower === "object")
|
|
message.votingPower = new $util.LongBits(object.votingPower.low >>> 0, object.votingPower.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.<string,*>} Plain object
|
|
*/
|
|
SimpleValidator.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.pubKey = null;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, false);
|
|
object.votingPower = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.votingPower = options.longs === String ? "0" : 0;
|
|
}
|
|
if (message.pubKey != null && message.hasOwnProperty("pubKey"))
|
|
object.pubKey = $root.tendermint.crypto.PublicKey.toObject(message.pubKey, options);
|
|
if (message.votingPower != null && message.hasOwnProperty("votingPower"))
|
|
if (typeof message.votingPower === "number")
|
|
object.votingPower = options.longs === String ? String(message.votingPower) : message.votingPower;
|
|
else
|
|
object.votingPower = options.longs === String ? $util.Long.prototype.toString.call(message.votingPower) : options.longs === Number ? new $util.LongBits(message.votingPower.low >>> 0, message.votingPower.high >>> 0).toNumber() : message.votingPower;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this SimpleValidator to JSON.
|
|
* @function toJSON
|
|
* @memberof tendermint.types.SimpleValidator
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
SimpleValidator.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return SimpleValidator;
|
|
})(types.SimpleValidator || {});
|
|
|
|
return types;
|
|
})(tendermint.types || {});
|
|
|
|
/**
|
|
* Namespace version.
|
|
* @memberof tendermint
|
|
* @namespace
|
|
*/
|
|
|
|
tendermint.version = (function(version) {
|
|
|
|
version.App = (function(App) {
|
|
|
|
/**
|
|
* Properties of an App.
|
|
* @memberof tendermint.version
|
|
* @interface IApp
|
|
* @property {number|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 {number|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 = "";
|
|
|
|
/**
|
|
* Creates a new App instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.version.App
|
|
* @static
|
|
* @param {tendermint.version.IApp=} [properties] Properties to set
|
|
* @returns {tendermint.version.App} App instance
|
|
*/
|
|
App.create = function create(properties) {
|
|
return new App(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
App.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return App;
|
|
})(version.App || {});
|
|
|
|
version.Consensus = (function(Consensus) {
|
|
|
|
/**
|
|
* Properties of a Consensus.
|
|
* @memberof tendermint.version
|
|
* @interface IConsensus
|
|
* @property {number|Long|null} [block] Consensus block
|
|
* @property {number|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 {number|Long} block
|
|
* @memberof tendermint.version.Consensus
|
|
* @instance
|
|
*/
|
|
Consensus.prototype.block = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* Consensus app.
|
|
* @member {number|Long} app
|
|
* @memberof tendermint.version.Consensus
|
|
* @instance
|
|
*/
|
|
Consensus.prototype.app = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* Creates a new Consensus instance using the specified properties.
|
|
* @function create
|
|
* @memberof tendermint.version.Consensus
|
|
* @static
|
|
* @param {tendermint.version.IConsensus=} [properties] Properties to set
|
|
* @returns {tendermint.version.Consensus} Consensus instance
|
|
*/
|
|
Consensus.create = function create(properties) {
|
|
return new Consensus(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
Consensus.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Consensus;
|
|
})(version.Consensus || {});
|
|
|
|
return version;
|
|
})(tendermint.version || {});
|
|
|
|
return tendermint;
|
|
})($root.tendermint || {});
|
|
|
|
/**
|
|
* Namespace ibc.
|
|
* @exports ibc
|
|
* @namespace
|
|
*/
|
|
|
|
$root.ibc = (function(ibc) {
|
|
|
|
/**
|
|
* Namespace applications.
|
|
* @memberof ibc
|
|
* @namespace
|
|
*/
|
|
|
|
ibc.applications = (function(applications) {
|
|
|
|
/**
|
|
* Namespace transfer.
|
|
* @memberof ibc.applications
|
|
* @namespace
|
|
*/
|
|
|
|
applications.transfer = (function(transfer) {
|
|
|
|
/**
|
|
* Namespace v1.
|
|
* @memberof ibc.applications.transfer
|
|
* @namespace
|
|
*/
|
|
|
|
transfer.v1 = (function(v1) {
|
|
|
|
v1.Msg = (function(Msg) {
|
|
|
|
/**
|
|
* 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;
|
|
|
|
/**
|
|
* Creates new Msg service using the specified rpc implementation.
|
|
* @function create
|
|
* @memberof ibc.applications.transfer.v1.Msg
|
|
* @static
|
|
* @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
|
* @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
|
* @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
|
* @returns {Msg} RPC service. Useful where requests and/or responses are streamed.
|
|
*/
|
|
Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
|
return new this(rpcImpl, requestDelimited, responseDelimited);
|
|
};
|
|
|
|
/**
|
|
* 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.IMsgTransferResponse} [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<ibc.applications.transfer.v1.IMsgTransferResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
return Msg;
|
|
})(v1.Msg || {});
|
|
|
|
v1.MsgTransfer = (function(MsgTransfer) {
|
|
|
|
/**
|
|
* Properties of a MsgTransfer.
|
|
* @memberof ibc.applications.transfer.v1
|
|
* @interface IMsgTransfer
|
|
* @property {string|null} [sourcePort] MsgTransfer sourcePort
|
|
* @property {string|null} [sourceChannel] MsgTransfer sourceChannel
|
|
* @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} [timeoutHeight] MsgTransfer timeoutHeight
|
|
* @property {number|Long|null} [timeoutTimestamp] MsgTransfer timeoutTimestamp
|
|
*/
|
|
|
|
/**
|
|
* 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 sourcePort.
|
|
* @member {string} sourcePort
|
|
* @memberof ibc.applications.transfer.v1.MsgTransfer
|
|
* @instance
|
|
*/
|
|
MsgTransfer.prototype.sourcePort = "";
|
|
|
|
/**
|
|
* MsgTransfer sourceChannel.
|
|
* @member {string} sourceChannel
|
|
* @memberof ibc.applications.transfer.v1.MsgTransfer
|
|
* @instance
|
|
*/
|
|
MsgTransfer.prototype.sourceChannel = "";
|
|
|
|
/**
|
|
* 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 timeoutHeight.
|
|
* @member {ibc.core.client.v1.IHeight|null|undefined} timeoutHeight
|
|
* @memberof ibc.applications.transfer.v1.MsgTransfer
|
|
* @instance
|
|
*/
|
|
MsgTransfer.prototype.timeoutHeight = null;
|
|
|
|
/**
|
|
* MsgTransfer timeoutTimestamp.
|
|
* @member {number|Long} timeoutTimestamp
|
|
* @memberof ibc.applications.transfer.v1.MsgTransfer
|
|
* @instance
|
|
*/
|
|
MsgTransfer.prototype.timeoutTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* Creates a new MsgTransfer instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.applications.transfer.v1.MsgTransfer
|
|
* @static
|
|
* @param {ibc.applications.transfer.v1.IMsgTransfer=} [properties] Properties to set
|
|
* @returns {ibc.applications.transfer.v1.MsgTransfer} MsgTransfer instance
|
|
*/
|
|
MsgTransfer.create = function create(properties) {
|
|
return new MsgTransfer(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.sourcePort != null && Object.hasOwnProperty.call(message, "sourcePort"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourcePort);
|
|
if (message.sourceChannel != null && Object.hasOwnProperty.call(message, "sourceChannel"))
|
|
writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceChannel);
|
|
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.timeoutHeight != null && Object.hasOwnProperty.call(message, "timeoutHeight"))
|
|
$root.ibc.core.client.v1.Height.encode(message.timeoutHeight, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
|
if (message.timeoutTimestamp != null && Object.hasOwnProperty.call(message, "timeoutTimestamp"))
|
|
writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.timeoutTimestamp);
|
|
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.sourcePort = reader.string();
|
|
break;
|
|
case 2:
|
|
message.sourceChannel = 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.timeoutHeight = $root.ibc.core.client.v1.Height.decode(reader, reader.uint32());
|
|
break;
|
|
case 7:
|
|
message.timeoutTimestamp = reader.uint64();
|
|
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.<string,*>} 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.sourcePort != null && message.hasOwnProperty("sourcePort"))
|
|
if (!$util.isString(message.sourcePort))
|
|
return "sourcePort: string expected";
|
|
if (message.sourceChannel != null && message.hasOwnProperty("sourceChannel"))
|
|
if (!$util.isString(message.sourceChannel))
|
|
return "sourceChannel: 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.timeoutHeight != null && message.hasOwnProperty("timeoutHeight")) {
|
|
var error = $root.ibc.core.client.v1.Height.verify(message.timeoutHeight);
|
|
if (error)
|
|
return "timeoutHeight." + error;
|
|
}
|
|
if (message.timeoutTimestamp != null && message.hasOwnProperty("timeoutTimestamp"))
|
|
if (!$util.isInteger(message.timeoutTimestamp) && !(message.timeoutTimestamp && $util.isInteger(message.timeoutTimestamp.low) && $util.isInteger(message.timeoutTimestamp.high)))
|
|
return "timeoutTimestamp: integer|Long 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.<string,*>} 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.sourcePort != null)
|
|
message.sourcePort = String(object.sourcePort);
|
|
if (object.sourceChannel != null)
|
|
message.sourceChannel = String(object.sourceChannel);
|
|
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.timeoutHeight != null) {
|
|
if (typeof object.timeoutHeight !== "object")
|
|
throw TypeError(".ibc.applications.transfer.v1.MsgTransfer.timeoutHeight: object expected");
|
|
message.timeoutHeight = $root.ibc.core.client.v1.Height.fromObject(object.timeoutHeight);
|
|
}
|
|
if (object.timeoutTimestamp != null)
|
|
if ($util.Long)
|
|
(message.timeoutTimestamp = $util.Long.fromValue(object.timeoutTimestamp)).unsigned = true;
|
|
else if (typeof object.timeoutTimestamp === "string")
|
|
message.timeoutTimestamp = parseInt(object.timeoutTimestamp, 10);
|
|
else if (typeof object.timeoutTimestamp === "number")
|
|
message.timeoutTimestamp = object.timeoutTimestamp;
|
|
else if (typeof object.timeoutTimestamp === "object")
|
|
message.timeoutTimestamp = new $util.LongBits(object.timeoutTimestamp.low >>> 0, object.timeoutTimestamp.high >>> 0).toNumber(true);
|
|
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.<string,*>} Plain object
|
|
*/
|
|
MsgTransfer.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.sourcePort = "";
|
|
object.sourceChannel = "";
|
|
object.token = null;
|
|
object.sender = "";
|
|
object.receiver = "";
|
|
object.timeoutHeight = null;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, true);
|
|
object.timeoutTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.timeoutTimestamp = options.longs === String ? "0" : 0;
|
|
}
|
|
if (message.sourcePort != null && message.hasOwnProperty("sourcePort"))
|
|
object.sourcePort = message.sourcePort;
|
|
if (message.sourceChannel != null && message.hasOwnProperty("sourceChannel"))
|
|
object.sourceChannel = message.sourceChannel;
|
|
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.timeoutHeight != null && message.hasOwnProperty("timeoutHeight"))
|
|
object.timeoutHeight = $root.ibc.core.client.v1.Height.toObject(message.timeoutHeight, options);
|
|
if (message.timeoutTimestamp != null && message.hasOwnProperty("timeoutTimestamp"))
|
|
if (typeof message.timeoutTimestamp === "number")
|
|
object.timeoutTimestamp = options.longs === String ? String(message.timeoutTimestamp) : message.timeoutTimestamp;
|
|
else
|
|
object.timeoutTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timeoutTimestamp) : options.longs === Number ? new $util.LongBits(message.timeoutTimestamp.low >>> 0, message.timeoutTimestamp.high >>> 0).toNumber(true) : message.timeoutTimestamp;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgTransfer to JSON.
|
|
* @function toJSON
|
|
* @memberof ibc.applications.transfer.v1.MsgTransfer
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgTransfer.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgTransfer;
|
|
})(v1.MsgTransfer || {});
|
|
|
|
v1.MsgTransferResponse = (function(MsgTransferResponse) {
|
|
|
|
/**
|
|
* Properties of a MsgTransferResponse.
|
|
* @memberof ibc.applications.transfer.v1
|
|
* @interface IMsgTransferResponse
|
|
*/
|
|
|
|
/**
|
|
* 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]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new MsgTransferResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.applications.transfer.v1.MsgTransferResponse
|
|
* @static
|
|
* @param {ibc.applications.transfer.v1.IMsgTransferResponse=} [properties] Properties to set
|
|
* @returns {ibc.applications.transfer.v1.MsgTransferResponse} MsgTransferResponse instance
|
|
*/
|
|
MsgTransferResponse.create = function create(properties) {
|
|
return new MsgTransferResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* 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();
|
|
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) {
|
|
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.<string,*>} 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";
|
|
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.<string,*>} 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;
|
|
return new $root.ibc.applications.transfer.v1.MsgTransferResponse();
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} Plain object
|
|
*/
|
|
MsgTransferResponse.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgTransferResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof ibc.applications.transfer.v1.MsgTransferResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgTransferResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgTransferResponse;
|
|
})(v1.MsgTransferResponse || {});
|
|
|
|
return v1;
|
|
})(transfer.v1 || {});
|
|
|
|
return transfer;
|
|
})(applications.transfer || {});
|
|
|
|
return applications;
|
|
})(ibc.applications || {});
|
|
|
|
/**
|
|
* Namespace core.
|
|
* @memberof ibc
|
|
* @namespace
|
|
*/
|
|
|
|
ibc.core = (function(core) {
|
|
|
|
/**
|
|
* Namespace client.
|
|
* @memberof ibc.core
|
|
* @namespace
|
|
*/
|
|
|
|
core.client = (function(client) {
|
|
|
|
/**
|
|
* Namespace v1.
|
|
* @memberof ibc.core.client
|
|
* @namespace
|
|
*/
|
|
|
|
client.v1 = (function(v1) {
|
|
|
|
v1.IdentifiedClientState = (function(IdentifiedClientState) {
|
|
|
|
/**
|
|
* Properties of an IdentifiedClientState.
|
|
* @memberof ibc.core.client.v1
|
|
* @interface IIdentifiedClientState
|
|
* @property {string|null} [clientId] IdentifiedClientState clientId
|
|
* @property {google.protobuf.IAny|null} [clientState] IdentifiedClientState clientState
|
|
*/
|
|
|
|
/**
|
|
* 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 clientId.
|
|
* @member {string} clientId
|
|
* @memberof ibc.core.client.v1.IdentifiedClientState
|
|
* @instance
|
|
*/
|
|
IdentifiedClientState.prototype.clientId = "";
|
|
|
|
/**
|
|
* IdentifiedClientState clientState.
|
|
* @member {google.protobuf.IAny|null|undefined} clientState
|
|
* @memberof ibc.core.client.v1.IdentifiedClientState
|
|
* @instance
|
|
*/
|
|
IdentifiedClientState.prototype.clientState = null;
|
|
|
|
/**
|
|
* Creates a new IdentifiedClientState instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.IdentifiedClientState
|
|
* @static
|
|
* @param {ibc.core.client.v1.IIdentifiedClientState=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.IdentifiedClientState} IdentifiedClientState instance
|
|
*/
|
|
IdentifiedClientState.create = function create(properties) {
|
|
return new IdentifiedClientState(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.clientId != null && Object.hasOwnProperty.call(message, "clientId"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId);
|
|
if (message.clientState != null && Object.hasOwnProperty.call(message, "clientState"))
|
|
$root.google.protobuf.Any.encode(message.clientState, 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.clientId = reader.string();
|
|
break;
|
|
case 2:
|
|
message.clientState = $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.<string,*>} 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.clientId != null && message.hasOwnProperty("clientId"))
|
|
if (!$util.isString(message.clientId))
|
|
return "clientId: string expected";
|
|
if (message.clientState != null && message.hasOwnProperty("clientState")) {
|
|
var error = $root.google.protobuf.Any.verify(message.clientState);
|
|
if (error)
|
|
return "clientState." + 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.<string,*>} 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.clientId != null)
|
|
message.clientId = String(object.clientId);
|
|
if (object.clientState != null) {
|
|
if (typeof object.clientState !== "object")
|
|
throw TypeError(".ibc.core.client.v1.IdentifiedClientState.clientState: object expected");
|
|
message.clientState = $root.google.protobuf.Any.fromObject(object.clientState);
|
|
}
|
|
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.<string,*>} Plain object
|
|
*/
|
|
IdentifiedClientState.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.clientId = "";
|
|
object.clientState = null;
|
|
}
|
|
if (message.clientId != null && message.hasOwnProperty("clientId"))
|
|
object.clientId = message.clientId;
|
|
if (message.clientState != null && message.hasOwnProperty("clientState"))
|
|
object.clientState = $root.google.protobuf.Any.toObject(message.clientState, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this IdentifiedClientState to JSON.
|
|
* @function toJSON
|
|
* @memberof ibc.core.client.v1.IdentifiedClientState
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
IdentifiedClientState.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return IdentifiedClientState;
|
|
})(v1.IdentifiedClientState || {});
|
|
|
|
v1.ConsensusStateWithHeight = (function(ConsensusStateWithHeight) {
|
|
|
|
/**
|
|
* 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} [consensusState] ConsensusStateWithHeight consensusState
|
|
*/
|
|
|
|
/**
|
|
* 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 consensusState.
|
|
* @member {google.protobuf.IAny|null|undefined} consensusState
|
|
* @memberof ibc.core.client.v1.ConsensusStateWithHeight
|
|
* @instance
|
|
*/
|
|
ConsensusStateWithHeight.prototype.consensusState = null;
|
|
|
|
/**
|
|
* Creates a new ConsensusStateWithHeight instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.ConsensusStateWithHeight
|
|
* @static
|
|
* @param {ibc.core.client.v1.IConsensusStateWithHeight=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.ConsensusStateWithHeight} ConsensusStateWithHeight instance
|
|
*/
|
|
ConsensusStateWithHeight.create = function create(properties) {
|
|
return new ConsensusStateWithHeight(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.consensusState != null && Object.hasOwnProperty.call(message, "consensusState"))
|
|
$root.google.protobuf.Any.encode(message.consensusState, 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.consensusState = $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.<string,*>} 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.consensusState != null && message.hasOwnProperty("consensusState")) {
|
|
var error = $root.google.protobuf.Any.verify(message.consensusState);
|
|
if (error)
|
|
return "consensusState." + 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.<string,*>} 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.consensusState != null) {
|
|
if (typeof object.consensusState !== "object")
|
|
throw TypeError(".ibc.core.client.v1.ConsensusStateWithHeight.consensusState: object expected");
|
|
message.consensusState = $root.google.protobuf.Any.fromObject(object.consensusState);
|
|
}
|
|
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.<string,*>} Plain object
|
|
*/
|
|
ConsensusStateWithHeight.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.height = null;
|
|
object.consensusState = null;
|
|
}
|
|
if (message.height != null && message.hasOwnProperty("height"))
|
|
object.height = $root.ibc.core.client.v1.Height.toObject(message.height, options);
|
|
if (message.consensusState != null && message.hasOwnProperty("consensusState"))
|
|
object.consensusState = $root.google.protobuf.Any.toObject(message.consensusState, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this ConsensusStateWithHeight to JSON.
|
|
* @function toJSON
|
|
* @memberof ibc.core.client.v1.ConsensusStateWithHeight
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
ConsensusStateWithHeight.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ConsensusStateWithHeight;
|
|
})(v1.ConsensusStateWithHeight || {});
|
|
|
|
v1.ClientConsensusStates = (function(ClientConsensusStates) {
|
|
|
|
/**
|
|
* Properties of a ClientConsensusStates.
|
|
* @memberof ibc.core.client.v1
|
|
* @interface IClientConsensusStates
|
|
* @property {string|null} [clientId] ClientConsensusStates clientId
|
|
* @property {Array.<ibc.core.client.v1.IConsensusStateWithHeight>|null} [consensusStates] ClientConsensusStates consensusStates
|
|
*/
|
|
|
|
/**
|
|
* 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.consensusStates = [];
|
|
if (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 clientId.
|
|
* @member {string} clientId
|
|
* @memberof ibc.core.client.v1.ClientConsensusStates
|
|
* @instance
|
|
*/
|
|
ClientConsensusStates.prototype.clientId = "";
|
|
|
|
/**
|
|
* ClientConsensusStates consensusStates.
|
|
* @member {Array.<ibc.core.client.v1.IConsensusStateWithHeight>} consensusStates
|
|
* @memberof ibc.core.client.v1.ClientConsensusStates
|
|
* @instance
|
|
*/
|
|
ClientConsensusStates.prototype.consensusStates = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new ClientConsensusStates instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.ClientConsensusStates
|
|
* @static
|
|
* @param {ibc.core.client.v1.IClientConsensusStates=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.ClientConsensusStates} ClientConsensusStates instance
|
|
*/
|
|
ClientConsensusStates.create = function create(properties) {
|
|
return new ClientConsensusStates(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.clientId != null && Object.hasOwnProperty.call(message, "clientId"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId);
|
|
if (message.consensusStates != null && message.consensusStates.length)
|
|
for (var i = 0; i < message.consensusStates.length; ++i)
|
|
$root.ibc.core.client.v1.ConsensusStateWithHeight.encode(message.consensusStates[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.clientId = reader.string();
|
|
break;
|
|
case 2:
|
|
if (!(message.consensusStates && message.consensusStates.length))
|
|
message.consensusStates = [];
|
|
message.consensusStates.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.<string,*>} 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.clientId != null && message.hasOwnProperty("clientId"))
|
|
if (!$util.isString(message.clientId))
|
|
return "clientId: string expected";
|
|
if (message.consensusStates != null && message.hasOwnProperty("consensusStates")) {
|
|
if (!Array.isArray(message.consensusStates))
|
|
return "consensusStates: array expected";
|
|
for (var i = 0; i < message.consensusStates.length; ++i) {
|
|
var error = $root.ibc.core.client.v1.ConsensusStateWithHeight.verify(message.consensusStates[i]);
|
|
if (error)
|
|
return "consensusStates." + 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.<string,*>} 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.clientId != null)
|
|
message.clientId = String(object.clientId);
|
|
if (object.consensusStates) {
|
|
if (!Array.isArray(object.consensusStates))
|
|
throw TypeError(".ibc.core.client.v1.ClientConsensusStates.consensusStates: array expected");
|
|
message.consensusStates = [];
|
|
for (var i = 0; i < object.consensusStates.length; ++i) {
|
|
if (typeof object.consensusStates[i] !== "object")
|
|
throw TypeError(".ibc.core.client.v1.ClientConsensusStates.consensusStates: object expected");
|
|
message.consensusStates[i] = $root.ibc.core.client.v1.ConsensusStateWithHeight.fromObject(object.consensusStates[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.<string,*>} Plain object
|
|
*/
|
|
ClientConsensusStates.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.consensusStates = [];
|
|
if (options.defaults)
|
|
object.clientId = "";
|
|
if (message.clientId != null && message.hasOwnProperty("clientId"))
|
|
object.clientId = message.clientId;
|
|
if (message.consensusStates && message.consensusStates.length) {
|
|
object.consensusStates = [];
|
|
for (var j = 0; j < message.consensusStates.length; ++j)
|
|
object.consensusStates[j] = $root.ibc.core.client.v1.ConsensusStateWithHeight.toObject(message.consensusStates[j], options);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this ClientConsensusStates to JSON.
|
|
* @function toJSON
|
|
* @memberof ibc.core.client.v1.ClientConsensusStates
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
ClientConsensusStates.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ClientConsensusStates;
|
|
})(v1.ClientConsensusStates || {});
|
|
|
|
v1.ClientUpdateProposal = (function(ClientUpdateProposal) {
|
|
|
|
/**
|
|
* 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} [clientId] ClientUpdateProposal clientId
|
|
* @property {google.protobuf.IAny|null} [header] ClientUpdateProposal header
|
|
*/
|
|
|
|
/**
|
|
* 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 clientId.
|
|
* @member {string} clientId
|
|
* @memberof ibc.core.client.v1.ClientUpdateProposal
|
|
* @instance
|
|
*/
|
|
ClientUpdateProposal.prototype.clientId = "";
|
|
|
|
/**
|
|
* ClientUpdateProposal header.
|
|
* @member {google.protobuf.IAny|null|undefined} header
|
|
* @memberof ibc.core.client.v1.ClientUpdateProposal
|
|
* @instance
|
|
*/
|
|
ClientUpdateProposal.prototype.header = null;
|
|
|
|
/**
|
|
* Creates a new ClientUpdateProposal instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.ClientUpdateProposal
|
|
* @static
|
|
* @param {ibc.core.client.v1.IClientUpdateProposal=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.ClientUpdateProposal} ClientUpdateProposal instance
|
|
*/
|
|
ClientUpdateProposal.create = function create(properties) {
|
|
return new ClientUpdateProposal(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.clientId != null && Object.hasOwnProperty.call(message, "clientId"))
|
|
writer.uint32(/* id 3, wireType 2 =*/26).string(message.clientId);
|
|
if (message.header != null && Object.hasOwnProperty.call(message, "header"))
|
|
$root.google.protobuf.Any.encode(message.header, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
|
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.clientId = reader.string();
|
|
break;
|
|
case 4:
|
|
message.header = $root.google.protobuf.Any.decode(reader, reader.uint32());
|
|
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.<string,*>} 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.clientId != null && message.hasOwnProperty("clientId"))
|
|
if (!$util.isString(message.clientId))
|
|
return "clientId: string expected";
|
|
if (message.header != null && message.hasOwnProperty("header")) {
|
|
var error = $root.google.protobuf.Any.verify(message.header);
|
|
if (error)
|
|
return "header." + error;
|
|
}
|
|
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.<string,*>} 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.clientId != null)
|
|
message.clientId = String(object.clientId);
|
|
if (object.header != null) {
|
|
if (typeof object.header !== "object")
|
|
throw TypeError(".ibc.core.client.v1.ClientUpdateProposal.header: object expected");
|
|
message.header = $root.google.protobuf.Any.fromObject(object.header);
|
|
}
|
|
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.<string,*>} Plain object
|
|
*/
|
|
ClientUpdateProposal.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.title = "";
|
|
object.description = "";
|
|
object.clientId = "";
|
|
object.header = 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.clientId != null && message.hasOwnProperty("clientId"))
|
|
object.clientId = message.clientId;
|
|
if (message.header != null && message.hasOwnProperty("header"))
|
|
object.header = $root.google.protobuf.Any.toObject(message.header, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this ClientUpdateProposal to JSON.
|
|
* @function toJSON
|
|
* @memberof ibc.core.client.v1.ClientUpdateProposal
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
ClientUpdateProposal.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return ClientUpdateProposal;
|
|
})(v1.ClientUpdateProposal || {});
|
|
|
|
v1.Height = (function(Height) {
|
|
|
|
/**
|
|
* Properties of an Height.
|
|
* @memberof ibc.core.client.v1
|
|
* @interface IHeight
|
|
* @property {number|Long|null} [revisionNumber] Height revisionNumber
|
|
* @property {number|Long|null} [revisionHeight] Height revisionHeight
|
|
*/
|
|
|
|
/**
|
|
* 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 revisionNumber.
|
|
* @member {number|Long} revisionNumber
|
|
* @memberof ibc.core.client.v1.Height
|
|
* @instance
|
|
*/
|
|
Height.prototype.revisionNumber = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* Height revisionHeight.
|
|
* @member {number|Long} revisionHeight
|
|
* @memberof ibc.core.client.v1.Height
|
|
* @instance
|
|
*/
|
|
Height.prototype.revisionHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* Creates a new Height instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.Height
|
|
* @static
|
|
* @param {ibc.core.client.v1.IHeight=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.Height} Height instance
|
|
*/
|
|
Height.create = function create(properties) {
|
|
return new Height(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.revisionNumber != null && Object.hasOwnProperty.call(message, "revisionNumber"))
|
|
writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.revisionNumber);
|
|
if (message.revisionHeight != null && Object.hasOwnProperty.call(message, "revisionHeight"))
|
|
writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revisionHeight);
|
|
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.revisionNumber = reader.uint64();
|
|
break;
|
|
case 2:
|
|
message.revisionHeight = 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.<string,*>} 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.revisionNumber != null && message.hasOwnProperty("revisionNumber"))
|
|
if (!$util.isInteger(message.revisionNumber) && !(message.revisionNumber && $util.isInteger(message.revisionNumber.low) && $util.isInteger(message.revisionNumber.high)))
|
|
return "revisionNumber: integer|Long expected";
|
|
if (message.revisionHeight != null && message.hasOwnProperty("revisionHeight"))
|
|
if (!$util.isInteger(message.revisionHeight) && !(message.revisionHeight && $util.isInteger(message.revisionHeight.low) && $util.isInteger(message.revisionHeight.high)))
|
|
return "revisionHeight: 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.<string,*>} 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.revisionNumber != null)
|
|
if ($util.Long)
|
|
(message.revisionNumber = $util.Long.fromValue(object.revisionNumber)).unsigned = true;
|
|
else if (typeof object.revisionNumber === "string")
|
|
message.revisionNumber = parseInt(object.revisionNumber, 10);
|
|
else if (typeof object.revisionNumber === "number")
|
|
message.revisionNumber = object.revisionNumber;
|
|
else if (typeof object.revisionNumber === "object")
|
|
message.revisionNumber = new $util.LongBits(object.revisionNumber.low >>> 0, object.revisionNumber.high >>> 0).toNumber(true);
|
|
if (object.revisionHeight != null)
|
|
if ($util.Long)
|
|
(message.revisionHeight = $util.Long.fromValue(object.revisionHeight)).unsigned = true;
|
|
else if (typeof object.revisionHeight === "string")
|
|
message.revisionHeight = parseInt(object.revisionHeight, 10);
|
|
else if (typeof object.revisionHeight === "number")
|
|
message.revisionHeight = object.revisionHeight;
|
|
else if (typeof object.revisionHeight === "object")
|
|
message.revisionHeight = new $util.LongBits(object.revisionHeight.low >>> 0, object.revisionHeight.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.<string,*>} 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.revisionNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.revisionNumber = options.longs === String ? "0" : 0;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, true);
|
|
object.revisionHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.revisionHeight = options.longs === String ? "0" : 0;
|
|
}
|
|
if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber"))
|
|
if (typeof message.revisionNumber === "number")
|
|
object.revisionNumber = options.longs === String ? String(message.revisionNumber) : message.revisionNumber;
|
|
else
|
|
object.revisionNumber = options.longs === String ? $util.Long.prototype.toString.call(message.revisionNumber) : options.longs === Number ? new $util.LongBits(message.revisionNumber.low >>> 0, message.revisionNumber.high >>> 0).toNumber(true) : message.revisionNumber;
|
|
if (message.revisionHeight != null && message.hasOwnProperty("revisionHeight"))
|
|
if (typeof message.revisionHeight === "number")
|
|
object.revisionHeight = options.longs === String ? String(message.revisionHeight) : message.revisionHeight;
|
|
else
|
|
object.revisionHeight = options.longs === String ? $util.Long.prototype.toString.call(message.revisionHeight) : options.longs === Number ? new $util.LongBits(message.revisionHeight.low >>> 0, message.revisionHeight.high >>> 0).toNumber(true) : message.revisionHeight;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Height to JSON.
|
|
* @function toJSON
|
|
* @memberof ibc.core.client.v1.Height
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Height.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Height;
|
|
})(v1.Height || {});
|
|
|
|
v1.Params = (function(Params) {
|
|
|
|
/**
|
|
* Properties of a Params.
|
|
* @memberof ibc.core.client.v1
|
|
* @interface IParams
|
|
* @property {Array.<string>|null} [allowedClients] Params allowedClients
|
|
*/
|
|
|
|
/**
|
|
* 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.allowedClients = [];
|
|
if (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 allowedClients.
|
|
* @member {Array.<string>} allowedClients
|
|
* @memberof ibc.core.client.v1.Params
|
|
* @instance
|
|
*/
|
|
Params.prototype.allowedClients = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new Params instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.Params
|
|
* @static
|
|
* @param {ibc.core.client.v1.IParams=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.Params} Params instance
|
|
*/
|
|
Params.create = function create(properties) {
|
|
return new Params(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.allowedClients != null && message.allowedClients.length)
|
|
for (var i = 0; i < message.allowedClients.length; ++i)
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedClients[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.allowedClients && message.allowedClients.length))
|
|
message.allowedClients = [];
|
|
message.allowedClients.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.<string,*>} 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.allowedClients != null && message.hasOwnProperty("allowedClients")) {
|
|
if (!Array.isArray(message.allowedClients))
|
|
return "allowedClients: array expected";
|
|
for (var i = 0; i < message.allowedClients.length; ++i)
|
|
if (!$util.isString(message.allowedClients[i]))
|
|
return "allowedClients: 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.<string,*>} 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.allowedClients) {
|
|
if (!Array.isArray(object.allowedClients))
|
|
throw TypeError(".ibc.core.client.v1.Params.allowedClients: array expected");
|
|
message.allowedClients = [];
|
|
for (var i = 0; i < object.allowedClients.length; ++i)
|
|
message.allowedClients[i] = String(object.allowedClients[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.<string,*>} Plain object
|
|
*/
|
|
Params.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.allowedClients = [];
|
|
if (message.allowedClients && message.allowedClients.length) {
|
|
object.allowedClients = [];
|
|
for (var j = 0; j < message.allowedClients.length; ++j)
|
|
object.allowedClients[j] = message.allowedClients[j];
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this Params to JSON.
|
|
* @function toJSON
|
|
* @memberof ibc.core.client.v1.Params
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
Params.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return Params;
|
|
})(v1.Params || {});
|
|
|
|
v1.GenesisState = (function(GenesisState) {
|
|
|
|
/**
|
|
* Properties of a GenesisState.
|
|
* @memberof ibc.core.client.v1
|
|
* @interface IGenesisState
|
|
* @property {Array.<ibc.core.client.v1.IIdentifiedClientState>|null} [clients] GenesisState clients
|
|
* @property {Array.<ibc.core.client.v1.IClientConsensusStates>|null} [clientsConsensus] GenesisState clientsConsensus
|
|
* @property {Array.<ibc.core.client.v1.IIdentifiedGenesisMetadata>|null} [clientsMetadata] GenesisState clientsMetadata
|
|
* @property {ibc.core.client.v1.IParams|null} [params] GenesisState params
|
|
* @property {boolean|null} [createLocalhost] GenesisState createLocalhost
|
|
* @property {number|Long|null} [nextClientSequence] GenesisState nextClientSequence
|
|
*/
|
|
|
|
/**
|
|
* 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.clientsConsensus = [];
|
|
this.clientsMetadata = [];
|
|
if (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.<ibc.core.client.v1.IIdentifiedClientState>} clients
|
|
* @memberof ibc.core.client.v1.GenesisState
|
|
* @instance
|
|
*/
|
|
GenesisState.prototype.clients = $util.emptyArray;
|
|
|
|
/**
|
|
* GenesisState clientsConsensus.
|
|
* @member {Array.<ibc.core.client.v1.IClientConsensusStates>} clientsConsensus
|
|
* @memberof ibc.core.client.v1.GenesisState
|
|
* @instance
|
|
*/
|
|
GenesisState.prototype.clientsConsensus = $util.emptyArray;
|
|
|
|
/**
|
|
* GenesisState clientsMetadata.
|
|
* @member {Array.<ibc.core.client.v1.IIdentifiedGenesisMetadata>} clientsMetadata
|
|
* @memberof ibc.core.client.v1.GenesisState
|
|
* @instance
|
|
*/
|
|
GenesisState.prototype.clientsMetadata = $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 createLocalhost.
|
|
* @member {boolean} createLocalhost
|
|
* @memberof ibc.core.client.v1.GenesisState
|
|
* @instance
|
|
*/
|
|
GenesisState.prototype.createLocalhost = false;
|
|
|
|
/**
|
|
* GenesisState nextClientSequence.
|
|
* @member {number|Long} nextClientSequence
|
|
* @memberof ibc.core.client.v1.GenesisState
|
|
* @instance
|
|
*/
|
|
GenesisState.prototype.nextClientSequence = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* Creates a new GenesisState instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.GenesisState
|
|
* @static
|
|
* @param {ibc.core.client.v1.IGenesisState=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.GenesisState} GenesisState instance
|
|
*/
|
|
GenesisState.create = function create(properties) {
|
|
return new GenesisState(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.clientsConsensus != null && message.clientsConsensus.length)
|
|
for (var i = 0; i < message.clientsConsensus.length; ++i)
|
|
$root.ibc.core.client.v1.ClientConsensusStates.encode(message.clientsConsensus[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
if (message.clientsMetadata != null && message.clientsMetadata.length)
|
|
for (var i = 0; i < message.clientsMetadata.length; ++i)
|
|
$root.ibc.core.client.v1.IdentifiedGenesisMetadata.encode(message.clientsMetadata[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.createLocalhost != null && Object.hasOwnProperty.call(message, "createLocalhost"))
|
|
writer.uint32(/* id 5, wireType 0 =*/40).bool(message.createLocalhost);
|
|
if (message.nextClientSequence != null && Object.hasOwnProperty.call(message, "nextClientSequence"))
|
|
writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.nextClientSequence);
|
|
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.clientsConsensus && message.clientsConsensus.length))
|
|
message.clientsConsensus = [];
|
|
message.clientsConsensus.push($root.ibc.core.client.v1.ClientConsensusStates.decode(reader, reader.uint32()));
|
|
break;
|
|
case 3:
|
|
if (!(message.clientsMetadata && message.clientsMetadata.length))
|
|
message.clientsMetadata = [];
|
|
message.clientsMetadata.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.createLocalhost = reader.bool();
|
|
break;
|
|
case 6:
|
|
message.nextClientSequence = 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.<string,*>} 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.clientsConsensus != null && message.hasOwnProperty("clientsConsensus")) {
|
|
if (!Array.isArray(message.clientsConsensus))
|
|
return "clientsConsensus: array expected";
|
|
for (var i = 0; i < message.clientsConsensus.length; ++i) {
|
|
var error = $root.ibc.core.client.v1.ClientConsensusStates.verify(message.clientsConsensus[i]);
|
|
if (error)
|
|
return "clientsConsensus." + error;
|
|
}
|
|
}
|
|
if (message.clientsMetadata != null && message.hasOwnProperty("clientsMetadata")) {
|
|
if (!Array.isArray(message.clientsMetadata))
|
|
return "clientsMetadata: array expected";
|
|
for (var i = 0; i < message.clientsMetadata.length; ++i) {
|
|
var error = $root.ibc.core.client.v1.IdentifiedGenesisMetadata.verify(message.clientsMetadata[i]);
|
|
if (error)
|
|
return "clientsMetadata." + 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.createLocalhost != null && message.hasOwnProperty("createLocalhost"))
|
|
if (typeof message.createLocalhost !== "boolean")
|
|
return "createLocalhost: boolean expected";
|
|
if (message.nextClientSequence != null && message.hasOwnProperty("nextClientSequence"))
|
|
if (!$util.isInteger(message.nextClientSequence) && !(message.nextClientSequence && $util.isInteger(message.nextClientSequence.low) && $util.isInteger(message.nextClientSequence.high)))
|
|
return "nextClientSequence: 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.<string,*>} 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.clientsConsensus) {
|
|
if (!Array.isArray(object.clientsConsensus))
|
|
throw TypeError(".ibc.core.client.v1.GenesisState.clientsConsensus: array expected");
|
|
message.clientsConsensus = [];
|
|
for (var i = 0; i < object.clientsConsensus.length; ++i) {
|
|
if (typeof object.clientsConsensus[i] !== "object")
|
|
throw TypeError(".ibc.core.client.v1.GenesisState.clientsConsensus: object expected");
|
|
message.clientsConsensus[i] = $root.ibc.core.client.v1.ClientConsensusStates.fromObject(object.clientsConsensus[i]);
|
|
}
|
|
}
|
|
if (object.clientsMetadata) {
|
|
if (!Array.isArray(object.clientsMetadata))
|
|
throw TypeError(".ibc.core.client.v1.GenesisState.clientsMetadata: array expected");
|
|
message.clientsMetadata = [];
|
|
for (var i = 0; i < object.clientsMetadata.length; ++i) {
|
|
if (typeof object.clientsMetadata[i] !== "object")
|
|
throw TypeError(".ibc.core.client.v1.GenesisState.clientsMetadata: object expected");
|
|
message.clientsMetadata[i] = $root.ibc.core.client.v1.IdentifiedGenesisMetadata.fromObject(object.clientsMetadata[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.createLocalhost != null)
|
|
message.createLocalhost = Boolean(object.createLocalhost);
|
|
if (object.nextClientSequence != null)
|
|
if ($util.Long)
|
|
(message.nextClientSequence = $util.Long.fromValue(object.nextClientSequence)).unsigned = true;
|
|
else if (typeof object.nextClientSequence === "string")
|
|
message.nextClientSequence = parseInt(object.nextClientSequence, 10);
|
|
else if (typeof object.nextClientSequence === "number")
|
|
message.nextClientSequence = object.nextClientSequence;
|
|
else if (typeof object.nextClientSequence === "object")
|
|
message.nextClientSequence = new $util.LongBits(object.nextClientSequence.low >>> 0, object.nextClientSequence.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.<string,*>} Plain object
|
|
*/
|
|
GenesisState.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults) {
|
|
object.clients = [];
|
|
object.clientsConsensus = [];
|
|
object.clientsMetadata = [];
|
|
}
|
|
if (options.defaults) {
|
|
object.params = null;
|
|
object.createLocalhost = false;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, true);
|
|
object.nextClientSequence = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.nextClientSequence = 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.clientsConsensus && message.clientsConsensus.length) {
|
|
object.clientsConsensus = [];
|
|
for (var j = 0; j < message.clientsConsensus.length; ++j)
|
|
object.clientsConsensus[j] = $root.ibc.core.client.v1.ClientConsensusStates.toObject(message.clientsConsensus[j], options);
|
|
}
|
|
if (message.clientsMetadata && message.clientsMetadata.length) {
|
|
object.clientsMetadata = [];
|
|
for (var j = 0; j < message.clientsMetadata.length; ++j)
|
|
object.clientsMetadata[j] = $root.ibc.core.client.v1.IdentifiedGenesisMetadata.toObject(message.clientsMetadata[j], options);
|
|
}
|
|
if (message.params != null && message.hasOwnProperty("params"))
|
|
object.params = $root.ibc.core.client.v1.Params.toObject(message.params, options);
|
|
if (message.createLocalhost != null && message.hasOwnProperty("createLocalhost"))
|
|
object.createLocalhost = message.createLocalhost;
|
|
if (message.nextClientSequence != null && message.hasOwnProperty("nextClientSequence"))
|
|
if (typeof message.nextClientSequence === "number")
|
|
object.nextClientSequence = options.longs === String ? String(message.nextClientSequence) : message.nextClientSequence;
|
|
else
|
|
object.nextClientSequence = options.longs === String ? $util.Long.prototype.toString.call(message.nextClientSequence) : options.longs === Number ? new $util.LongBits(message.nextClientSequence.low >>> 0, message.nextClientSequence.high >>> 0).toNumber(true) : message.nextClientSequence;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this GenesisState to JSON.
|
|
* @function toJSON
|
|
* @memberof ibc.core.client.v1.GenesisState
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
GenesisState.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return GenesisState;
|
|
})(v1.GenesisState || {});
|
|
|
|
v1.GenesisMetadata = (function(GenesisMetadata) {
|
|
|
|
/**
|
|
* 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([]);
|
|
|
|
/**
|
|
* Creates a new GenesisMetadata instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.GenesisMetadata
|
|
* @static
|
|
* @param {ibc.core.client.v1.IGenesisMetadata=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.GenesisMetadata} GenesisMetadata instance
|
|
*/
|
|
GenesisMetadata.create = function create(properties) {
|
|
return new GenesisMetadata(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
GenesisMetadata.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return GenesisMetadata;
|
|
})(v1.GenesisMetadata || {});
|
|
|
|
v1.IdentifiedGenesisMetadata = (function(IdentifiedGenesisMetadata) {
|
|
|
|
/**
|
|
* Properties of an IdentifiedGenesisMetadata.
|
|
* @memberof ibc.core.client.v1
|
|
* @interface IIdentifiedGenesisMetadata
|
|
* @property {string|null} [clientId] IdentifiedGenesisMetadata clientId
|
|
* @property {Array.<ibc.core.client.v1.IGenesisMetadata>|null} [clientMetadata] IdentifiedGenesisMetadata clientMetadata
|
|
*/
|
|
|
|
/**
|
|
* 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.clientMetadata = [];
|
|
if (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 clientId.
|
|
* @member {string} clientId
|
|
* @memberof ibc.core.client.v1.IdentifiedGenesisMetadata
|
|
* @instance
|
|
*/
|
|
IdentifiedGenesisMetadata.prototype.clientId = "";
|
|
|
|
/**
|
|
* IdentifiedGenesisMetadata clientMetadata.
|
|
* @member {Array.<ibc.core.client.v1.IGenesisMetadata>} clientMetadata
|
|
* @memberof ibc.core.client.v1.IdentifiedGenesisMetadata
|
|
* @instance
|
|
*/
|
|
IdentifiedGenesisMetadata.prototype.clientMetadata = $util.emptyArray;
|
|
|
|
/**
|
|
* Creates a new IdentifiedGenesisMetadata instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.IdentifiedGenesisMetadata
|
|
* @static
|
|
* @param {ibc.core.client.v1.IIdentifiedGenesisMetadata=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.IdentifiedGenesisMetadata} IdentifiedGenesisMetadata instance
|
|
*/
|
|
IdentifiedGenesisMetadata.create = function create(properties) {
|
|
return new IdentifiedGenesisMetadata(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.clientId != null && Object.hasOwnProperty.call(message, "clientId"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId);
|
|
if (message.clientMetadata != null && message.clientMetadata.length)
|
|
for (var i = 0; i < message.clientMetadata.length; ++i)
|
|
$root.ibc.core.client.v1.GenesisMetadata.encode(message.clientMetadata[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.clientId = reader.string();
|
|
break;
|
|
case 2:
|
|
if (!(message.clientMetadata && message.clientMetadata.length))
|
|
message.clientMetadata = [];
|
|
message.clientMetadata.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.<string,*>} 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.clientId != null && message.hasOwnProperty("clientId"))
|
|
if (!$util.isString(message.clientId))
|
|
return "clientId: string expected";
|
|
if (message.clientMetadata != null && message.hasOwnProperty("clientMetadata")) {
|
|
if (!Array.isArray(message.clientMetadata))
|
|
return "clientMetadata: array expected";
|
|
for (var i = 0; i < message.clientMetadata.length; ++i) {
|
|
var error = $root.ibc.core.client.v1.GenesisMetadata.verify(message.clientMetadata[i]);
|
|
if (error)
|
|
return "clientMetadata." + 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.<string,*>} 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.clientId != null)
|
|
message.clientId = String(object.clientId);
|
|
if (object.clientMetadata) {
|
|
if (!Array.isArray(object.clientMetadata))
|
|
throw TypeError(".ibc.core.client.v1.IdentifiedGenesisMetadata.clientMetadata: array expected");
|
|
message.clientMetadata = [];
|
|
for (var i = 0; i < object.clientMetadata.length; ++i) {
|
|
if (typeof object.clientMetadata[i] !== "object")
|
|
throw TypeError(".ibc.core.client.v1.IdentifiedGenesisMetadata.clientMetadata: object expected");
|
|
message.clientMetadata[i] = $root.ibc.core.client.v1.GenesisMetadata.fromObject(object.clientMetadata[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.<string,*>} Plain object
|
|
*/
|
|
IdentifiedGenesisMetadata.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.clientMetadata = [];
|
|
if (options.defaults)
|
|
object.clientId = "";
|
|
if (message.clientId != null && message.hasOwnProperty("clientId"))
|
|
object.clientId = message.clientId;
|
|
if (message.clientMetadata && message.clientMetadata.length) {
|
|
object.clientMetadata = [];
|
|
for (var j = 0; j < message.clientMetadata.length; ++j)
|
|
object.clientMetadata[j] = $root.ibc.core.client.v1.GenesisMetadata.toObject(message.clientMetadata[j], options);
|
|
}
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this IdentifiedGenesisMetadata to JSON.
|
|
* @function toJSON
|
|
* @memberof ibc.core.client.v1.IdentifiedGenesisMetadata
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
IdentifiedGenesisMetadata.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return IdentifiedGenesisMetadata;
|
|
})(v1.IdentifiedGenesisMetadata || {});
|
|
|
|
v1.Query = (function(Query) {
|
|
|
|
/**
|
|
* 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;
|
|
|
|
/**
|
|
* Creates new Query service using the specified rpc implementation.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.Query
|
|
* @static
|
|
* @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
|
* @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
|
* @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
|
* @returns {Query} RPC service. Useful where requests and/or responses are streamed.
|
|
*/
|
|
Query.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
|
return new this(rpcImpl, requestDelimited, responseDelimited);
|
|
};
|
|
|
|
/**
|
|
* 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.IQueryClientStateResponse} [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<ibc.core.client.v1.IQueryClientStateResponse>} 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.IQueryClientStatesResponse} [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<ibc.core.client.v1.IQueryClientStatesResponse>} 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.IQueryConsensusStateResponse} [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<ibc.core.client.v1.IQueryConsensusStateResponse>} 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.IQueryConsensusStatesResponse} [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<ibc.core.client.v1.IQueryConsensusStatesResponse>} 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.IQueryClientParamsResponse} [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<ibc.core.client.v1.IQueryClientParamsResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
return Query;
|
|
})(v1.Query || {});
|
|
|
|
v1.QueryClientStateRequest = (function(QueryClientStateRequest) {
|
|
|
|
/**
|
|
* Properties of a QueryClientStateRequest.
|
|
* @memberof ibc.core.client.v1
|
|
* @interface IQueryClientStateRequest
|
|
* @property {string|null} [clientId] QueryClientStateRequest clientId
|
|
*/
|
|
|
|
/**
|
|
* 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 clientId.
|
|
* @member {string} clientId
|
|
* @memberof ibc.core.client.v1.QueryClientStateRequest
|
|
* @instance
|
|
*/
|
|
QueryClientStateRequest.prototype.clientId = "";
|
|
|
|
/**
|
|
* Creates a new QueryClientStateRequest instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.QueryClientStateRequest
|
|
* @static
|
|
* @param {ibc.core.client.v1.IQueryClientStateRequest=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.QueryClientStateRequest} QueryClientStateRequest instance
|
|
*/
|
|
QueryClientStateRequest.create = function create(properties) {
|
|
return new QueryClientStateRequest(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.clientId != null && Object.hasOwnProperty.call(message, "clientId"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId);
|
|
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.clientId = 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.<string,*>} 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.clientId != null && message.hasOwnProperty("clientId"))
|
|
if (!$util.isString(message.clientId))
|
|
return "clientId: 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.<string,*>} 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.clientId != null)
|
|
message.clientId = String(object.clientId);
|
|
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.<string,*>} Plain object
|
|
*/
|
|
QueryClientStateRequest.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults)
|
|
object.clientId = "";
|
|
if (message.clientId != null && message.hasOwnProperty("clientId"))
|
|
object.clientId = message.clientId;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this QueryClientStateRequest to JSON.
|
|
* @function toJSON
|
|
* @memberof ibc.core.client.v1.QueryClientStateRequest
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
QueryClientStateRequest.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return QueryClientStateRequest;
|
|
})(v1.QueryClientStateRequest || {});
|
|
|
|
v1.QueryClientStateResponse = (function(QueryClientStateResponse) {
|
|
|
|
/**
|
|
* Properties of a QueryClientStateResponse.
|
|
* @memberof ibc.core.client.v1
|
|
* @interface IQueryClientStateResponse
|
|
* @property {google.protobuf.IAny|null} [clientState] QueryClientStateResponse clientState
|
|
* @property {Uint8Array|null} [proof] QueryClientStateResponse proof
|
|
* @property {ibc.core.client.v1.IHeight|null} [proofHeight] QueryClientStateResponse proofHeight
|
|
*/
|
|
|
|
/**
|
|
* 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 clientState.
|
|
* @member {google.protobuf.IAny|null|undefined} clientState
|
|
* @memberof ibc.core.client.v1.QueryClientStateResponse
|
|
* @instance
|
|
*/
|
|
QueryClientStateResponse.prototype.clientState = null;
|
|
|
|
/**
|
|
* QueryClientStateResponse proof.
|
|
* @member {Uint8Array} proof
|
|
* @memberof ibc.core.client.v1.QueryClientStateResponse
|
|
* @instance
|
|
*/
|
|
QueryClientStateResponse.prototype.proof = $util.newBuffer([]);
|
|
|
|
/**
|
|
* QueryClientStateResponse proofHeight.
|
|
* @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight
|
|
* @memberof ibc.core.client.v1.QueryClientStateResponse
|
|
* @instance
|
|
*/
|
|
QueryClientStateResponse.prototype.proofHeight = null;
|
|
|
|
/**
|
|
* Creates a new QueryClientStateResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.QueryClientStateResponse
|
|
* @static
|
|
* @param {ibc.core.client.v1.IQueryClientStateResponse=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.QueryClientStateResponse} QueryClientStateResponse instance
|
|
*/
|
|
QueryClientStateResponse.create = function create(properties) {
|
|
return new QueryClientStateResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.clientState != null && Object.hasOwnProperty.call(message, "clientState"))
|
|
$root.google.protobuf.Any.encode(message.clientState, 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.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight"))
|
|
$root.ibc.core.client.v1.Height.encode(message.proofHeight, 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.clientState = $root.google.protobuf.Any.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
message.proof = reader.bytes();
|
|
break;
|
|
case 3:
|
|
message.proofHeight = $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.<string,*>} 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.clientState != null && message.hasOwnProperty("clientState")) {
|
|
var error = $root.google.protobuf.Any.verify(message.clientState);
|
|
if (error)
|
|
return "clientState." + 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.proofHeight != null && message.hasOwnProperty("proofHeight")) {
|
|
var error = $root.ibc.core.client.v1.Height.verify(message.proofHeight);
|
|
if (error)
|
|
return "proofHeight." + 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.<string,*>} 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.clientState != null) {
|
|
if (typeof object.clientState !== "object")
|
|
throw TypeError(".ibc.core.client.v1.QueryClientStateResponse.clientState: object expected");
|
|
message.clientState = $root.google.protobuf.Any.fromObject(object.clientState);
|
|
}
|
|
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.proofHeight != null) {
|
|
if (typeof object.proofHeight !== "object")
|
|
throw TypeError(".ibc.core.client.v1.QueryClientStateResponse.proofHeight: object expected");
|
|
message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight);
|
|
}
|
|
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.<string,*>} Plain object
|
|
*/
|
|
QueryClientStateResponse.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.clientState = null;
|
|
if (options.bytes === String)
|
|
object.proof = "";
|
|
else {
|
|
object.proof = [];
|
|
if (options.bytes !== Array)
|
|
object.proof = $util.newBuffer(object.proof);
|
|
}
|
|
object.proofHeight = null;
|
|
}
|
|
if (message.clientState != null && message.hasOwnProperty("clientState"))
|
|
object.clientState = $root.google.protobuf.Any.toObject(message.clientState, 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.proofHeight != null && message.hasOwnProperty("proofHeight"))
|
|
object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this QueryClientStateResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof ibc.core.client.v1.QueryClientStateResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
QueryClientStateResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return QueryClientStateResponse;
|
|
})(v1.QueryClientStateResponse || {});
|
|
|
|
v1.QueryClientStatesRequest = (function(QueryClientStatesRequest) {
|
|
|
|
/**
|
|
* 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;
|
|
|
|
/**
|
|
* Creates a new QueryClientStatesRequest instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.QueryClientStatesRequest
|
|
* @static
|
|
* @param {ibc.core.client.v1.IQueryClientStatesRequest=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.QueryClientStatesRequest} QueryClientStatesRequest instance
|
|
*/
|
|
QueryClientStatesRequest.create = function create(properties) {
|
|
return new QueryClientStatesRequest(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
QueryClientStatesRequest.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return QueryClientStatesRequest;
|
|
})(v1.QueryClientStatesRequest || {});
|
|
|
|
v1.QueryClientStatesResponse = (function(QueryClientStatesResponse) {
|
|
|
|
/**
|
|
* Properties of a QueryClientStatesResponse.
|
|
* @memberof ibc.core.client.v1
|
|
* @interface IQueryClientStatesResponse
|
|
* @property {Array.<ibc.core.client.v1.IIdentifiedClientState>|null} [clientStates] QueryClientStatesResponse clientStates
|
|
* @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.clientStates = [];
|
|
if (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 clientStates.
|
|
* @member {Array.<ibc.core.client.v1.IIdentifiedClientState>} clientStates
|
|
* @memberof ibc.core.client.v1.QueryClientStatesResponse
|
|
* @instance
|
|
*/
|
|
QueryClientStatesResponse.prototype.clientStates = $util.emptyArray;
|
|
|
|
/**
|
|
* QueryClientStatesResponse pagination.
|
|
* @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination
|
|
* @memberof ibc.core.client.v1.QueryClientStatesResponse
|
|
* @instance
|
|
*/
|
|
QueryClientStatesResponse.prototype.pagination = null;
|
|
|
|
/**
|
|
* Creates a new QueryClientStatesResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.QueryClientStatesResponse
|
|
* @static
|
|
* @param {ibc.core.client.v1.IQueryClientStatesResponse=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.QueryClientStatesResponse} QueryClientStatesResponse instance
|
|
*/
|
|
QueryClientStatesResponse.create = function create(properties) {
|
|
return new QueryClientStatesResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.clientStates != null && message.clientStates.length)
|
|
for (var i = 0; i < message.clientStates.length; ++i)
|
|
$root.ibc.core.client.v1.IdentifiedClientState.encode(message.clientStates[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.clientStates && message.clientStates.length))
|
|
message.clientStates = [];
|
|
message.clientStates.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.<string,*>} 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.clientStates != null && message.hasOwnProperty("clientStates")) {
|
|
if (!Array.isArray(message.clientStates))
|
|
return "clientStates: array expected";
|
|
for (var i = 0; i < message.clientStates.length; ++i) {
|
|
var error = $root.ibc.core.client.v1.IdentifiedClientState.verify(message.clientStates[i]);
|
|
if (error)
|
|
return "clientStates." + 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.<string,*>} 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.clientStates) {
|
|
if (!Array.isArray(object.clientStates))
|
|
throw TypeError(".ibc.core.client.v1.QueryClientStatesResponse.clientStates: array expected");
|
|
message.clientStates = [];
|
|
for (var i = 0; i < object.clientStates.length; ++i) {
|
|
if (typeof object.clientStates[i] !== "object")
|
|
throw TypeError(".ibc.core.client.v1.QueryClientStatesResponse.clientStates: object expected");
|
|
message.clientStates[i] = $root.ibc.core.client.v1.IdentifiedClientState.fromObject(object.clientStates[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.<string,*>} Plain object
|
|
*/
|
|
QueryClientStatesResponse.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.clientStates = [];
|
|
if (options.defaults)
|
|
object.pagination = null;
|
|
if (message.clientStates && message.clientStates.length) {
|
|
object.clientStates = [];
|
|
for (var j = 0; j < message.clientStates.length; ++j)
|
|
object.clientStates[j] = $root.ibc.core.client.v1.IdentifiedClientState.toObject(message.clientStates[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.<string,*>} JSON object
|
|
*/
|
|
QueryClientStatesResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return QueryClientStatesResponse;
|
|
})(v1.QueryClientStatesResponse || {});
|
|
|
|
v1.QueryConsensusStateRequest = (function(QueryConsensusStateRequest) {
|
|
|
|
/**
|
|
* Properties of a QueryConsensusStateRequest.
|
|
* @memberof ibc.core.client.v1
|
|
* @interface IQueryConsensusStateRequest
|
|
* @property {string|null} [clientId] QueryConsensusStateRequest clientId
|
|
* @property {number|Long|null} [revisionNumber] QueryConsensusStateRequest revisionNumber
|
|
* @property {number|Long|null} [revisionHeight] QueryConsensusStateRequest revisionHeight
|
|
* @property {boolean|null} [latestHeight] QueryConsensusStateRequest latestHeight
|
|
*/
|
|
|
|
/**
|
|
* 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 clientId.
|
|
* @member {string} clientId
|
|
* @memberof ibc.core.client.v1.QueryConsensusStateRequest
|
|
* @instance
|
|
*/
|
|
QueryConsensusStateRequest.prototype.clientId = "";
|
|
|
|
/**
|
|
* QueryConsensusStateRequest revisionNumber.
|
|
* @member {number|Long} revisionNumber
|
|
* @memberof ibc.core.client.v1.QueryConsensusStateRequest
|
|
* @instance
|
|
*/
|
|
QueryConsensusStateRequest.prototype.revisionNumber = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* QueryConsensusStateRequest revisionHeight.
|
|
* @member {number|Long} revisionHeight
|
|
* @memberof ibc.core.client.v1.QueryConsensusStateRequest
|
|
* @instance
|
|
*/
|
|
QueryConsensusStateRequest.prototype.revisionHeight = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
|
|
|
|
/**
|
|
* QueryConsensusStateRequest latestHeight.
|
|
* @member {boolean} latestHeight
|
|
* @memberof ibc.core.client.v1.QueryConsensusStateRequest
|
|
* @instance
|
|
*/
|
|
QueryConsensusStateRequest.prototype.latestHeight = false;
|
|
|
|
/**
|
|
* Creates a new QueryConsensusStateRequest instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.QueryConsensusStateRequest
|
|
* @static
|
|
* @param {ibc.core.client.v1.IQueryConsensusStateRequest=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.QueryConsensusStateRequest} QueryConsensusStateRequest instance
|
|
*/
|
|
QueryConsensusStateRequest.create = function create(properties) {
|
|
return new QueryConsensusStateRequest(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.clientId != null && Object.hasOwnProperty.call(message, "clientId"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId);
|
|
if (message.revisionNumber != null && Object.hasOwnProperty.call(message, "revisionNumber"))
|
|
writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.revisionNumber);
|
|
if (message.revisionHeight != null && Object.hasOwnProperty.call(message, "revisionHeight"))
|
|
writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.revisionHeight);
|
|
if (message.latestHeight != null && Object.hasOwnProperty.call(message, "latestHeight"))
|
|
writer.uint32(/* id 4, wireType 0 =*/32).bool(message.latestHeight);
|
|
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.clientId = reader.string();
|
|
break;
|
|
case 2:
|
|
message.revisionNumber = reader.uint64();
|
|
break;
|
|
case 3:
|
|
message.revisionHeight = reader.uint64();
|
|
break;
|
|
case 4:
|
|
message.latestHeight = 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.<string,*>} 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.clientId != null && message.hasOwnProperty("clientId"))
|
|
if (!$util.isString(message.clientId))
|
|
return "clientId: string expected";
|
|
if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber"))
|
|
if (!$util.isInteger(message.revisionNumber) && !(message.revisionNumber && $util.isInteger(message.revisionNumber.low) && $util.isInteger(message.revisionNumber.high)))
|
|
return "revisionNumber: integer|Long expected";
|
|
if (message.revisionHeight != null && message.hasOwnProperty("revisionHeight"))
|
|
if (!$util.isInteger(message.revisionHeight) && !(message.revisionHeight && $util.isInteger(message.revisionHeight.low) && $util.isInteger(message.revisionHeight.high)))
|
|
return "revisionHeight: integer|Long expected";
|
|
if (message.latestHeight != null && message.hasOwnProperty("latestHeight"))
|
|
if (typeof message.latestHeight !== "boolean")
|
|
return "latestHeight: 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.<string,*>} 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.clientId != null)
|
|
message.clientId = String(object.clientId);
|
|
if (object.revisionNumber != null)
|
|
if ($util.Long)
|
|
(message.revisionNumber = $util.Long.fromValue(object.revisionNumber)).unsigned = true;
|
|
else if (typeof object.revisionNumber === "string")
|
|
message.revisionNumber = parseInt(object.revisionNumber, 10);
|
|
else if (typeof object.revisionNumber === "number")
|
|
message.revisionNumber = object.revisionNumber;
|
|
else if (typeof object.revisionNumber === "object")
|
|
message.revisionNumber = new $util.LongBits(object.revisionNumber.low >>> 0, object.revisionNumber.high >>> 0).toNumber(true);
|
|
if (object.revisionHeight != null)
|
|
if ($util.Long)
|
|
(message.revisionHeight = $util.Long.fromValue(object.revisionHeight)).unsigned = true;
|
|
else if (typeof object.revisionHeight === "string")
|
|
message.revisionHeight = parseInt(object.revisionHeight, 10);
|
|
else if (typeof object.revisionHeight === "number")
|
|
message.revisionHeight = object.revisionHeight;
|
|
else if (typeof object.revisionHeight === "object")
|
|
message.revisionHeight = new $util.LongBits(object.revisionHeight.low >>> 0, object.revisionHeight.high >>> 0).toNumber(true);
|
|
if (object.latestHeight != null)
|
|
message.latestHeight = Boolean(object.latestHeight);
|
|
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.<string,*>} Plain object
|
|
*/
|
|
QueryConsensusStateRequest.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.clientId = "";
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, true);
|
|
object.revisionNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.revisionNumber = options.longs === String ? "0" : 0;
|
|
if ($util.Long) {
|
|
var long = new $util.Long(0, 0, true);
|
|
object.revisionHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
|
|
} else
|
|
object.revisionHeight = options.longs === String ? "0" : 0;
|
|
object.latestHeight = false;
|
|
}
|
|
if (message.clientId != null && message.hasOwnProperty("clientId"))
|
|
object.clientId = message.clientId;
|
|
if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber"))
|
|
if (typeof message.revisionNumber === "number")
|
|
object.revisionNumber = options.longs === String ? String(message.revisionNumber) : message.revisionNumber;
|
|
else
|
|
object.revisionNumber = options.longs === String ? $util.Long.prototype.toString.call(message.revisionNumber) : options.longs === Number ? new $util.LongBits(message.revisionNumber.low >>> 0, message.revisionNumber.high >>> 0).toNumber(true) : message.revisionNumber;
|
|
if (message.revisionHeight != null && message.hasOwnProperty("revisionHeight"))
|
|
if (typeof message.revisionHeight === "number")
|
|
object.revisionHeight = options.longs === String ? String(message.revisionHeight) : message.revisionHeight;
|
|
else
|
|
object.revisionHeight = options.longs === String ? $util.Long.prototype.toString.call(message.revisionHeight) : options.longs === Number ? new $util.LongBits(message.revisionHeight.low >>> 0, message.revisionHeight.high >>> 0).toNumber(true) : message.revisionHeight;
|
|
if (message.latestHeight != null && message.hasOwnProperty("latestHeight"))
|
|
object.latestHeight = message.latestHeight;
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this QueryConsensusStateRequest to JSON.
|
|
* @function toJSON
|
|
* @memberof ibc.core.client.v1.QueryConsensusStateRequest
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
QueryConsensusStateRequest.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return QueryConsensusStateRequest;
|
|
})(v1.QueryConsensusStateRequest || {});
|
|
|
|
v1.QueryConsensusStateResponse = (function(QueryConsensusStateResponse) {
|
|
|
|
/**
|
|
* Properties of a QueryConsensusStateResponse.
|
|
* @memberof ibc.core.client.v1
|
|
* @interface IQueryConsensusStateResponse
|
|
* @property {google.protobuf.IAny|null} [consensusState] QueryConsensusStateResponse consensusState
|
|
* @property {Uint8Array|null} [proof] QueryConsensusStateResponse proof
|
|
* @property {ibc.core.client.v1.IHeight|null} [proofHeight] QueryConsensusStateResponse proofHeight
|
|
*/
|
|
|
|
/**
|
|
* 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 consensusState.
|
|
* @member {google.protobuf.IAny|null|undefined} consensusState
|
|
* @memberof ibc.core.client.v1.QueryConsensusStateResponse
|
|
* @instance
|
|
*/
|
|
QueryConsensusStateResponse.prototype.consensusState = null;
|
|
|
|
/**
|
|
* QueryConsensusStateResponse proof.
|
|
* @member {Uint8Array} proof
|
|
* @memberof ibc.core.client.v1.QueryConsensusStateResponse
|
|
* @instance
|
|
*/
|
|
QueryConsensusStateResponse.prototype.proof = $util.newBuffer([]);
|
|
|
|
/**
|
|
* QueryConsensusStateResponse proofHeight.
|
|
* @member {ibc.core.client.v1.IHeight|null|undefined} proofHeight
|
|
* @memberof ibc.core.client.v1.QueryConsensusStateResponse
|
|
* @instance
|
|
*/
|
|
QueryConsensusStateResponse.prototype.proofHeight = null;
|
|
|
|
/**
|
|
* Creates a new QueryConsensusStateResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.QueryConsensusStateResponse
|
|
* @static
|
|
* @param {ibc.core.client.v1.IQueryConsensusStateResponse=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.QueryConsensusStateResponse} QueryConsensusStateResponse instance
|
|
*/
|
|
QueryConsensusStateResponse.create = function create(properties) {
|
|
return new QueryConsensusStateResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.consensusState != null && Object.hasOwnProperty.call(message, "consensusState"))
|
|
$root.google.protobuf.Any.encode(message.consensusState, 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.proofHeight != null && Object.hasOwnProperty.call(message, "proofHeight"))
|
|
$root.ibc.core.client.v1.Height.encode(message.proofHeight, 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.consensusState = $root.google.protobuf.Any.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
message.proof = reader.bytes();
|
|
break;
|
|
case 3:
|
|
message.proofHeight = $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.<string,*>} 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.consensusState != null && message.hasOwnProperty("consensusState")) {
|
|
var error = $root.google.protobuf.Any.verify(message.consensusState);
|
|
if (error)
|
|
return "consensusState." + 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.proofHeight != null && message.hasOwnProperty("proofHeight")) {
|
|
var error = $root.ibc.core.client.v1.Height.verify(message.proofHeight);
|
|
if (error)
|
|
return "proofHeight." + 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.<string,*>} 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.consensusState != null) {
|
|
if (typeof object.consensusState !== "object")
|
|
throw TypeError(".ibc.core.client.v1.QueryConsensusStateResponse.consensusState: object expected");
|
|
message.consensusState = $root.google.protobuf.Any.fromObject(object.consensusState);
|
|
}
|
|
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.proofHeight != null) {
|
|
if (typeof object.proofHeight !== "object")
|
|
throw TypeError(".ibc.core.client.v1.QueryConsensusStateResponse.proofHeight: object expected");
|
|
message.proofHeight = $root.ibc.core.client.v1.Height.fromObject(object.proofHeight);
|
|
}
|
|
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.<string,*>} Plain object
|
|
*/
|
|
QueryConsensusStateResponse.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.consensusState = null;
|
|
if (options.bytes === String)
|
|
object.proof = "";
|
|
else {
|
|
object.proof = [];
|
|
if (options.bytes !== Array)
|
|
object.proof = $util.newBuffer(object.proof);
|
|
}
|
|
object.proofHeight = null;
|
|
}
|
|
if (message.consensusState != null && message.hasOwnProperty("consensusState"))
|
|
object.consensusState = $root.google.protobuf.Any.toObject(message.consensusState, 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.proofHeight != null && message.hasOwnProperty("proofHeight"))
|
|
object.proofHeight = $root.ibc.core.client.v1.Height.toObject(message.proofHeight, options);
|
|
return object;
|
|
};
|
|
|
|
/**
|
|
* Converts this QueryConsensusStateResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof ibc.core.client.v1.QueryConsensusStateResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
QueryConsensusStateResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return QueryConsensusStateResponse;
|
|
})(v1.QueryConsensusStateResponse || {});
|
|
|
|
v1.QueryConsensusStatesRequest = (function(QueryConsensusStatesRequest) {
|
|
|
|
/**
|
|
* Properties of a QueryConsensusStatesRequest.
|
|
* @memberof ibc.core.client.v1
|
|
* @interface IQueryConsensusStatesRequest
|
|
* @property {string|null} [clientId] QueryConsensusStatesRequest clientId
|
|
* @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 clientId.
|
|
* @member {string} clientId
|
|
* @memberof ibc.core.client.v1.QueryConsensusStatesRequest
|
|
* @instance
|
|
*/
|
|
QueryConsensusStatesRequest.prototype.clientId = "";
|
|
|
|
/**
|
|
* QueryConsensusStatesRequest pagination.
|
|
* @member {cosmos.base.query.v1beta1.IPageRequest|null|undefined} pagination
|
|
* @memberof ibc.core.client.v1.QueryConsensusStatesRequest
|
|
* @instance
|
|
*/
|
|
QueryConsensusStatesRequest.prototype.pagination = null;
|
|
|
|
/**
|
|
* Creates a new QueryConsensusStatesRequest instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.QueryConsensusStatesRequest
|
|
* @static
|
|
* @param {ibc.core.client.v1.IQueryConsensusStatesRequest=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.QueryConsensusStatesRequest} QueryConsensusStatesRequest instance
|
|
*/
|
|
QueryConsensusStatesRequest.create = function create(properties) {
|
|
return new QueryConsensusStatesRequest(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.clientId != null && Object.hasOwnProperty.call(message, "clientId"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId);
|
|
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.clientId = 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.<string,*>} 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.clientId != null && message.hasOwnProperty("clientId"))
|
|
if (!$util.isString(message.clientId))
|
|
return "clientId: 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.<string,*>} 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.clientId != null)
|
|
message.clientId = String(object.clientId);
|
|
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.<string,*>} Plain object
|
|
*/
|
|
QueryConsensusStatesRequest.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.clientId = "";
|
|
object.pagination = null;
|
|
}
|
|
if (message.clientId != null && message.hasOwnProperty("clientId"))
|
|
object.clientId = message.clientId;
|
|
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.<string,*>} JSON object
|
|
*/
|
|
QueryConsensusStatesRequest.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return QueryConsensusStatesRequest;
|
|
})(v1.QueryConsensusStatesRequest || {});
|
|
|
|
v1.QueryConsensusStatesResponse = (function(QueryConsensusStatesResponse) {
|
|
|
|
/**
|
|
* Properties of a QueryConsensusStatesResponse.
|
|
* @memberof ibc.core.client.v1
|
|
* @interface IQueryConsensusStatesResponse
|
|
* @property {Array.<ibc.core.client.v1.IConsensusStateWithHeight>|null} [consensusStates] QueryConsensusStatesResponse consensusStates
|
|
* @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.consensusStates = [];
|
|
if (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 consensusStates.
|
|
* @member {Array.<ibc.core.client.v1.IConsensusStateWithHeight>} consensusStates
|
|
* @memberof ibc.core.client.v1.QueryConsensusStatesResponse
|
|
* @instance
|
|
*/
|
|
QueryConsensusStatesResponse.prototype.consensusStates = $util.emptyArray;
|
|
|
|
/**
|
|
* QueryConsensusStatesResponse pagination.
|
|
* @member {cosmos.base.query.v1beta1.IPageResponse|null|undefined} pagination
|
|
* @memberof ibc.core.client.v1.QueryConsensusStatesResponse
|
|
* @instance
|
|
*/
|
|
QueryConsensusStatesResponse.prototype.pagination = null;
|
|
|
|
/**
|
|
* Creates a new QueryConsensusStatesResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.QueryConsensusStatesResponse
|
|
* @static
|
|
* @param {ibc.core.client.v1.IQueryConsensusStatesResponse=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.QueryConsensusStatesResponse} QueryConsensusStatesResponse instance
|
|
*/
|
|
QueryConsensusStatesResponse.create = function create(properties) {
|
|
return new QueryConsensusStatesResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.consensusStates != null && message.consensusStates.length)
|
|
for (var i = 0; i < message.consensusStates.length; ++i)
|
|
$root.ibc.core.client.v1.ConsensusStateWithHeight.encode(message.consensusStates[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.consensusStates && message.consensusStates.length))
|
|
message.consensusStates = [];
|
|
message.consensusStates.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.<string,*>} 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.consensusStates != null && message.hasOwnProperty("consensusStates")) {
|
|
if (!Array.isArray(message.consensusStates))
|
|
return "consensusStates: array expected";
|
|
for (var i = 0; i < message.consensusStates.length; ++i) {
|
|
var error = $root.ibc.core.client.v1.ConsensusStateWithHeight.verify(message.consensusStates[i]);
|
|
if (error)
|
|
return "consensusStates." + 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.<string,*>} 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.consensusStates) {
|
|
if (!Array.isArray(object.consensusStates))
|
|
throw TypeError(".ibc.core.client.v1.QueryConsensusStatesResponse.consensusStates: array expected");
|
|
message.consensusStates = [];
|
|
for (var i = 0; i < object.consensusStates.length; ++i) {
|
|
if (typeof object.consensusStates[i] !== "object")
|
|
throw TypeError(".ibc.core.client.v1.QueryConsensusStatesResponse.consensusStates: object expected");
|
|
message.consensusStates[i] = $root.ibc.core.client.v1.ConsensusStateWithHeight.fromObject(object.consensusStates[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.<string,*>} Plain object
|
|
*/
|
|
QueryConsensusStatesResponse.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.arrays || options.defaults)
|
|
object.consensusStates = [];
|
|
if (options.defaults)
|
|
object.pagination = null;
|
|
if (message.consensusStates && message.consensusStates.length) {
|
|
object.consensusStates = [];
|
|
for (var j = 0; j < message.consensusStates.length; ++j)
|
|
object.consensusStates[j] = $root.ibc.core.client.v1.ConsensusStateWithHeight.toObject(message.consensusStates[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.<string,*>} JSON object
|
|
*/
|
|
QueryConsensusStatesResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return QueryConsensusStatesResponse;
|
|
})(v1.QueryConsensusStatesResponse || {});
|
|
|
|
v1.QueryClientParamsRequest = (function(QueryClientParamsRequest) {
|
|
|
|
/**
|
|
* 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]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new QueryClientParamsRequest instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.QueryClientParamsRequest
|
|
* @static
|
|
* @param {ibc.core.client.v1.IQueryClientParamsRequest=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.QueryClientParamsRequest} QueryClientParamsRequest instance
|
|
*/
|
|
QueryClientParamsRequest.create = function create(properties) {
|
|
return new QueryClientParamsRequest(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} Plain object
|
|
*/
|
|
QueryClientParamsRequest.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this QueryClientParamsRequest to JSON.
|
|
* @function toJSON
|
|
* @memberof ibc.core.client.v1.QueryClientParamsRequest
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
QueryClientParamsRequest.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return QueryClientParamsRequest;
|
|
})(v1.QueryClientParamsRequest || {});
|
|
|
|
v1.QueryClientParamsResponse = (function(QueryClientParamsResponse) {
|
|
|
|
/**
|
|
* 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;
|
|
|
|
/**
|
|
* Creates a new QueryClientParamsResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.QueryClientParamsResponse
|
|
* @static
|
|
* @param {ibc.core.client.v1.IQueryClientParamsResponse=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.QueryClientParamsResponse} QueryClientParamsResponse instance
|
|
*/
|
|
QueryClientParamsResponse.create = function create(properties) {
|
|
return new QueryClientParamsResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} 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.<string,*>} JSON object
|
|
*/
|
|
QueryClientParamsResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return QueryClientParamsResponse;
|
|
})(v1.QueryClientParamsResponse || {});
|
|
|
|
v1.Msg = (function(Msg) {
|
|
|
|
/**
|
|
* 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;
|
|
|
|
/**
|
|
* Creates new Msg service using the specified rpc implementation.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.Msg
|
|
* @static
|
|
* @param {$protobuf.RPCImpl} rpcImpl RPC implementation
|
|
* @param {boolean} [requestDelimited=false] Whether requests are length-delimited
|
|
* @param {boolean} [responseDelimited=false] Whether responses are length-delimited
|
|
* @returns {Msg} RPC service. Useful where requests and/or responses are streamed.
|
|
*/
|
|
Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) {
|
|
return new this(rpcImpl, requestDelimited, responseDelimited);
|
|
};
|
|
|
|
/**
|
|
* 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.IMsgCreateClientResponse} [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<ibc.core.client.v1.IMsgCreateClientResponse>} 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.IMsgUpdateClientResponse} [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<ibc.core.client.v1.IMsgUpdateClientResponse>} 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.IMsgUpgradeClientResponse} [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<ibc.core.client.v1.IMsgUpgradeClientResponse>} 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.IMsgSubmitMisbehaviourResponse} [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<ibc.core.client.v1.IMsgSubmitMisbehaviourResponse>} Promise
|
|
* @variation 2
|
|
*/
|
|
|
|
return Msg;
|
|
})(v1.Msg || {});
|
|
|
|
v1.MsgCreateClient = (function(MsgCreateClient) {
|
|
|
|
/**
|
|
* Properties of a MsgCreateClient.
|
|
* @memberof ibc.core.client.v1
|
|
* @interface IMsgCreateClient
|
|
* @property {google.protobuf.IAny|null} [clientState] MsgCreateClient clientState
|
|
* @property {google.protobuf.IAny|null} [consensusState] MsgCreateClient consensusState
|
|
* @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 clientState.
|
|
* @member {google.protobuf.IAny|null|undefined} clientState
|
|
* @memberof ibc.core.client.v1.MsgCreateClient
|
|
* @instance
|
|
*/
|
|
MsgCreateClient.prototype.clientState = null;
|
|
|
|
/**
|
|
* MsgCreateClient consensusState.
|
|
* @member {google.protobuf.IAny|null|undefined} consensusState
|
|
* @memberof ibc.core.client.v1.MsgCreateClient
|
|
* @instance
|
|
*/
|
|
MsgCreateClient.prototype.consensusState = null;
|
|
|
|
/**
|
|
* MsgCreateClient signer.
|
|
* @member {string} signer
|
|
* @memberof ibc.core.client.v1.MsgCreateClient
|
|
* @instance
|
|
*/
|
|
MsgCreateClient.prototype.signer = "";
|
|
|
|
/**
|
|
* Creates a new MsgCreateClient instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.MsgCreateClient
|
|
* @static
|
|
* @param {ibc.core.client.v1.IMsgCreateClient=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.MsgCreateClient} MsgCreateClient instance
|
|
*/
|
|
MsgCreateClient.create = function create(properties) {
|
|
return new MsgCreateClient(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.clientState != null && Object.hasOwnProperty.call(message, "clientState"))
|
|
$root.google.protobuf.Any.encode(message.clientState, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
if (message.consensusState != null && Object.hasOwnProperty.call(message, "consensusState"))
|
|
$root.google.protobuf.Any.encode(message.consensusState, 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.clientState = $root.google.protobuf.Any.decode(reader, reader.uint32());
|
|
break;
|
|
case 2:
|
|
message.consensusState = $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.<string,*>} 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.clientState != null && message.hasOwnProperty("clientState")) {
|
|
var error = $root.google.protobuf.Any.verify(message.clientState);
|
|
if (error)
|
|
return "clientState." + error;
|
|
}
|
|
if (message.consensusState != null && message.hasOwnProperty("consensusState")) {
|
|
var error = $root.google.protobuf.Any.verify(message.consensusState);
|
|
if (error)
|
|
return "consensusState." + 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.<string,*>} 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.clientState != null) {
|
|
if (typeof object.clientState !== "object")
|
|
throw TypeError(".ibc.core.client.v1.MsgCreateClient.clientState: object expected");
|
|
message.clientState = $root.google.protobuf.Any.fromObject(object.clientState);
|
|
}
|
|
if (object.consensusState != null) {
|
|
if (typeof object.consensusState !== "object")
|
|
throw TypeError(".ibc.core.client.v1.MsgCreateClient.consensusState: object expected");
|
|
message.consensusState = $root.google.protobuf.Any.fromObject(object.consensusState);
|
|
}
|
|
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.<string,*>} Plain object
|
|
*/
|
|
MsgCreateClient.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.clientState = null;
|
|
object.consensusState = null;
|
|
object.signer = "";
|
|
}
|
|
if (message.clientState != null && message.hasOwnProperty("clientState"))
|
|
object.clientState = $root.google.protobuf.Any.toObject(message.clientState, options);
|
|
if (message.consensusState != null && message.hasOwnProperty("consensusState"))
|
|
object.consensusState = $root.google.protobuf.Any.toObject(message.consensusState, 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.<string,*>} JSON object
|
|
*/
|
|
MsgCreateClient.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgCreateClient;
|
|
})(v1.MsgCreateClient || {});
|
|
|
|
v1.MsgCreateClientResponse = (function(MsgCreateClientResponse) {
|
|
|
|
/**
|
|
* 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]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new MsgCreateClientResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.MsgCreateClientResponse
|
|
* @static
|
|
* @param {ibc.core.client.v1.IMsgCreateClientResponse=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.MsgCreateClientResponse} MsgCreateClientResponse instance
|
|
*/
|
|
MsgCreateClientResponse.create = function create(properties) {
|
|
return new MsgCreateClientResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} Plain object
|
|
*/
|
|
MsgCreateClientResponse.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgCreateClientResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof ibc.core.client.v1.MsgCreateClientResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgCreateClientResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgCreateClientResponse;
|
|
})(v1.MsgCreateClientResponse || {});
|
|
|
|
v1.MsgUpdateClient = (function(MsgUpdateClient) {
|
|
|
|
/**
|
|
* Properties of a MsgUpdateClient.
|
|
* @memberof ibc.core.client.v1
|
|
* @interface IMsgUpdateClient
|
|
* @property {string|null} [clientId] MsgUpdateClient clientId
|
|
* @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 clientId.
|
|
* @member {string} clientId
|
|
* @memberof ibc.core.client.v1.MsgUpdateClient
|
|
* @instance
|
|
*/
|
|
MsgUpdateClient.prototype.clientId = "";
|
|
|
|
/**
|
|
* 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 = "";
|
|
|
|
/**
|
|
* Creates a new MsgUpdateClient instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.MsgUpdateClient
|
|
* @static
|
|
* @param {ibc.core.client.v1.IMsgUpdateClient=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.MsgUpdateClient} MsgUpdateClient instance
|
|
*/
|
|
MsgUpdateClient.create = function create(properties) {
|
|
return new MsgUpdateClient(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.clientId != null && Object.hasOwnProperty.call(message, "clientId"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId);
|
|
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.clientId = 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.<string,*>} 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.clientId != null && message.hasOwnProperty("clientId"))
|
|
if (!$util.isString(message.clientId))
|
|
return "clientId: 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.<string,*>} 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.clientId != null)
|
|
message.clientId = String(object.clientId);
|
|
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.<string,*>} Plain object
|
|
*/
|
|
MsgUpdateClient.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.clientId = "";
|
|
object.header = null;
|
|
object.signer = "";
|
|
}
|
|
if (message.clientId != null && message.hasOwnProperty("clientId"))
|
|
object.clientId = message.clientId;
|
|
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.<string,*>} JSON object
|
|
*/
|
|
MsgUpdateClient.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgUpdateClient;
|
|
})(v1.MsgUpdateClient || {});
|
|
|
|
v1.MsgUpdateClientResponse = (function(MsgUpdateClientResponse) {
|
|
|
|
/**
|
|
* 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]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new MsgUpdateClientResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.MsgUpdateClientResponse
|
|
* @static
|
|
* @param {ibc.core.client.v1.IMsgUpdateClientResponse=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.MsgUpdateClientResponse} MsgUpdateClientResponse instance
|
|
*/
|
|
MsgUpdateClientResponse.create = function create(properties) {
|
|
return new MsgUpdateClientResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} Plain object
|
|
*/
|
|
MsgUpdateClientResponse.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgUpdateClientResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof ibc.core.client.v1.MsgUpdateClientResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgUpdateClientResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgUpdateClientResponse;
|
|
})(v1.MsgUpdateClientResponse || {});
|
|
|
|
v1.MsgUpgradeClient = (function(MsgUpgradeClient) {
|
|
|
|
/**
|
|
* Properties of a MsgUpgradeClient.
|
|
* @memberof ibc.core.client.v1
|
|
* @interface IMsgUpgradeClient
|
|
* @property {string|null} [clientId] MsgUpgradeClient clientId
|
|
* @property {google.protobuf.IAny|null} [clientState] MsgUpgradeClient clientState
|
|
* @property {google.protobuf.IAny|null} [consensusState] MsgUpgradeClient consensusState
|
|
* @property {Uint8Array|null} [proofUpgradeClient] MsgUpgradeClient proofUpgradeClient
|
|
* @property {Uint8Array|null} [proofUpgradeConsensusState] MsgUpgradeClient proofUpgradeConsensusState
|
|
* @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 clientId.
|
|
* @member {string} clientId
|
|
* @memberof ibc.core.client.v1.MsgUpgradeClient
|
|
* @instance
|
|
*/
|
|
MsgUpgradeClient.prototype.clientId = "";
|
|
|
|
/**
|
|
* MsgUpgradeClient clientState.
|
|
* @member {google.protobuf.IAny|null|undefined} clientState
|
|
* @memberof ibc.core.client.v1.MsgUpgradeClient
|
|
* @instance
|
|
*/
|
|
MsgUpgradeClient.prototype.clientState = null;
|
|
|
|
/**
|
|
* MsgUpgradeClient consensusState.
|
|
* @member {google.protobuf.IAny|null|undefined} consensusState
|
|
* @memberof ibc.core.client.v1.MsgUpgradeClient
|
|
* @instance
|
|
*/
|
|
MsgUpgradeClient.prototype.consensusState = null;
|
|
|
|
/**
|
|
* MsgUpgradeClient proofUpgradeClient.
|
|
* @member {Uint8Array} proofUpgradeClient
|
|
* @memberof ibc.core.client.v1.MsgUpgradeClient
|
|
* @instance
|
|
*/
|
|
MsgUpgradeClient.prototype.proofUpgradeClient = $util.newBuffer([]);
|
|
|
|
/**
|
|
* MsgUpgradeClient proofUpgradeConsensusState.
|
|
* @member {Uint8Array} proofUpgradeConsensusState
|
|
* @memberof ibc.core.client.v1.MsgUpgradeClient
|
|
* @instance
|
|
*/
|
|
MsgUpgradeClient.prototype.proofUpgradeConsensusState = $util.newBuffer([]);
|
|
|
|
/**
|
|
* MsgUpgradeClient signer.
|
|
* @member {string} signer
|
|
* @memberof ibc.core.client.v1.MsgUpgradeClient
|
|
* @instance
|
|
*/
|
|
MsgUpgradeClient.prototype.signer = "";
|
|
|
|
/**
|
|
* Creates a new MsgUpgradeClient instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.MsgUpgradeClient
|
|
* @static
|
|
* @param {ibc.core.client.v1.IMsgUpgradeClient=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.MsgUpgradeClient} MsgUpgradeClient instance
|
|
*/
|
|
MsgUpgradeClient.create = function create(properties) {
|
|
return new MsgUpgradeClient(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.clientId != null && Object.hasOwnProperty.call(message, "clientId"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId);
|
|
if (message.clientState != null && Object.hasOwnProperty.call(message, "clientState"))
|
|
$root.google.protobuf.Any.encode(message.clientState, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
if (message.consensusState != null && Object.hasOwnProperty.call(message, "consensusState"))
|
|
$root.google.protobuf.Any.encode(message.consensusState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
|
if (message.proofUpgradeClient != null && Object.hasOwnProperty.call(message, "proofUpgradeClient"))
|
|
writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.proofUpgradeClient);
|
|
if (message.proofUpgradeConsensusState != null && Object.hasOwnProperty.call(message, "proofUpgradeConsensusState"))
|
|
writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.proofUpgradeConsensusState);
|
|
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.clientId = reader.string();
|
|
break;
|
|
case 2:
|
|
message.clientState = $root.google.protobuf.Any.decode(reader, reader.uint32());
|
|
break;
|
|
case 3:
|
|
message.consensusState = $root.google.protobuf.Any.decode(reader, reader.uint32());
|
|
break;
|
|
case 4:
|
|
message.proofUpgradeClient = reader.bytes();
|
|
break;
|
|
case 5:
|
|
message.proofUpgradeConsensusState = 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.<string,*>} 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.clientId != null && message.hasOwnProperty("clientId"))
|
|
if (!$util.isString(message.clientId))
|
|
return "clientId: string expected";
|
|
if (message.clientState != null && message.hasOwnProperty("clientState")) {
|
|
var error = $root.google.protobuf.Any.verify(message.clientState);
|
|
if (error)
|
|
return "clientState." + error;
|
|
}
|
|
if (message.consensusState != null && message.hasOwnProperty("consensusState")) {
|
|
var error = $root.google.protobuf.Any.verify(message.consensusState);
|
|
if (error)
|
|
return "consensusState." + error;
|
|
}
|
|
if (message.proofUpgradeClient != null && message.hasOwnProperty("proofUpgradeClient"))
|
|
if (!(message.proofUpgradeClient && typeof message.proofUpgradeClient.length === "number" || $util.isString(message.proofUpgradeClient)))
|
|
return "proofUpgradeClient: buffer expected";
|
|
if (message.proofUpgradeConsensusState != null && message.hasOwnProperty("proofUpgradeConsensusState"))
|
|
if (!(message.proofUpgradeConsensusState && typeof message.proofUpgradeConsensusState.length === "number" || $util.isString(message.proofUpgradeConsensusState)))
|
|
return "proofUpgradeConsensusState: 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.<string,*>} 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.clientId != null)
|
|
message.clientId = String(object.clientId);
|
|
if (object.clientState != null) {
|
|
if (typeof object.clientState !== "object")
|
|
throw TypeError(".ibc.core.client.v1.MsgUpgradeClient.clientState: object expected");
|
|
message.clientState = $root.google.protobuf.Any.fromObject(object.clientState);
|
|
}
|
|
if (object.consensusState != null) {
|
|
if (typeof object.consensusState !== "object")
|
|
throw TypeError(".ibc.core.client.v1.MsgUpgradeClient.consensusState: object expected");
|
|
message.consensusState = $root.google.protobuf.Any.fromObject(object.consensusState);
|
|
}
|
|
if (object.proofUpgradeClient != null)
|
|
if (typeof object.proofUpgradeClient === "string")
|
|
$util.base64.decode(object.proofUpgradeClient, message.proofUpgradeClient = $util.newBuffer($util.base64.length(object.proofUpgradeClient)), 0);
|
|
else if (object.proofUpgradeClient.length)
|
|
message.proofUpgradeClient = object.proofUpgradeClient;
|
|
if (object.proofUpgradeConsensusState != null)
|
|
if (typeof object.proofUpgradeConsensusState === "string")
|
|
$util.base64.decode(object.proofUpgradeConsensusState, message.proofUpgradeConsensusState = $util.newBuffer($util.base64.length(object.proofUpgradeConsensusState)), 0);
|
|
else if (object.proofUpgradeConsensusState.length)
|
|
message.proofUpgradeConsensusState = object.proofUpgradeConsensusState;
|
|
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.<string,*>} Plain object
|
|
*/
|
|
MsgUpgradeClient.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.clientId = "";
|
|
object.clientState = null;
|
|
object.consensusState = null;
|
|
if (options.bytes === String)
|
|
object.proofUpgradeClient = "";
|
|
else {
|
|
object.proofUpgradeClient = [];
|
|
if (options.bytes !== Array)
|
|
object.proofUpgradeClient = $util.newBuffer(object.proofUpgradeClient);
|
|
}
|
|
if (options.bytes === String)
|
|
object.proofUpgradeConsensusState = "";
|
|
else {
|
|
object.proofUpgradeConsensusState = [];
|
|
if (options.bytes !== Array)
|
|
object.proofUpgradeConsensusState = $util.newBuffer(object.proofUpgradeConsensusState);
|
|
}
|
|
object.signer = "";
|
|
}
|
|
if (message.clientId != null && message.hasOwnProperty("clientId"))
|
|
object.clientId = message.clientId;
|
|
if (message.clientState != null && message.hasOwnProperty("clientState"))
|
|
object.clientState = $root.google.protobuf.Any.toObject(message.clientState, options);
|
|
if (message.consensusState != null && message.hasOwnProperty("consensusState"))
|
|
object.consensusState = $root.google.protobuf.Any.toObject(message.consensusState, options);
|
|
if (message.proofUpgradeClient != null && message.hasOwnProperty("proofUpgradeClient"))
|
|
object.proofUpgradeClient = options.bytes === String ? $util.base64.encode(message.proofUpgradeClient, 0, message.proofUpgradeClient.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofUpgradeClient) : message.proofUpgradeClient;
|
|
if (message.proofUpgradeConsensusState != null && message.hasOwnProperty("proofUpgradeConsensusState"))
|
|
object.proofUpgradeConsensusState = options.bytes === String ? $util.base64.encode(message.proofUpgradeConsensusState, 0, message.proofUpgradeConsensusState.length) : options.bytes === Array ? Array.prototype.slice.call(message.proofUpgradeConsensusState) : message.proofUpgradeConsensusState;
|
|
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.<string,*>} JSON object
|
|
*/
|
|
MsgUpgradeClient.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgUpgradeClient;
|
|
})(v1.MsgUpgradeClient || {});
|
|
|
|
v1.MsgUpgradeClientResponse = (function(MsgUpgradeClientResponse) {
|
|
|
|
/**
|
|
* 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]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new MsgUpgradeClientResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.MsgUpgradeClientResponse
|
|
* @static
|
|
* @param {ibc.core.client.v1.IMsgUpgradeClientResponse=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.MsgUpgradeClientResponse} MsgUpgradeClientResponse instance
|
|
*/
|
|
MsgUpgradeClientResponse.create = function create(properties) {
|
|
return new MsgUpgradeClientResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} Plain object
|
|
*/
|
|
MsgUpgradeClientResponse.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgUpgradeClientResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof ibc.core.client.v1.MsgUpgradeClientResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgUpgradeClientResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgUpgradeClientResponse;
|
|
})(v1.MsgUpgradeClientResponse || {});
|
|
|
|
v1.MsgSubmitMisbehaviour = (function(MsgSubmitMisbehaviour) {
|
|
|
|
/**
|
|
* Properties of a MsgSubmitMisbehaviour.
|
|
* @memberof ibc.core.client.v1
|
|
* @interface IMsgSubmitMisbehaviour
|
|
* @property {string|null} [clientId] MsgSubmitMisbehaviour clientId
|
|
* @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 clientId.
|
|
* @member {string} clientId
|
|
* @memberof ibc.core.client.v1.MsgSubmitMisbehaviour
|
|
* @instance
|
|
*/
|
|
MsgSubmitMisbehaviour.prototype.clientId = "";
|
|
|
|
/**
|
|
* 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 = "";
|
|
|
|
/**
|
|
* Creates a new MsgSubmitMisbehaviour instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.MsgSubmitMisbehaviour
|
|
* @static
|
|
* @param {ibc.core.client.v1.IMsgSubmitMisbehaviour=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.MsgSubmitMisbehaviour} MsgSubmitMisbehaviour instance
|
|
*/
|
|
MsgSubmitMisbehaviour.create = function create(properties) {
|
|
return new MsgSubmitMisbehaviour(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.clientId != null && Object.hasOwnProperty.call(message, "clientId"))
|
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId);
|
|
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.clientId = 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.<string,*>} 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.clientId != null && message.hasOwnProperty("clientId"))
|
|
if (!$util.isString(message.clientId))
|
|
return "clientId: 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.<string,*>} 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.clientId != null)
|
|
message.clientId = String(object.clientId);
|
|
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.<string,*>} Plain object
|
|
*/
|
|
MsgSubmitMisbehaviour.toObject = function toObject(message, options) {
|
|
if (!options)
|
|
options = {};
|
|
var object = {};
|
|
if (options.defaults) {
|
|
object.clientId = "";
|
|
object.misbehaviour = null;
|
|
object.signer = "";
|
|
}
|
|
if (message.clientId != null && message.hasOwnProperty("clientId"))
|
|
object.clientId = message.clientId;
|
|
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.<string,*>} JSON object
|
|
*/
|
|
MsgSubmitMisbehaviour.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgSubmitMisbehaviour;
|
|
})(v1.MsgSubmitMisbehaviour || {});
|
|
|
|
v1.MsgSubmitMisbehaviourResponse = (function(MsgSubmitMisbehaviourResponse) {
|
|
|
|
/**
|
|
* 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]];
|
|
}
|
|
|
|
/**
|
|
* Creates a new MsgSubmitMisbehaviourResponse instance using the specified properties.
|
|
* @function create
|
|
* @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse
|
|
* @static
|
|
* @param {ibc.core.client.v1.IMsgSubmitMisbehaviourResponse=} [properties] Properties to set
|
|
* @returns {ibc.core.client.v1.MsgSubmitMisbehaviourResponse} MsgSubmitMisbehaviourResponse instance
|
|
*/
|
|
MsgSubmitMisbehaviourResponse.create = function create(properties) {
|
|
return new MsgSubmitMisbehaviourResponse(properties);
|
|
};
|
|
|
|
/**
|
|
* 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.<string,*>} 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.<string,*>} 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.<string,*>} Plain object
|
|
*/
|
|
MsgSubmitMisbehaviourResponse.toObject = function toObject() {
|
|
return {};
|
|
};
|
|
|
|
/**
|
|
* Converts this MsgSubmitMisbehaviourResponse to JSON.
|
|
* @function toJSON
|
|
* @memberof ibc.core.client.v1.MsgSubmitMisbehaviourResponse
|
|
* @instance
|
|
* @returns {Object.<string,*>} JSON object
|
|
*/
|
|
MsgSubmitMisbehaviourResponse.prototype.toJSON = function toJSON() {
|
|
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
};
|
|
|
|
return MsgSubmitMisbehaviourResponse;
|
|
})(v1.MsgSubmitMisbehaviourResponse || {});
|
|
|
|
return v1;
|
|
})(client.v1 || {});
|
|
|
|
return client;
|
|
})(core.client || {});
|
|
|
|
return core;
|
|
})(ibc.core || {});
|
|
|
|
return ibc;
|
|
})($root.ibc || {});
|
|
|
|
module.exports = $root;
|