UNPKG

@bandprotocol/bandchain.js

Version:

Library for interacting with BandChain in browser and Node.js environments

814 lines (764 loc) 24.6 kB
// source: ibc/core/commitment/v1/commitment.proto /** * @fileoverview * @enhanceable * @suppress {missingRequire} reports error on implicit type usages. * @suppress {messageConventions} JS Compiler reports an error if a variable or * field starts with 'MSG_' and isn't a translatable message. * @public */ // GENERATED CODE -- DO NOT EDIT! /* eslint-disable */ // @ts-nocheck var jspb = require('google-protobuf') var goog = jspb var global = Function('return this')() var gogoproto_gogo_pb = require('../../../../gogoproto/gogo_pb.js') goog.object.extend(proto, gogoproto_gogo_pb) var cosmos_ics23_v1_proofs_pb = require('../../../../cosmos/ics23/v1/proofs_pb.js') goog.object.extend(proto, cosmos_ics23_v1_proofs_pb) goog.exportSymbol('proto.ibc.core.commitment.v1.MerklePath', null, global) goog.exportSymbol('proto.ibc.core.commitment.v1.MerklePrefix', null, global) goog.exportSymbol('proto.ibc.core.commitment.v1.MerkleProof', null, global) goog.exportSymbol('proto.ibc.core.commitment.v1.MerkleRoot', null, global) /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.ibc.core.commitment.v1.MerkleRoot = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null) } goog.inherits(proto.ibc.core.commitment.v1.MerkleRoot, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.ibc.core.commitment.v1.MerkleRoot.displayName = 'proto.ibc.core.commitment.v1.MerkleRoot' } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.ibc.core.commitment.v1.MerklePrefix = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null) } goog.inherits(proto.ibc.core.commitment.v1.MerklePrefix, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.ibc.core.commitment.v1.MerklePrefix.displayName = 'proto.ibc.core.commitment.v1.MerklePrefix' } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.ibc.core.commitment.v1.MerklePath = function (opt_data) { jspb.Message.initialize( this, opt_data, 0, -1, proto.ibc.core.commitment.v1.MerklePath.repeatedFields_, null, ) } goog.inherits(proto.ibc.core.commitment.v1.MerklePath, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.ibc.core.commitment.v1.MerklePath.displayName = 'proto.ibc.core.commitment.v1.MerklePath' } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.ibc.core.commitment.v1.MerkleProof = function (opt_data) { jspb.Message.initialize( this, opt_data, 0, -1, proto.ibc.core.commitment.v1.MerkleProof.repeatedFields_, null, ) } goog.inherits(proto.ibc.core.commitment.v1.MerkleProof, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.ibc.core.commitment.v1.MerkleProof.displayName = 'proto.ibc.core.commitment.v1.MerkleProof' } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.ibc.core.commitment.v1.MerkleRoot.prototype.toObject = function ( opt_includeInstance, ) { return proto.ibc.core.commitment.v1.MerkleRoot.toObject( opt_includeInstance, this, ) } /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.ibc.core.commitment.v1.MerkleRoot} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.ibc.core.commitment.v1.MerkleRoot.toObject = function ( includeInstance, msg, ) { var f, obj = { hash: msg.getHash_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.ibc.core.commitment.v1.MerkleRoot} */ proto.ibc.core.commitment.v1.MerkleRoot.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes) var msg = new proto.ibc.core.commitment.v1.MerkleRoot() return proto.ibc.core.commitment.v1.MerkleRoot.deserializeBinaryFromReader( msg, reader, ) } /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.ibc.core.commitment.v1.MerkleRoot} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.ibc.core.commitment.v1.MerkleRoot} */ proto.ibc.core.commitment.v1.MerkleRoot.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.setHash(value) break default: reader.skipField() break } } return msg } /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.ibc.core.commitment.v1.MerkleRoot.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter() proto.ibc.core.commitment.v1.MerkleRoot.serializeBinaryToWriter( this, writer, ) return writer.getResultBuffer() } /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.ibc.core.commitment.v1.MerkleRoot} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.ibc.core.commitment.v1.MerkleRoot.serializeBinaryToWriter = function ( message, writer, ) { var f = undefined f = message.getHash_asU8() if (f.length > 0) { writer.writeBytes(1, f) } } /** * optional bytes hash = 1; * @return {!(string|Uint8Array)} */ proto.ibc.core.commitment.v1.MerkleRoot.prototype.getHash = function () { return /** @type {!(string|Uint8Array)} */ ( jspb.Message.getFieldWithDefault(this, 1, '') ) } /** * optional bytes hash = 1; * This is a type-conversion wrapper around `getHash()` * @return {string} */ proto.ibc.core.commitment.v1.MerkleRoot.prototype.getHash_asB64 = function () { return /** @type {string} */ (jspb.Message.bytesAsB64(this.getHash())) } /** * optional bytes hash = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getHash()` * @return {!Uint8Array} */ proto.ibc.core.commitment.v1.MerkleRoot.prototype.getHash_asU8 = function () { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(this.getHash())) } /** * @param {!(string|Uint8Array)} value * @return {!proto.ibc.core.commitment.v1.MerkleRoot} returns this */ proto.ibc.core.commitment.v1.MerkleRoot.prototype.setHash = function (value) { return jspb.Message.setProto3BytesField(this, 1, value) } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.ibc.core.commitment.v1.MerklePrefix.prototype.toObject = function ( opt_includeInstance, ) { return proto.ibc.core.commitment.v1.MerklePrefix.toObject( opt_includeInstance, this, ) } /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.ibc.core.commitment.v1.MerklePrefix} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.ibc.core.commitment.v1.MerklePrefix.toObject = function ( includeInstance, msg, ) { var f, obj = { keyPrefix: msg.getKeyPrefix_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.ibc.core.commitment.v1.MerklePrefix} */ proto.ibc.core.commitment.v1.MerklePrefix.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes) var msg = new proto.ibc.core.commitment.v1.MerklePrefix() return proto.ibc.core.commitment.v1.MerklePrefix.deserializeBinaryFromReader( msg, reader, ) } /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.ibc.core.commitment.v1.MerklePrefix} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.ibc.core.commitment.v1.MerklePrefix} */ proto.ibc.core.commitment.v1.MerklePrefix.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.setKeyPrefix(value) break default: reader.skipField() break } } return msg } /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.ibc.core.commitment.v1.MerklePrefix.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter() proto.ibc.core.commitment.v1.MerklePrefix.serializeBinaryToWriter( this, writer, ) return writer.getResultBuffer() } /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.ibc.core.commitment.v1.MerklePrefix} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.ibc.core.commitment.v1.MerklePrefix.serializeBinaryToWriter = function ( message, writer, ) { var f = undefined f = message.getKeyPrefix_asU8() if (f.length > 0) { writer.writeBytes(1, f) } } /** * optional bytes key_prefix = 1; * @return {!(string|Uint8Array)} */ proto.ibc.core.commitment.v1.MerklePrefix.prototype.getKeyPrefix = function () { return /** @type {!(string|Uint8Array)} */ ( jspb.Message.getFieldWithDefault(this, 1, '') ) } /** * optional bytes key_prefix = 1; * This is a type-conversion wrapper around `getKeyPrefix()` * @return {string} */ proto.ibc.core.commitment.v1.MerklePrefix.prototype.getKeyPrefix_asB64 = function () { return /** @type {string} */ (jspb.Message.bytesAsB64(this.getKeyPrefix())) } /** * optional bytes key_prefix = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getKeyPrefix()` * @return {!Uint8Array} */ proto.ibc.core.commitment.v1.MerklePrefix.prototype.getKeyPrefix_asU8 = function () { return /** @type {!Uint8Array} */ ( jspb.Message.bytesAsU8(this.getKeyPrefix()) ) } /** * @param {!(string|Uint8Array)} value * @return {!proto.ibc.core.commitment.v1.MerklePrefix} returns this */ proto.ibc.core.commitment.v1.MerklePrefix.prototype.setKeyPrefix = function ( value, ) { return jspb.Message.setProto3BytesField(this, 1, value) } /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.ibc.core.commitment.v1.MerklePath.repeatedFields_ = [1] if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.ibc.core.commitment.v1.MerklePath.prototype.toObject = function ( opt_includeInstance, ) { return proto.ibc.core.commitment.v1.MerklePath.toObject( opt_includeInstance, this, ) } /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.ibc.core.commitment.v1.MerklePath} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.ibc.core.commitment.v1.MerklePath.toObject = function ( includeInstance, msg, ) { var f, obj = { keyPathList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : 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.ibc.core.commitment.v1.MerklePath} */ proto.ibc.core.commitment.v1.MerklePath.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes) var msg = new proto.ibc.core.commitment.v1.MerklePath() return proto.ibc.core.commitment.v1.MerklePath.deserializeBinaryFromReader( msg, reader, ) } /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.ibc.core.commitment.v1.MerklePath} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.ibc.core.commitment.v1.MerklePath} */ proto.ibc.core.commitment.v1.MerklePath.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.addKeyPath(value) break default: reader.skipField() break } } return msg } /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.ibc.core.commitment.v1.MerklePath.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter() proto.ibc.core.commitment.v1.MerklePath.serializeBinaryToWriter( this, writer, ) return writer.getResultBuffer() } /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.ibc.core.commitment.v1.MerklePath} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.ibc.core.commitment.v1.MerklePath.serializeBinaryToWriter = function ( message, writer, ) { var f = undefined f = message.getKeyPathList() if (f.length > 0) { writer.writeRepeatedString(1, f) } } /** * repeated string key_path = 1; * @return {!Array<string>} */ proto.ibc.core.commitment.v1.MerklePath.prototype.getKeyPathList = function () { return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 1)) } /** * @param {!Array<string>} value * @return {!proto.ibc.core.commitment.v1.MerklePath} returns this */ proto.ibc.core.commitment.v1.MerklePath.prototype.setKeyPathList = function ( value, ) { return jspb.Message.setField(this, 1, value || []) } /** * @param {string} value * @param {number=} opt_index * @return {!proto.ibc.core.commitment.v1.MerklePath} returns this */ proto.ibc.core.commitment.v1.MerklePath.prototype.addKeyPath = function ( value, opt_index, ) { return jspb.Message.addToRepeatedField(this, 1, value, opt_index) } /** * Clears the list making it empty but non-null. * @return {!proto.ibc.core.commitment.v1.MerklePath} returns this */ proto.ibc.core.commitment.v1.MerklePath.prototype.clearKeyPathList = function () { return this.setKeyPathList([]) } /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.ibc.core.commitment.v1.MerkleProof.repeatedFields_ = [1] if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.ibc.core.commitment.v1.MerkleProof.prototype.toObject = function ( opt_includeInstance, ) { return proto.ibc.core.commitment.v1.MerkleProof.toObject( opt_includeInstance, this, ) } /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.ibc.core.commitment.v1.MerkleProof} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.ibc.core.commitment.v1.MerkleProof.toObject = function ( includeInstance, msg, ) { var f, obj = { proofsList: jspb.Message.toObjectList( msg.getProofsList(), cosmos_ics23_v1_proofs_pb.CommitmentProof.toObject, includeInstance, ), } if (includeInstance) { obj.$jspbMessageInstance = msg } return obj } } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.ibc.core.commitment.v1.MerkleProof} */ proto.ibc.core.commitment.v1.MerkleProof.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes) var msg = new proto.ibc.core.commitment.v1.MerkleProof() return proto.ibc.core.commitment.v1.MerkleProof.deserializeBinaryFromReader( msg, reader, ) } /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.ibc.core.commitment.v1.MerkleProof} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.ibc.core.commitment.v1.MerkleProof} */ proto.ibc.core.commitment.v1.MerkleProof.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break } var field = reader.getFieldNumber() switch (field) { case 1: var value = new cosmos_ics23_v1_proofs_pb.CommitmentProof() reader.readMessage( value, cosmos_ics23_v1_proofs_pb.CommitmentProof .deserializeBinaryFromReader, ) msg.addProofs(value) break default: reader.skipField() break } } return msg } /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.ibc.core.commitment.v1.MerkleProof.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter() proto.ibc.core.commitment.v1.MerkleProof.serializeBinaryToWriter( this, writer, ) return writer.getResultBuffer() } /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.ibc.core.commitment.v1.MerkleProof} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.ibc.core.commitment.v1.MerkleProof.serializeBinaryToWriter = function ( message, writer, ) { var f = undefined f = message.getProofsList() if (f.length > 0) { writer.writeRepeatedMessage( 1, f, cosmos_ics23_v1_proofs_pb.CommitmentProof.serializeBinaryToWriter, ) } } /** * repeated cosmos.ics23.v1.CommitmentProof proofs = 1; * @return {!Array<!proto.cosmos.ics23.v1.CommitmentProof>} */ proto.ibc.core.commitment.v1.MerkleProof.prototype.getProofsList = function () { return /** @type{!Array<!proto.cosmos.ics23.v1.CommitmentProof>} */ ( jspb.Message.getRepeatedWrapperField( this, cosmos_ics23_v1_proofs_pb.CommitmentProof, 1, ) ) } /** * @param {!Array<!proto.cosmos.ics23.v1.CommitmentProof>} value * @return {!proto.ibc.core.commitment.v1.MerkleProof} returns this */ proto.ibc.core.commitment.v1.MerkleProof.prototype.setProofsList = function ( value, ) { return jspb.Message.setRepeatedWrapperField(this, 1, value) } /** * @param {!proto.cosmos.ics23.v1.CommitmentProof=} opt_value * @param {number=} opt_index * @return {!proto.cosmos.ics23.v1.CommitmentProof} */ proto.ibc.core.commitment.v1.MerkleProof.prototype.addProofs = function ( opt_value, opt_index, ) { return jspb.Message.addToRepeatedWrapperField( this, 1, opt_value, proto.cosmos.ics23.v1.CommitmentProof, opt_index, ) } /** * Clears the list making it empty but non-null. * @return {!proto.ibc.core.commitment.v1.MerkleProof} returns this */ proto.ibc.core.commitment.v1.MerkleProof.prototype.clearProofsList = function () { return this.setProofsList([]) } goog.object.extend(exports, proto.ibc.core.commitment.v1)