@klaytn/kss-bridges-celer
Version:
TypeScript client and use-cases for cBridge
594 lines (510 loc) • 17.5 kB
JavaScript
// source: sgn/cbridge/v1/genesis.proto
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
var jspb = require('google-protobuf');
var goog = jspb;
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));
var gogoproto_gogo_pb = require('../../../gogoproto/gogo_pb.js');
goog.object.extend(proto, gogoproto_gogo_pb);
var sgn_cbridge_v1_cbridge_pb = require('../../../sgn/cbridge/v1/cbridge_pb.js');
goog.object.extend(proto, sgn_cbridge_v1_cbridge_pb);
goog.exportSymbol('proto.sgn.cbridge.v1.GenesisState', null, global);
goog.exportSymbol('proto.sgn.cbridge.v1.KV', 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.sgn.cbridge.v1.GenesisState = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.sgn.cbridge.v1.GenesisState.repeatedFields_, null);
};
goog.inherits(proto.sgn.cbridge.v1.GenesisState, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.sgn.cbridge.v1.GenesisState.displayName = 'proto.sgn.cbridge.v1.GenesisState';
}
/**
* 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.sgn.cbridge.v1.KV = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.sgn.cbridge.v1.KV, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.sgn.cbridge.v1.KV.displayName = 'proto.sgn.cbridge.v1.KV';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.sgn.cbridge.v1.GenesisState.repeatedFields_ = [4];
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.sgn.cbridge.v1.GenesisState.prototype.toObject = function(opt_includeInstance) {
return proto.sgn.cbridge.v1.GenesisState.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.sgn.cbridge.v1.GenesisState} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.sgn.cbridge.v1.GenesisState.toObject = function(includeInstance, msg) {
var f, obj = {
params: (f = msg.getParams()) && sgn_cbridge_v1_cbridge_pb.Params.toObject(includeInstance, f),
kvsList: jspb.Message.toObjectList(msg.getKvsList(),
proto.sgn.cbridge.v1.KV.toObject, includeInstance),
config: (f = msg.getConfig()) && sgn_cbridge_v1_cbridge_pb.CbrConfig.toObject(includeInstance, f),
price: (f = msg.getPrice()) && sgn_cbridge_v1_cbridge_pb.CbrPrice.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.sgn.cbridge.v1.GenesisState}
*/
proto.sgn.cbridge.v1.GenesisState.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.sgn.cbridge.v1.GenesisState;
return proto.sgn.cbridge.v1.GenesisState.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.sgn.cbridge.v1.GenesisState} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.sgn.cbridge.v1.GenesisState}
*/
proto.sgn.cbridge.v1.GenesisState.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new sgn_cbridge_v1_cbridge_pb.Params;
reader.readMessage(value,sgn_cbridge_v1_cbridge_pb.Params.deserializeBinaryFromReader);
msg.setParams(value);
break;
case 4:
var value = new proto.sgn.cbridge.v1.KV;
reader.readMessage(value,proto.sgn.cbridge.v1.KV.deserializeBinaryFromReader);
msg.addKvs(value);
break;
case 2:
var value = new sgn_cbridge_v1_cbridge_pb.CbrConfig;
reader.readMessage(value,sgn_cbridge_v1_cbridge_pb.CbrConfig.deserializeBinaryFromReader);
msg.setConfig(value);
break;
case 3:
var value = new sgn_cbridge_v1_cbridge_pb.CbrPrice;
reader.readMessage(value,sgn_cbridge_v1_cbridge_pb.CbrPrice.deserializeBinaryFromReader);
msg.setPrice(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.sgn.cbridge.v1.GenesisState.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.sgn.cbridge.v1.GenesisState.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.sgn.cbridge.v1.GenesisState} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.sgn.cbridge.v1.GenesisState.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getParams();
if (f != null) {
writer.writeMessage(
1,
f,
sgn_cbridge_v1_cbridge_pb.Params.serializeBinaryToWriter
);
}
f = message.getKvsList();
if (f.length > 0) {
writer.writeRepeatedMessage(
4,
f,
proto.sgn.cbridge.v1.KV.serializeBinaryToWriter
);
}
f = message.getConfig();
if (f != null) {
writer.writeMessage(
2,
f,
sgn_cbridge_v1_cbridge_pb.CbrConfig.serializeBinaryToWriter
);
}
f = message.getPrice();
if (f != null) {
writer.writeMessage(
3,
f,
sgn_cbridge_v1_cbridge_pb.CbrPrice.serializeBinaryToWriter
);
}
};
/**
* optional Params params = 1;
* @return {?proto.sgn.cbridge.v1.Params}
*/
proto.sgn.cbridge.v1.GenesisState.prototype.getParams = function() {
return /** @type{?proto.sgn.cbridge.v1.Params} */ (
jspb.Message.getWrapperField(this, sgn_cbridge_v1_cbridge_pb.Params, 1));
};
/**
* @param {?proto.sgn.cbridge.v1.Params|undefined} value
* @return {!proto.sgn.cbridge.v1.GenesisState} returns this
*/
proto.sgn.cbridge.v1.GenesisState.prototype.setParams = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.sgn.cbridge.v1.GenesisState} returns this
*/
proto.sgn.cbridge.v1.GenesisState.prototype.clearParams = function() {
return this.setParams(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.sgn.cbridge.v1.GenesisState.prototype.hasParams = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* repeated KV kvs = 4;
* @return {!Array<!proto.sgn.cbridge.v1.KV>}
*/
proto.sgn.cbridge.v1.GenesisState.prototype.getKvsList = function() {
return /** @type{!Array<!proto.sgn.cbridge.v1.KV>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.sgn.cbridge.v1.KV, 4));
};
/**
* @param {!Array<!proto.sgn.cbridge.v1.KV>} value
* @return {!proto.sgn.cbridge.v1.GenesisState} returns this
*/
proto.sgn.cbridge.v1.GenesisState.prototype.setKvsList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 4, value);
};
/**
* @param {!proto.sgn.cbridge.v1.KV=} opt_value
* @param {number=} opt_index
* @return {!proto.sgn.cbridge.v1.KV}
*/
proto.sgn.cbridge.v1.GenesisState.prototype.addKvs = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.sgn.cbridge.v1.KV, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.sgn.cbridge.v1.GenesisState} returns this
*/
proto.sgn.cbridge.v1.GenesisState.prototype.clearKvsList = function() {
return this.setKvsList([]);
};
/**
* optional CbrConfig config = 2;
* @return {?proto.sgn.cbridge.v1.CbrConfig}
*/
proto.sgn.cbridge.v1.GenesisState.prototype.getConfig = function() {
return /** @type{?proto.sgn.cbridge.v1.CbrConfig} */ (
jspb.Message.getWrapperField(this, sgn_cbridge_v1_cbridge_pb.CbrConfig, 2));
};
/**
* @param {?proto.sgn.cbridge.v1.CbrConfig|undefined} value
* @return {!proto.sgn.cbridge.v1.GenesisState} returns this
*/
proto.sgn.cbridge.v1.GenesisState.prototype.setConfig = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.sgn.cbridge.v1.GenesisState} returns this
*/
proto.sgn.cbridge.v1.GenesisState.prototype.clearConfig = function() {
return this.setConfig(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.sgn.cbridge.v1.GenesisState.prototype.hasConfig = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional CbrPrice price = 3;
* @return {?proto.sgn.cbridge.v1.CbrPrice}
*/
proto.sgn.cbridge.v1.GenesisState.prototype.getPrice = function() {
return /** @type{?proto.sgn.cbridge.v1.CbrPrice} */ (
jspb.Message.getWrapperField(this, sgn_cbridge_v1_cbridge_pb.CbrPrice, 3));
};
/**
* @param {?proto.sgn.cbridge.v1.CbrPrice|undefined} value
* @return {!proto.sgn.cbridge.v1.GenesisState} returns this
*/
proto.sgn.cbridge.v1.GenesisState.prototype.setPrice = function(value) {
return jspb.Message.setWrapperField(this, 3, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.sgn.cbridge.v1.GenesisState} returns this
*/
proto.sgn.cbridge.v1.GenesisState.prototype.clearPrice = function() {
return this.setPrice(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.sgn.cbridge.v1.GenesisState.prototype.hasPrice = function() {
return jspb.Message.getField(this, 3) != null;
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.sgn.cbridge.v1.KV.prototype.toObject = function(opt_includeInstance) {
return proto.sgn.cbridge.v1.KV.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.sgn.cbridge.v1.KV} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.sgn.cbridge.v1.KV.toObject = function(includeInstance, msg) {
var f, obj = {
key: msg.getKey_asB64(),
val: msg.getVal_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.sgn.cbridge.v1.KV}
*/
proto.sgn.cbridge.v1.KV.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.sgn.cbridge.v1.KV;
return proto.sgn.cbridge.v1.KV.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.sgn.cbridge.v1.KV} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.sgn.cbridge.v1.KV}
*/
proto.sgn.cbridge.v1.KV.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setKey(value);
break;
case 2:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setVal(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.sgn.cbridge.v1.KV.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.sgn.cbridge.v1.KV.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.sgn.cbridge.v1.KV} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.sgn.cbridge.v1.KV.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getKey_asU8();
if (f.length > 0) {
writer.writeBytes(
1,
f
);
}
f = message.getVal_asU8();
if (f.length > 0) {
writer.writeBytes(
2,
f
);
}
};
/**
* optional bytes key = 1;
* @return {!(string|Uint8Array)}
*/
proto.sgn.cbridge.v1.KV.prototype.getKey = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* optional bytes key = 1;
* This is a type-conversion wrapper around `getKey()`
* @return {string}
*/
proto.sgn.cbridge.v1.KV.prototype.getKey_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getKey()));
};
/**
* optional bytes key = 1;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getKey()`
* @return {!Uint8Array}
*/
proto.sgn.cbridge.v1.KV.prototype.getKey_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getKey()));
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.sgn.cbridge.v1.KV} returns this
*/
proto.sgn.cbridge.v1.KV.prototype.setKey = function(value) {
return jspb.Message.setProto3BytesField(this, 1, value);
};
/**
* optional bytes val = 2;
* @return {!(string|Uint8Array)}
*/
proto.sgn.cbridge.v1.KV.prototype.getVal = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* optional bytes val = 2;
* This is a type-conversion wrapper around `getVal()`
* @return {string}
*/
proto.sgn.cbridge.v1.KV.prototype.getVal_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getVal()));
};
/**
* optional bytes val = 2;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getVal()`
* @return {!Uint8Array}
*/
proto.sgn.cbridge.v1.KV.prototype.getVal_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getVal()));
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.sgn.cbridge.v1.KV} returns this
*/
proto.sgn.cbridge.v1.KV.prototype.setVal = function(value) {
return jspb.Message.setProto3BytesField(this, 2, value);
};
goog.object.extend(exports, proto.sgn.cbridge.v1);