Current section

Files

Jump to
forge_abi lib protobuf gen_js state_pb.js
Raw

lib/protobuf/gen_js/state_pb.js

/**
* @fileoverview
* @enhanceable
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var google_protobuf_any_pb = require('google-protobuf/google/protobuf/any_pb.js');
goog.object.extend(proto, google_protobuf_any_pb);
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js');
goog.object.extend(proto, google_protobuf_timestamp_pb);
var type_pb = require('./type_pb.js');
goog.object.extend(proto, type_pb);
goog.exportSymbol('proto.forge_abi.AccountState', null, global);
goog.exportSymbol('proto.forge_abi.AssetState', null, global);
goog.exportSymbol('proto.forge_abi.BlacklistState', null, global);
goog.exportSymbol('proto.forge_abi.ForgeState', null, global);
goog.exportSymbol('proto.forge_abi.RootState', null, global);
goog.exportSymbol('proto.forge_abi.StakeState', null, global);
goog.exportSymbol('proto.forge_abi.StatisticsState', null, global);
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.forge_abi.AccountState = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.forge_abi.AccountState.repeatedFields_, null);
};
goog.inherits(proto.forge_abi.AccountState, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.forge_abi.AccountState.displayName = 'proto.forge_abi.AccountState';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.forge_abi.AccountState.repeatedFields_ = [13,14];
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.forge_abi.AccountState.prototype.toObject = function(opt_includeInstance) {
return proto.forge_abi.AccountState.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.forge_abi.AccountState} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.forge_abi.AccountState.toObject = function(includeInstance, msg) {
var f, obj = {
balance: (f = msg.getBalance()) && type_pb.BigUint.toObject(includeInstance, f),
nonce: jspb.Message.getFieldWithDefault(msg, 2, 0),
numTxs: jspb.Message.getFieldWithDefault(msg, 3, 0),
address: jspb.Message.getFieldWithDefault(msg, 4, ""),
pk: msg.getPk_asB64(),
type: (f = msg.getType()) && type_pb.WalletType.toObject(includeInstance, f),
moniker: jspb.Message.getFieldWithDefault(msg, 7, ""),
context: (f = msg.getContext()) && type_pb.StateContext.toObject(includeInstance, f),
issuer: jspb.Message.getFieldWithDefault(msg, 9, ""),
migratedToList: jspb.Message.getRepeatedField(msg, 13),
migratedFromList: jspb.Message.getRepeatedField(msg, 14),
numAssets: jspb.Message.getFieldWithDefault(msg, 15, 0),
stake: (f = msg.getStake()) && type_pb.StakeContext.toObject(includeInstance, f),
pinnedFiles: (f = msg.getPinnedFiles()) && type_pb.CircularQueue.toObject(includeInstance, f),
poke: (f = msg.getPoke()) && type_pb.PokeInfo.toObject(includeInstance, f),
data: (f = msg.getData()) && google_protobuf_any_pb.Any.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.forge_abi.AccountState}
*/
proto.forge_abi.AccountState.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.forge_abi.AccountState;
return proto.forge_abi.AccountState.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.forge_abi.AccountState} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.forge_abi.AccountState}
*/
proto.forge_abi.AccountState.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new type_pb.BigUint;
reader.readMessage(value,type_pb.BigUint.deserializeBinaryFromReader);
msg.setBalance(value);
break;
case 2:
var value = /** @type {number} */ (reader.readUint64());
msg.setNonce(value);
break;
case 3:
var value = /** @type {number} */ (reader.readUint64());
msg.setNumTxs(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setAddress(value);
break;
case 5:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setPk(value);
break;
case 6:
var value = new type_pb.WalletType;
reader.readMessage(value,type_pb.WalletType.deserializeBinaryFromReader);
msg.setType(value);
break;
case 7:
var value = /** @type {string} */ (reader.readString());
msg.setMoniker(value);
break;
case 8:
var value = new type_pb.StateContext;
reader.readMessage(value,type_pb.StateContext.deserializeBinaryFromReader);
msg.setContext(value);
break;
case 9:
var value = /** @type {string} */ (reader.readString());
msg.setIssuer(value);
break;
case 13:
var value = /** @type {string} */ (reader.readString());
msg.addMigratedTo(value);
break;
case 14:
var value = /** @type {string} */ (reader.readString());
msg.addMigratedFrom(value);
break;
case 15:
var value = /** @type {number} */ (reader.readUint64());
msg.setNumAssets(value);
break;
case 16:
var value = new type_pb.StakeContext;
reader.readMessage(value,type_pb.StakeContext.deserializeBinaryFromReader);
msg.setStake(value);
break;
case 17:
var value = new type_pb.CircularQueue;
reader.readMessage(value,type_pb.CircularQueue.deserializeBinaryFromReader);
msg.setPinnedFiles(value);
break;
case 18:
var value = new type_pb.PokeInfo;
reader.readMessage(value,type_pb.PokeInfo.deserializeBinaryFromReader);
msg.setPoke(value);
break;
case 50:
var value = new google_protobuf_any_pb.Any;
reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
msg.setData(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.forge_abi.AccountState.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.forge_abi.AccountState.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.forge_abi.AccountState} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.forge_abi.AccountState.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getBalance();
if (f != null) {
writer.writeMessage(
1,
f,
type_pb.BigUint.serializeBinaryToWriter
);
}
f = message.getNonce();
if (f !== 0) {
writer.writeUint64(
2,
f
);
}
f = message.getNumTxs();
if (f !== 0) {
writer.writeUint64(
3,
f
);
}
f = message.getAddress();
if (f.length > 0) {
writer.writeString(
4,
f
);
}
f = message.getPk_asU8();
if (f.length > 0) {
writer.writeBytes(
5,
f
);
}
f = message.getType();
if (f != null) {
writer.writeMessage(
6,
f,
type_pb.WalletType.serializeBinaryToWriter
);
}
f = message.getMoniker();
if (f.length > 0) {
writer.writeString(
7,
f
);
}
f = message.getContext();
if (f != null) {
writer.writeMessage(
8,
f,
type_pb.StateContext.serializeBinaryToWriter
);
}
f = message.getIssuer();
if (f.length > 0) {
writer.writeString(
9,
f
);
}
f = message.getMigratedToList();
if (f.length > 0) {
writer.writeRepeatedString(
13,
f
);
}
f = message.getMigratedFromList();
if (f.length > 0) {
writer.writeRepeatedString(
14,
f
);
}
f = message.getNumAssets();
if (f !== 0) {
writer.writeUint64(
15,
f
);
}
f = message.getStake();
if (f != null) {
writer.writeMessage(
16,
f,
type_pb.StakeContext.serializeBinaryToWriter
);
}
f = message.getPinnedFiles();
if (f != null) {
writer.writeMessage(
17,
f,
type_pb.CircularQueue.serializeBinaryToWriter
);
}
f = message.getPoke();
if (f != null) {
writer.writeMessage(
18,
f,
type_pb.PokeInfo.serializeBinaryToWriter
);
}
f = message.getData();
if (f != null) {
writer.writeMessage(
50,
f,
google_protobuf_any_pb.Any.serializeBinaryToWriter
);
}
};
/**
* optional BigUint balance = 1;
* @return {?proto.forge_abi.BigUint}
*/
proto.forge_abi.AccountState.prototype.getBalance = function() {
return /** @type{?proto.forge_abi.BigUint} */ (
jspb.Message.getWrapperField(this, type_pb.BigUint, 1));
};
/** @param {?proto.forge_abi.BigUint|undefined} value */
proto.forge_abi.AccountState.prototype.setBalance = function(value) {
jspb.Message.setWrapperField(this, 1, value);
};
proto.forge_abi.AccountState.prototype.clearBalance = function() {
this.setBalance(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.AccountState.prototype.hasBalance = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional uint64 nonce = 2;
* @return {number}
*/
proto.forge_abi.AccountState.prototype.getNonce = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};
/** @param {number} value */
proto.forge_abi.AccountState.prototype.setNonce = function(value) {
jspb.Message.setProto3IntField(this, 2, value);
};
/**
* optional uint64 num_txs = 3;
* @return {number}
*/
proto.forge_abi.AccountState.prototype.getNumTxs = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
};
/** @param {number} value */
proto.forge_abi.AccountState.prototype.setNumTxs = function(value) {
jspb.Message.setProto3IntField(this, 3, value);
};
/**
* optional string address = 4;
* @return {string}
*/
proto.forge_abi.AccountState.prototype.getAddress = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/** @param {string} value */
proto.forge_abi.AccountState.prototype.setAddress = function(value) {
jspb.Message.setProto3StringField(this, 4, value);
};
/**
* optional bytes pk = 5;
* @return {!(string|Uint8Array)}
*/
proto.forge_abi.AccountState.prototype.getPk = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
};
/**
* optional bytes pk = 5;
* This is a type-conversion wrapper around `getPk()`
* @return {string}
*/
proto.forge_abi.AccountState.prototype.getPk_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getPk()));
};
/**
* optional bytes pk = 5;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getPk()`
* @return {!Uint8Array}
*/
proto.forge_abi.AccountState.prototype.getPk_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getPk()));
};
/** @param {!(string|Uint8Array)} value */
proto.forge_abi.AccountState.prototype.setPk = function(value) {
jspb.Message.setProto3BytesField(this, 5, value);
};
/**
* optional WalletType type = 6;
* @return {?proto.forge_abi.WalletType}
*/
proto.forge_abi.AccountState.prototype.getType = function() {
return /** @type{?proto.forge_abi.WalletType} */ (
jspb.Message.getWrapperField(this, type_pb.WalletType, 6));
};
/** @param {?proto.forge_abi.WalletType|undefined} value */
proto.forge_abi.AccountState.prototype.setType = function(value) {
jspb.Message.setWrapperField(this, 6, value);
};
proto.forge_abi.AccountState.prototype.clearType = function() {
this.setType(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.AccountState.prototype.hasType = function() {
return jspb.Message.getField(this, 6) != null;
};
/**
* optional string moniker = 7;
* @return {string}
*/
proto.forge_abi.AccountState.prototype.getMoniker = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
};
/** @param {string} value */
proto.forge_abi.AccountState.prototype.setMoniker = function(value) {
jspb.Message.setProto3StringField(this, 7, value);
};
/**
* optional StateContext context = 8;
* @return {?proto.forge_abi.StateContext}
*/
proto.forge_abi.AccountState.prototype.getContext = function() {
return /** @type{?proto.forge_abi.StateContext} */ (
jspb.Message.getWrapperField(this, type_pb.StateContext, 8));
};
/** @param {?proto.forge_abi.StateContext|undefined} value */
proto.forge_abi.AccountState.prototype.setContext = function(value) {
jspb.Message.setWrapperField(this, 8, value);
};
proto.forge_abi.AccountState.prototype.clearContext = function() {
this.setContext(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.AccountState.prototype.hasContext = function() {
return jspb.Message.getField(this, 8) != null;
};
/**
* optional string issuer = 9;
* @return {string}
*/
proto.forge_abi.AccountState.prototype.getIssuer = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, ""));
};
/** @param {string} value */
proto.forge_abi.AccountState.prototype.setIssuer = function(value) {
jspb.Message.setProto3StringField(this, 9, value);
};
/**
* repeated string migrated_to = 13;
* @return {!Array<string>}
*/
proto.forge_abi.AccountState.prototype.getMigratedToList = function() {
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 13));
};
/** @param {!Array<string>} value */
proto.forge_abi.AccountState.prototype.setMigratedToList = function(value) {
jspb.Message.setField(this, 13, value || []);
};
/**
* @param {string} value
* @param {number=} opt_index
*/
proto.forge_abi.AccountState.prototype.addMigratedTo = function(value, opt_index) {
jspb.Message.addToRepeatedField(this, 13, value, opt_index);
};
proto.forge_abi.AccountState.prototype.clearMigratedToList = function() {
this.setMigratedToList([]);
};
/**
* repeated string migrated_from = 14;
* @return {!Array<string>}
*/
proto.forge_abi.AccountState.prototype.getMigratedFromList = function() {
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 14));
};
/** @param {!Array<string>} value */
proto.forge_abi.AccountState.prototype.setMigratedFromList = function(value) {
jspb.Message.setField(this, 14, value || []);
};
/**
* @param {string} value
* @param {number=} opt_index
*/
proto.forge_abi.AccountState.prototype.addMigratedFrom = function(value, opt_index) {
jspb.Message.addToRepeatedField(this, 14, value, opt_index);
};
proto.forge_abi.AccountState.prototype.clearMigratedFromList = function() {
this.setMigratedFromList([]);
};
/**
* optional uint64 num_assets = 15;
* @return {number}
*/
proto.forge_abi.AccountState.prototype.getNumAssets = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 15, 0));
};
/** @param {number} value */
proto.forge_abi.AccountState.prototype.setNumAssets = function(value) {
jspb.Message.setProto3IntField(this, 15, value);
};
/**
* optional StakeContext stake = 16;
* @return {?proto.forge_abi.StakeContext}
*/
proto.forge_abi.AccountState.prototype.getStake = function() {
return /** @type{?proto.forge_abi.StakeContext} */ (
jspb.Message.getWrapperField(this, type_pb.StakeContext, 16));
};
/** @param {?proto.forge_abi.StakeContext|undefined} value */
proto.forge_abi.AccountState.prototype.setStake = function(value) {
jspb.Message.setWrapperField(this, 16, value);
};
proto.forge_abi.AccountState.prototype.clearStake = function() {
this.setStake(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.AccountState.prototype.hasStake = function() {
return jspb.Message.getField(this, 16) != null;
};
/**
* optional CircularQueue pinned_files = 17;
* @return {?proto.forge_abi.CircularQueue}
*/
proto.forge_abi.AccountState.prototype.getPinnedFiles = function() {
return /** @type{?proto.forge_abi.CircularQueue} */ (
jspb.Message.getWrapperField(this, type_pb.CircularQueue, 17));
};
/** @param {?proto.forge_abi.CircularQueue|undefined} value */
proto.forge_abi.AccountState.prototype.setPinnedFiles = function(value) {
jspb.Message.setWrapperField(this, 17, value);
};
proto.forge_abi.AccountState.prototype.clearPinnedFiles = function() {
this.setPinnedFiles(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.AccountState.prototype.hasPinnedFiles = function() {
return jspb.Message.getField(this, 17) != null;
};
/**
* optional PokeInfo poke = 18;
* @return {?proto.forge_abi.PokeInfo}
*/
proto.forge_abi.AccountState.prototype.getPoke = function() {
return /** @type{?proto.forge_abi.PokeInfo} */ (
jspb.Message.getWrapperField(this, type_pb.PokeInfo, 18));
};
/** @param {?proto.forge_abi.PokeInfo|undefined} value */
proto.forge_abi.AccountState.prototype.setPoke = function(value) {
jspb.Message.setWrapperField(this, 18, value);
};
proto.forge_abi.AccountState.prototype.clearPoke = function() {
this.setPoke(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.AccountState.prototype.hasPoke = function() {
return jspb.Message.getField(this, 18) != null;
};
/**
* optional google.protobuf.Any data = 50;
* @return {?proto.google.protobuf.Any}
*/
proto.forge_abi.AccountState.prototype.getData = function() {
return /** @type{?proto.google.protobuf.Any} */ (
jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 50));
};
/** @param {?proto.google.protobuf.Any|undefined} value */
proto.forge_abi.AccountState.prototype.setData = function(value) {
jspb.Message.setWrapperField(this, 50, value);
};
proto.forge_abi.AccountState.prototype.clearData = function() {
this.setData(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.AccountState.prototype.hasData = function() {
return jspb.Message.getField(this, 50) != null;
};
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.forge_abi.AssetState = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.forge_abi.AssetState, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.forge_abi.AssetState.displayName = 'proto.forge_abi.AssetState';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.forge_abi.AssetState.prototype.toObject = function(opt_includeInstance) {
return proto.forge_abi.AssetState.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.forge_abi.AssetState} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.forge_abi.AssetState.toObject = function(includeInstance, msg) {
var f, obj = {
address: jspb.Message.getFieldWithDefault(msg, 1, ""),
owner: jspb.Message.getFieldWithDefault(msg, 2, ""),
moniker: jspb.Message.getFieldWithDefault(msg, 3, ""),
readonly: jspb.Message.getFieldWithDefault(msg, 4, false),
transferrable: jspb.Message.getFieldWithDefault(msg, 5, false),
ttl: jspb.Message.getFieldWithDefault(msg, 6, 0),
consumedTime: (f = msg.getConsumedTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
issuer: jspb.Message.getFieldWithDefault(msg, 8, ""),
stake: (f = msg.getStake()) && type_pb.StakeContext.toObject(includeInstance, f),
context: (f = msg.getContext()) && type_pb.StateContext.toObject(includeInstance, f),
data: (f = msg.getData()) && google_protobuf_any_pb.Any.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.forge_abi.AssetState}
*/
proto.forge_abi.AssetState.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.forge_abi.AssetState;
return proto.forge_abi.AssetState.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.forge_abi.AssetState} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.forge_abi.AssetState}
*/
proto.forge_abi.AssetState.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setAddress(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setOwner(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setMoniker(value);
break;
case 4:
var value = /** @type {boolean} */ (reader.readBool());
msg.setReadonly(value);
break;
case 5:
var value = /** @type {boolean} */ (reader.readBool());
msg.setTransferrable(value);
break;
case 6:
var value = /** @type {number} */ (reader.readUint32());
msg.setTtl(value);
break;
case 7:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setConsumedTime(value);
break;
case 8:
var value = /** @type {string} */ (reader.readString());
msg.setIssuer(value);
break;
case 13:
var value = new type_pb.StakeContext;
reader.readMessage(value,type_pb.StakeContext.deserializeBinaryFromReader);
msg.setStake(value);
break;
case 14:
var value = new type_pb.StateContext;
reader.readMessage(value,type_pb.StateContext.deserializeBinaryFromReader);
msg.setContext(value);
break;
case 50:
var value = new google_protobuf_any_pb.Any;
reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
msg.setData(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.forge_abi.AssetState.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.forge_abi.AssetState.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.forge_abi.AssetState} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.forge_abi.AssetState.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getAddress();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getOwner();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getMoniker();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getReadonly();
if (f) {
writer.writeBool(
4,
f
);
}
f = message.getTransferrable();
if (f) {
writer.writeBool(
5,
f
);
}
f = message.getTtl();
if (f !== 0) {
writer.writeUint32(
6,
f
);
}
f = message.getConsumedTime();
if (f != null) {
writer.writeMessage(
7,
f,
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
f = message.getIssuer();
if (f.length > 0) {
writer.writeString(
8,
f
);
}
f = message.getStake();
if (f != null) {
writer.writeMessage(
13,
f,
type_pb.StakeContext.serializeBinaryToWriter
);
}
f = message.getContext();
if (f != null) {
writer.writeMessage(
14,
f,
type_pb.StateContext.serializeBinaryToWriter
);
}
f = message.getData();
if (f != null) {
writer.writeMessage(
50,
f,
google_protobuf_any_pb.Any.serializeBinaryToWriter
);
}
};
/**
* optional string address = 1;
* @return {string}
*/
proto.forge_abi.AssetState.prototype.getAddress = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.forge_abi.AssetState.prototype.setAddress = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string owner = 2;
* @return {string}
*/
proto.forge_abi.AssetState.prototype.getOwner = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/** @param {string} value */
proto.forge_abi.AssetState.prototype.setOwner = function(value) {
jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string moniker = 3;
* @return {string}
*/
proto.forge_abi.AssetState.prototype.getMoniker = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/** @param {string} value */
proto.forge_abi.AssetState.prototype.setMoniker = function(value) {
jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional bool readonly = 4;
* Note that Boolean fields may be set to 0/1 when serialized from a Java server.
* You should avoid comparisons like {@code val === true/false} in those cases.
* @return {boolean}
*/
proto.forge_abi.AssetState.prototype.getReadonly = function() {
return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 4, false));
};
/** @param {boolean} value */
proto.forge_abi.AssetState.prototype.setReadonly = function(value) {
jspb.Message.setProto3BooleanField(this, 4, value);
};
/**
* optional bool transferrable = 5;
* Note that Boolean fields may be set to 0/1 when serialized from a Java server.
* You should avoid comparisons like {@code val === true/false} in those cases.
* @return {boolean}
*/
proto.forge_abi.AssetState.prototype.getTransferrable = function() {
return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 5, false));
};
/** @param {boolean} value */
proto.forge_abi.AssetState.prototype.setTransferrable = function(value) {
jspb.Message.setProto3BooleanField(this, 5, value);
};
/**
* optional uint32 ttl = 6;
* @return {number}
*/
proto.forge_abi.AssetState.prototype.getTtl = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
};
/** @param {number} value */
proto.forge_abi.AssetState.prototype.setTtl = function(value) {
jspb.Message.setProto3IntField(this, 6, value);
};
/**
* optional google.protobuf.Timestamp consumed_time = 7;
* @return {?proto.google.protobuf.Timestamp}
*/
proto.forge_abi.AssetState.prototype.getConsumedTime = function() {
return /** @type{?proto.google.protobuf.Timestamp} */ (
jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 7));
};
/** @param {?proto.google.protobuf.Timestamp|undefined} value */
proto.forge_abi.AssetState.prototype.setConsumedTime = function(value) {
jspb.Message.setWrapperField(this, 7, value);
};
proto.forge_abi.AssetState.prototype.clearConsumedTime = function() {
this.setConsumedTime(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.AssetState.prototype.hasConsumedTime = function() {
return jspb.Message.getField(this, 7) != null;
};
/**
* optional string issuer = 8;
* @return {string}
*/
proto.forge_abi.AssetState.prototype.getIssuer = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, ""));
};
/** @param {string} value */
proto.forge_abi.AssetState.prototype.setIssuer = function(value) {
jspb.Message.setProto3StringField(this, 8, value);
};
/**
* optional StakeContext stake = 13;
* @return {?proto.forge_abi.StakeContext}
*/
proto.forge_abi.AssetState.prototype.getStake = function() {
return /** @type{?proto.forge_abi.StakeContext} */ (
jspb.Message.getWrapperField(this, type_pb.StakeContext, 13));
};
/** @param {?proto.forge_abi.StakeContext|undefined} value */
proto.forge_abi.AssetState.prototype.setStake = function(value) {
jspb.Message.setWrapperField(this, 13, value);
};
proto.forge_abi.AssetState.prototype.clearStake = function() {
this.setStake(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.AssetState.prototype.hasStake = function() {
return jspb.Message.getField(this, 13) != null;
};
/**
* optional StateContext context = 14;
* @return {?proto.forge_abi.StateContext}
*/
proto.forge_abi.AssetState.prototype.getContext = function() {
return /** @type{?proto.forge_abi.StateContext} */ (
jspb.Message.getWrapperField(this, type_pb.StateContext, 14));
};
/** @param {?proto.forge_abi.StateContext|undefined} value */
proto.forge_abi.AssetState.prototype.setContext = function(value) {
jspb.Message.setWrapperField(this, 14, value);
};
proto.forge_abi.AssetState.prototype.clearContext = function() {
this.setContext(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.AssetState.prototype.hasContext = function() {
return jspb.Message.getField(this, 14) != null;
};
/**
* optional google.protobuf.Any data = 50;
* @return {?proto.google.protobuf.Any}
*/
proto.forge_abi.AssetState.prototype.getData = function() {
return /** @type{?proto.google.protobuf.Any} */ (
jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 50));
};
/** @param {?proto.google.protobuf.Any|undefined} value */
proto.forge_abi.AssetState.prototype.setData = function(value) {
jspb.Message.setWrapperField(this, 50, value);
};
proto.forge_abi.AssetState.prototype.clearData = function() {
this.setData(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.AssetState.prototype.hasData = function() {
return jspb.Message.getField(this, 50) != null;
};
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.forge_abi.ForgeState = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.forge_abi.ForgeState, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.forge_abi.ForgeState.displayName = 'proto.forge_abi.ForgeState';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.forge_abi.ForgeState.prototype.toObject = function(opt_includeInstance) {
return proto.forge_abi.ForgeState.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.forge_abi.ForgeState} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.forge_abi.ForgeState.toObject = function(includeInstance, msg) {
var f, obj = {
address: jspb.Message.getFieldWithDefault(msg, 1, ""),
consensus: (f = msg.getConsensus()) && type_pb.ConsensusParams.toObject(includeInstance, f),
tasksMap: (f = msg.getTasksMap()) ? f.toObject(includeInstance, proto.forge_abi.UpgradeTasks.toObject) : [],
stakeSummaryMap: (f = msg.getStakeSummaryMap()) ? f.toObject(includeInstance, proto.forge_abi.StakeSummary.toObject) : [],
version: jspb.Message.getFieldWithDefault(msg, 5, ""),
dataVersion: jspb.Message.getFieldWithDefault(msg, 6, ""),
forgeAppHash: msg.getForgeAppHash_asB64(),
token: (f = msg.getToken()) && type_pb.ForgeToken.toObject(includeInstance, f),
txConfig: (f = msg.getTxConfig()) && type_pb.TransactionConfig.toObject(includeInstance, f),
stakeConfig: (f = msg.getStakeConfig()) && type_pb.StakeConfig.toObject(includeInstance, f),
pokeConfig: (f = msg.getPokeConfig()) && type_pb.PokeConfig.toObject(includeInstance, f),
data: (f = msg.getData()) && google_protobuf_any_pb.Any.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.forge_abi.ForgeState}
*/
proto.forge_abi.ForgeState.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.forge_abi.ForgeState;
return proto.forge_abi.ForgeState.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.forge_abi.ForgeState} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.forge_abi.ForgeState}
*/
proto.forge_abi.ForgeState.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setAddress(value);
break;
case 2:
var value = new type_pb.ConsensusParams;
reader.readMessage(value,type_pb.ConsensusParams.deserializeBinaryFromReader);
msg.setConsensus(value);
break;
case 3:
var value = msg.getTasksMap();
reader.readMessage(value, function(message, reader) {
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint64, jspb.BinaryReader.prototype.readMessage, proto.forge_abi.UpgradeTasks.deserializeBinaryFromReader, 0);
});
break;
case 4:
var value = msg.getStakeSummaryMap();
reader.readMessage(value, function(message, reader) {
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readMessage, proto.forge_abi.StakeSummary.deserializeBinaryFromReader, 0);
});
break;
case 5:
var value = /** @type {string} */ (reader.readString());
msg.setVersion(value);
break;
case 6:
var value = /** @type {string} */ (reader.readString());
msg.setDataVersion(value);
break;
case 7:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setForgeAppHash(value);
break;
case 8:
var value = new type_pb.ForgeToken;
reader.readMessage(value,type_pb.ForgeToken.deserializeBinaryFromReader);
msg.setToken(value);
break;
case 9:
var value = new type_pb.TransactionConfig;
reader.readMessage(value,type_pb.TransactionConfig.deserializeBinaryFromReader);
msg.setTxConfig(value);
break;
case 10:
var value = new type_pb.StakeConfig;
reader.readMessage(value,type_pb.StakeConfig.deserializeBinaryFromReader);
msg.setStakeConfig(value);
break;
case 11:
var value = new type_pb.PokeConfig;
reader.readMessage(value,type_pb.PokeConfig.deserializeBinaryFromReader);
msg.setPokeConfig(value);
break;
case 15:
var value = new google_protobuf_any_pb.Any;
reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
msg.setData(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.forge_abi.ForgeState.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.forge_abi.ForgeState.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.forge_abi.ForgeState} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.forge_abi.ForgeState.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getAddress();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getConsensus();
if (f != null) {
writer.writeMessage(
2,
f,
type_pb.ConsensusParams.serializeBinaryToWriter
);
}
f = message.getTasksMap(true);
if (f && f.getLength() > 0) {
f.serializeBinary(3, writer, jspb.BinaryWriter.prototype.writeUint64, jspb.BinaryWriter.prototype.writeMessage, proto.forge_abi.UpgradeTasks.serializeBinaryToWriter);
}
f = message.getStakeSummaryMap(true);
if (f && f.getLength() > 0) {
f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeMessage, proto.forge_abi.StakeSummary.serializeBinaryToWriter);
}
f = message.getVersion();
if (f.length > 0) {
writer.writeString(
5,
f
);
}
f = message.getDataVersion();
if (f.length > 0) {
writer.writeString(
6,
f
);
}
f = message.getForgeAppHash_asU8();
if (f.length > 0) {
writer.writeBytes(
7,
f
);
}
f = message.getToken();
if (f != null) {
writer.writeMessage(
8,
f,
type_pb.ForgeToken.serializeBinaryToWriter
);
}
f = message.getTxConfig();
if (f != null) {
writer.writeMessage(
9,
f,
type_pb.TransactionConfig.serializeBinaryToWriter
);
}
f = message.getStakeConfig();
if (f != null) {
writer.writeMessage(
10,
f,
type_pb.StakeConfig.serializeBinaryToWriter
);
}
f = message.getPokeConfig();
if (f != null) {
writer.writeMessage(
11,
f,
type_pb.PokeConfig.serializeBinaryToWriter
);
}
f = message.getData();
if (f != null) {
writer.writeMessage(
15,
f,
google_protobuf_any_pb.Any.serializeBinaryToWriter
);
}
};
/**
* optional string address = 1;
* @return {string}
*/
proto.forge_abi.ForgeState.prototype.getAddress = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.forge_abi.ForgeState.prototype.setAddress = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional ConsensusParams consensus = 2;
* @return {?proto.forge_abi.ConsensusParams}
*/
proto.forge_abi.ForgeState.prototype.getConsensus = function() {
return /** @type{?proto.forge_abi.ConsensusParams} */ (
jspb.Message.getWrapperField(this, type_pb.ConsensusParams, 2));
};
/** @param {?proto.forge_abi.ConsensusParams|undefined} value */
proto.forge_abi.ForgeState.prototype.setConsensus = function(value) {
jspb.Message.setWrapperField(this, 2, value);
};
proto.forge_abi.ForgeState.prototype.clearConsensus = function() {
this.setConsensus(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.ForgeState.prototype.hasConsensus = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* map<uint64, UpgradeTasks> tasks = 3;
* @param {boolean=} opt_noLazyCreate Do not create the map if
* empty, instead returning `undefined`
* @return {!jspb.Map<number,!proto.forge_abi.UpgradeTasks>}
*/
proto.forge_abi.ForgeState.prototype.getTasksMap = function(opt_noLazyCreate) {
return /** @type {!jspb.Map<number,!proto.forge_abi.UpgradeTasks>} */ (
jspb.Message.getMapField(this, 3, opt_noLazyCreate,
proto.forge_abi.UpgradeTasks));
};
proto.forge_abi.ForgeState.prototype.clearTasksMap = function() {
this.getTasksMap().clear();
};
/**
* map<uint32, StakeSummary> stake_summary = 4;
* @param {boolean=} opt_noLazyCreate Do not create the map if
* empty, instead returning `undefined`
* @return {!jspb.Map<number,!proto.forge_abi.StakeSummary>}
*/
proto.forge_abi.ForgeState.prototype.getStakeSummaryMap = function(opt_noLazyCreate) {
return /** @type {!jspb.Map<number,!proto.forge_abi.StakeSummary>} */ (
jspb.Message.getMapField(this, 4, opt_noLazyCreate,
proto.forge_abi.StakeSummary));
};
proto.forge_abi.ForgeState.prototype.clearStakeSummaryMap = function() {
this.getStakeSummaryMap().clear();
};
/**
* optional string version = 5;
* @return {string}
*/
proto.forge_abi.ForgeState.prototype.getVersion = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
};
/** @param {string} value */
proto.forge_abi.ForgeState.prototype.setVersion = function(value) {
jspb.Message.setProto3StringField(this, 5, value);
};
/**
* optional string data_version = 6;
* @return {string}
*/
proto.forge_abi.ForgeState.prototype.getDataVersion = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
};
/** @param {string} value */
proto.forge_abi.ForgeState.prototype.setDataVersion = function(value) {
jspb.Message.setProto3StringField(this, 6, value);
};
/**
* optional bytes forge_app_hash = 7;
* @return {!(string|Uint8Array)}
*/
proto.forge_abi.ForgeState.prototype.getForgeAppHash = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
};
/**
* optional bytes forge_app_hash = 7;
* This is a type-conversion wrapper around `getForgeAppHash()`
* @return {string}
*/
proto.forge_abi.ForgeState.prototype.getForgeAppHash_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getForgeAppHash()));
};
/**
* optional bytes forge_app_hash = 7;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getForgeAppHash()`
* @return {!Uint8Array}
*/
proto.forge_abi.ForgeState.prototype.getForgeAppHash_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getForgeAppHash()));
};
/** @param {!(string|Uint8Array)} value */
proto.forge_abi.ForgeState.prototype.setForgeAppHash = function(value) {
jspb.Message.setProto3BytesField(this, 7, value);
};
/**
* optional ForgeToken token = 8;
* @return {?proto.forge_abi.ForgeToken}
*/
proto.forge_abi.ForgeState.prototype.getToken = function() {
return /** @type{?proto.forge_abi.ForgeToken} */ (
jspb.Message.getWrapperField(this, type_pb.ForgeToken, 8));
};
/** @param {?proto.forge_abi.ForgeToken|undefined} value */
proto.forge_abi.ForgeState.prototype.setToken = function(value) {
jspb.Message.setWrapperField(this, 8, value);
};
proto.forge_abi.ForgeState.prototype.clearToken = function() {
this.setToken(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.ForgeState.prototype.hasToken = function() {
return jspb.Message.getField(this, 8) != null;
};
/**
* optional TransactionConfig tx_config = 9;
* @return {?proto.forge_abi.TransactionConfig}
*/
proto.forge_abi.ForgeState.prototype.getTxConfig = function() {
return /** @type{?proto.forge_abi.TransactionConfig} */ (
jspb.Message.getWrapperField(this, type_pb.TransactionConfig, 9));
};
/** @param {?proto.forge_abi.TransactionConfig|undefined} value */
proto.forge_abi.ForgeState.prototype.setTxConfig = function(value) {
jspb.Message.setWrapperField(this, 9, value);
};
proto.forge_abi.ForgeState.prototype.clearTxConfig = function() {
this.setTxConfig(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.ForgeState.prototype.hasTxConfig = function() {
return jspb.Message.getField(this, 9) != null;
};
/**
* optional StakeConfig stake_config = 10;
* @return {?proto.forge_abi.StakeConfig}
*/
proto.forge_abi.ForgeState.prototype.getStakeConfig = function() {
return /** @type{?proto.forge_abi.StakeConfig} */ (
jspb.Message.getWrapperField(this, type_pb.StakeConfig, 10));
};
/** @param {?proto.forge_abi.StakeConfig|undefined} value */
proto.forge_abi.ForgeState.prototype.setStakeConfig = function(value) {
jspb.Message.setWrapperField(this, 10, value);
};
proto.forge_abi.ForgeState.prototype.clearStakeConfig = function() {
this.setStakeConfig(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.ForgeState.prototype.hasStakeConfig = function() {
return jspb.Message.getField(this, 10) != null;
};
/**
* optional PokeConfig poke_config = 11;
* @return {?proto.forge_abi.PokeConfig}
*/
proto.forge_abi.ForgeState.prototype.getPokeConfig = function() {
return /** @type{?proto.forge_abi.PokeConfig} */ (
jspb.Message.getWrapperField(this, type_pb.PokeConfig, 11));
};
/** @param {?proto.forge_abi.PokeConfig|undefined} value */
proto.forge_abi.ForgeState.prototype.setPokeConfig = function(value) {
jspb.Message.setWrapperField(this, 11, value);
};
proto.forge_abi.ForgeState.prototype.clearPokeConfig = function() {
this.setPokeConfig(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.ForgeState.prototype.hasPokeConfig = function() {
return jspb.Message.getField(this, 11) != null;
};
/**
* optional google.protobuf.Any data = 15;
* @return {?proto.google.protobuf.Any}
*/
proto.forge_abi.ForgeState.prototype.getData = function() {
return /** @type{?proto.google.protobuf.Any} */ (
jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 15));
};
/** @param {?proto.google.protobuf.Any|undefined} value */
proto.forge_abi.ForgeState.prototype.setData = function(value) {
jspb.Message.setWrapperField(this, 15, value);
};
proto.forge_abi.ForgeState.prototype.clearData = function() {
this.setData(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.ForgeState.prototype.hasData = function() {
return jspb.Message.getField(this, 15) != null;
};
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.forge_abi.RootState = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.forge_abi.RootState, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.forge_abi.RootState.displayName = 'proto.forge_abi.RootState';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.forge_abi.RootState.prototype.toObject = function(opt_includeInstance) {
return proto.forge_abi.RootState.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.forge_abi.RootState} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.forge_abi.RootState.toObject = function(includeInstance, msg) {
var f, obj = {
address: jspb.Message.getFieldWithDefault(msg, 1, ""),
account: msg.getAccount_asB64(),
asset: msg.getAsset_asB64(),
receipt: msg.getReceipt_asB64()
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.forge_abi.RootState}
*/
proto.forge_abi.RootState.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.forge_abi.RootState;
return proto.forge_abi.RootState.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.forge_abi.RootState} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.forge_abi.RootState}
*/
proto.forge_abi.RootState.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setAddress(value);
break;
case 2:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setAccount(value);
break;
case 3:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setAsset(value);
break;
case 4:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setReceipt(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.forge_abi.RootState.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.forge_abi.RootState.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.forge_abi.RootState} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.forge_abi.RootState.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getAddress();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getAccount_asU8();
if (f.length > 0) {
writer.writeBytes(
2,
f
);
}
f = message.getAsset_asU8();
if (f.length > 0) {
writer.writeBytes(
3,
f
);
}
f = message.getReceipt_asU8();
if (f.length > 0) {
writer.writeBytes(
4,
f
);
}
};
/**
* optional string address = 1;
* @return {string}
*/
proto.forge_abi.RootState.prototype.getAddress = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.forge_abi.RootState.prototype.setAddress = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional bytes account = 2;
* @return {!(string|Uint8Array)}
*/
proto.forge_abi.RootState.prototype.getAccount = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* optional bytes account = 2;
* This is a type-conversion wrapper around `getAccount()`
* @return {string}
*/
proto.forge_abi.RootState.prototype.getAccount_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getAccount()));
};
/**
* optional bytes account = 2;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getAccount()`
* @return {!Uint8Array}
*/
proto.forge_abi.RootState.prototype.getAccount_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getAccount()));
};
/** @param {!(string|Uint8Array)} value */
proto.forge_abi.RootState.prototype.setAccount = function(value) {
jspb.Message.setProto3BytesField(this, 2, value);
};
/**
* optional bytes asset = 3;
* @return {!(string|Uint8Array)}
*/
proto.forge_abi.RootState.prototype.getAsset = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* optional bytes asset = 3;
* This is a type-conversion wrapper around `getAsset()`
* @return {string}
*/
proto.forge_abi.RootState.prototype.getAsset_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getAsset()));
};
/**
* optional bytes asset = 3;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getAsset()`
* @return {!Uint8Array}
*/
proto.forge_abi.RootState.prototype.getAsset_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getAsset()));
};
/** @param {!(string|Uint8Array)} value */
proto.forge_abi.RootState.prototype.setAsset = function(value) {
jspb.Message.setProto3BytesField(this, 3, value);
};
/**
* optional bytes receipt = 4;
* @return {!(string|Uint8Array)}
*/
proto.forge_abi.RootState.prototype.getReceipt = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/**
* optional bytes receipt = 4;
* This is a type-conversion wrapper around `getReceipt()`
* @return {string}
*/
proto.forge_abi.RootState.prototype.getReceipt_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getReceipt()));
};
/**
* optional bytes receipt = 4;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getReceipt()`
* @return {!Uint8Array}
*/
proto.forge_abi.RootState.prototype.getReceipt_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getReceipt()));
};
/** @param {!(string|Uint8Array)} value */
proto.forge_abi.RootState.prototype.setReceipt = function(value) {
jspb.Message.setProto3BytesField(this, 4, value);
};
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.forge_abi.StakeState = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.forge_abi.StakeState, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.forge_abi.StakeState.displayName = 'proto.forge_abi.StakeState';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.forge_abi.StakeState.prototype.toObject = function(opt_includeInstance) {
return proto.forge_abi.StakeState.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.forge_abi.StakeState} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.forge_abi.StakeState.toObject = function(includeInstance, msg) {
var f, obj = {
address: jspb.Message.getFieldWithDefault(msg, 1, ""),
from: jspb.Message.getFieldWithDefault(msg, 2, ""),
to: jspb.Message.getFieldWithDefault(msg, 3, ""),
balance: (f = msg.getBalance()) && type_pb.BigUint.toObject(includeInstance, f),
message: jspb.Message.getFieldWithDefault(msg, 5, ""),
context: (f = msg.getContext()) && type_pb.StateContext.toObject(includeInstance, f),
data: (f = msg.getData()) && google_protobuf_any_pb.Any.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.forge_abi.StakeState}
*/
proto.forge_abi.StakeState.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.forge_abi.StakeState;
return proto.forge_abi.StakeState.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.forge_abi.StakeState} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.forge_abi.StakeState}
*/
proto.forge_abi.StakeState.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setAddress(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setFrom(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setTo(value);
break;
case 4:
var value = new type_pb.BigUint;
reader.readMessage(value,type_pb.BigUint.deserializeBinaryFromReader);
msg.setBalance(value);
break;
case 5:
var value = /** @type {string} */ (reader.readString());
msg.setMessage(value);
break;
case 14:
var value = new type_pb.StateContext;
reader.readMessage(value,type_pb.StateContext.deserializeBinaryFromReader);
msg.setContext(value);
break;
case 15:
var value = new google_protobuf_any_pb.Any;
reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
msg.setData(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.forge_abi.StakeState.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.forge_abi.StakeState.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.forge_abi.StakeState} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.forge_abi.StakeState.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getAddress();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getFrom();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getTo();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getBalance();
if (f != null) {
writer.writeMessage(
4,
f,
type_pb.BigUint.serializeBinaryToWriter
);
}
f = message.getMessage();
if (f.length > 0) {
writer.writeString(
5,
f
);
}
f = message.getContext();
if (f != null) {
writer.writeMessage(
14,
f,
type_pb.StateContext.serializeBinaryToWriter
);
}
f = message.getData();
if (f != null) {
writer.writeMessage(
15,
f,
google_protobuf_any_pb.Any.serializeBinaryToWriter
);
}
};
/**
* optional string address = 1;
* @return {string}
*/
proto.forge_abi.StakeState.prototype.getAddress = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.forge_abi.StakeState.prototype.setAddress = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string from = 2;
* @return {string}
*/
proto.forge_abi.StakeState.prototype.getFrom = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/** @param {string} value */
proto.forge_abi.StakeState.prototype.setFrom = function(value) {
jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string to = 3;
* @return {string}
*/
proto.forge_abi.StakeState.prototype.getTo = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/** @param {string} value */
proto.forge_abi.StakeState.prototype.setTo = function(value) {
jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional BigUint balance = 4;
* @return {?proto.forge_abi.BigUint}
*/
proto.forge_abi.StakeState.prototype.getBalance = function() {
return /** @type{?proto.forge_abi.BigUint} */ (
jspb.Message.getWrapperField(this, type_pb.BigUint, 4));
};
/** @param {?proto.forge_abi.BigUint|undefined} value */
proto.forge_abi.StakeState.prototype.setBalance = function(value) {
jspb.Message.setWrapperField(this, 4, value);
};
proto.forge_abi.StakeState.prototype.clearBalance = function() {
this.setBalance(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.StakeState.prototype.hasBalance = function() {
return jspb.Message.getField(this, 4) != null;
};
/**
* optional string message = 5;
* @return {string}
*/
proto.forge_abi.StakeState.prototype.getMessage = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
};
/** @param {string} value */
proto.forge_abi.StakeState.prototype.setMessage = function(value) {
jspb.Message.setProto3StringField(this, 5, value);
};
/**
* optional StateContext context = 14;
* @return {?proto.forge_abi.StateContext}
*/
proto.forge_abi.StakeState.prototype.getContext = function() {
return /** @type{?proto.forge_abi.StateContext} */ (
jspb.Message.getWrapperField(this, type_pb.StateContext, 14));
};
/** @param {?proto.forge_abi.StateContext|undefined} value */
proto.forge_abi.StakeState.prototype.setContext = function(value) {
jspb.Message.setWrapperField(this, 14, value);
};
proto.forge_abi.StakeState.prototype.clearContext = function() {
this.setContext(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.StakeState.prototype.hasContext = function() {
return jspb.Message.getField(this, 14) != null;
};
/**
* optional google.protobuf.Any data = 15;
* @return {?proto.google.protobuf.Any}
*/
proto.forge_abi.StakeState.prototype.getData = function() {
return /** @type{?proto.google.protobuf.Any} */ (
jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 15));
};
/** @param {?proto.google.protobuf.Any|undefined} value */
proto.forge_abi.StakeState.prototype.setData = function(value) {
jspb.Message.setWrapperField(this, 15, value);
};
proto.forge_abi.StakeState.prototype.clearData = function() {
this.setData(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.StakeState.prototype.hasData = function() {
return jspb.Message.getField(this, 15) != null;
};
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.forge_abi.StatisticsState = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.forge_abi.StatisticsState, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.forge_abi.StatisticsState.displayName = 'proto.forge_abi.StatisticsState';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.forge_abi.StatisticsState.prototype.toObject = function(opt_includeInstance) {
return proto.forge_abi.StatisticsState.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.forge_abi.StatisticsState} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.forge_abi.StatisticsState.toObject = function(includeInstance, msg) {
var f, obj = {
address: jspb.Message.getFieldWithDefault(msg, 1, ""),
numBlocks: jspb.Message.getFieldWithDefault(msg, 2, 0),
numTxs: jspb.Message.getFieldWithDefault(msg, 3, 0),
numStakes: (f = msg.getNumStakes()) && type_pb.BigUint.toObject(includeInstance, f),
numValidators: jspb.Message.getFieldWithDefault(msg, 5, 0),
txStatistics: (f = msg.getTxStatistics()) && type_pb.TxStatistics.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.forge_abi.StatisticsState}
*/
proto.forge_abi.StatisticsState.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.forge_abi.StatisticsState;
return proto.forge_abi.StatisticsState.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.forge_abi.StatisticsState} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.forge_abi.StatisticsState}
*/
proto.forge_abi.StatisticsState.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setAddress(value);
break;
case 2:
var value = /** @type {number} */ (reader.readUint64());
msg.setNumBlocks(value);
break;
case 3:
var value = /** @type {number} */ (reader.readUint64());
msg.setNumTxs(value);
break;
case 4:
var value = new type_pb.BigUint;
reader.readMessage(value,type_pb.BigUint.deserializeBinaryFromReader);
msg.setNumStakes(value);
break;
case 5:
var value = /** @type {number} */ (reader.readUint32());
msg.setNumValidators(value);
break;
case 6:
var value = new type_pb.TxStatistics;
reader.readMessage(value,type_pb.TxStatistics.deserializeBinaryFromReader);
msg.setTxStatistics(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.forge_abi.StatisticsState.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.forge_abi.StatisticsState.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.forge_abi.StatisticsState} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.forge_abi.StatisticsState.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getAddress();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getNumBlocks();
if (f !== 0) {
writer.writeUint64(
2,
f
);
}
f = message.getNumTxs();
if (f !== 0) {
writer.writeUint64(
3,
f
);
}
f = message.getNumStakes();
if (f != null) {
writer.writeMessage(
4,
f,
type_pb.BigUint.serializeBinaryToWriter
);
}
f = message.getNumValidators();
if (f !== 0) {
writer.writeUint32(
5,
f
);
}
f = message.getTxStatistics();
if (f != null) {
writer.writeMessage(
6,
f,
type_pb.TxStatistics.serializeBinaryToWriter
);
}
};
/**
* optional string address = 1;
* @return {string}
*/
proto.forge_abi.StatisticsState.prototype.getAddress = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.forge_abi.StatisticsState.prototype.setAddress = function(value) {
jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional uint64 num_blocks = 2;
* @return {number}
*/
proto.forge_abi.StatisticsState.prototype.getNumBlocks = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};
/** @param {number} value */
proto.forge_abi.StatisticsState.prototype.setNumBlocks = function(value) {
jspb.Message.setProto3IntField(this, 2, value);
};
/**
* optional uint64 num_txs = 3;
* @return {number}
*/
proto.forge_abi.StatisticsState.prototype.getNumTxs = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
};
/** @param {number} value */
proto.forge_abi.StatisticsState.prototype.setNumTxs = function(value) {
jspb.Message.setProto3IntField(this, 3, value);
};
/**
* optional BigUint num_stakes = 4;
* @return {?proto.forge_abi.BigUint}
*/
proto.forge_abi.StatisticsState.prototype.getNumStakes = function() {
return /** @type{?proto.forge_abi.BigUint} */ (
jspb.Message.getWrapperField(this, type_pb.BigUint, 4));
};
/** @param {?proto.forge_abi.BigUint|undefined} value */
proto.forge_abi.StatisticsState.prototype.setNumStakes = function(value) {
jspb.Message.setWrapperField(this, 4, value);
};
proto.forge_abi.StatisticsState.prototype.clearNumStakes = function() {
this.setNumStakes(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.StatisticsState.prototype.hasNumStakes = function() {
return jspb.Message.getField(this, 4) != null;
};
/**
* optional uint32 num_validators = 5;
* @return {number}
*/
proto.forge_abi.StatisticsState.prototype.getNumValidators = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
};
/** @param {number} value */
proto.forge_abi.StatisticsState.prototype.setNumValidators = function(value) {
jspb.Message.setProto3IntField(this, 5, value);
};
/**
* optional TxStatistics tx_statistics = 6;
* @return {?proto.forge_abi.TxStatistics}
*/
proto.forge_abi.StatisticsState.prototype.getTxStatistics = function() {
return /** @type{?proto.forge_abi.TxStatistics} */ (
jspb.Message.getWrapperField(this, type_pb.TxStatistics, 6));
};
/** @param {?proto.forge_abi.TxStatistics|undefined} value */
proto.forge_abi.StatisticsState.prototype.setTxStatistics = function(value) {
jspb.Message.setWrapperField(this, 6, value);
};
proto.forge_abi.StatisticsState.prototype.clearTxStatistics = function() {
this.setTxStatistics(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.forge_abi.StatisticsState.prototype.hasTxStatistics = function() {
return jspb.Message.getField(this, 6) != null;
};
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.forge_abi.BlacklistState = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.forge_abi.BlacklistState.repeatedFields_, null);
};
goog.inherits(proto.forge_abi.BlacklistState, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.forge_abi.BlacklistState.displayName = 'proto.forge_abi.BlacklistState';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.forge_abi.BlacklistState.repeatedFields_ = [1];
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.forge_abi.BlacklistState.prototype.toObject = function(opt_includeInstance) {
return proto.forge_abi.BlacklistState.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.forge_abi.BlacklistState} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.forge_abi.BlacklistState.toObject = function(includeInstance, msg) {
var f, obj = {
addressList: jspb.Message.getRepeatedField(msg, 1)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.forge_abi.BlacklistState}
*/
proto.forge_abi.BlacklistState.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.forge_abi.BlacklistState;
return proto.forge_abi.BlacklistState.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.forge_abi.BlacklistState} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.forge_abi.BlacklistState}
*/
proto.forge_abi.BlacklistState.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.addAddress(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.forge_abi.BlacklistState.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.forge_abi.BlacklistState.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.forge_abi.BlacklistState} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.forge_abi.BlacklistState.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getAddressList();
if (f.length > 0) {
writer.writeRepeatedString(
1,
f
);
}
};
/**
* repeated string address = 1;
* @return {!Array<string>}
*/
proto.forge_abi.BlacklistState.prototype.getAddressList = function() {
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 1));
};
/** @param {!Array<string>} value */
proto.forge_abi.BlacklistState.prototype.setAddressList = function(value) {
jspb.Message.setField(this, 1, value || []);
};
/**
* @param {string} value
* @param {number=} opt_index
*/
proto.forge_abi.BlacklistState.prototype.addAddress = function(value, opt_index) {
jspb.Message.addToRepeatedField(this, 1, value, opt_index);
};
proto.forge_abi.BlacklistState.prototype.clearAddressList = function() {
this.setAddressList([]);
};
goog.object.extend(exports, proto.forge_abi);