UNPKG

@bandprotocol/bandchain.js

Version:

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

620 lines (580 loc) 19.4 kB
// source: ibc/applications/transfer/v1/authz.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 cosmos_proto_cosmos_pb = require('../../../../cosmos_proto/cosmos_pb.js') goog.object.extend(proto, cosmos_proto_cosmos_pb) var gogoproto_gogo_pb = require('../../../../gogoproto/gogo_pb.js') goog.object.extend(proto, gogoproto_gogo_pb) var cosmos_base_v1beta1_coin_pb = require('../../../../cosmos/base/v1beta1/coin_pb.js') goog.object.extend(proto, cosmos_base_v1beta1_coin_pb) goog.exportSymbol('proto.ibc.applications.transfer.v1.Allocation', null, global) goog.exportSymbol( 'proto.ibc.applications.transfer.v1.TransferAuthorization', 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.applications.transfer.v1.Allocation = function (opt_data) { jspb.Message.initialize( this, opt_data, 0, -1, proto.ibc.applications.transfer.v1.Allocation.repeatedFields_, null, ) } goog.inherits(proto.ibc.applications.transfer.v1.Allocation, jspb.Message) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.ibc.applications.transfer.v1.Allocation.displayName = 'proto.ibc.applications.transfer.v1.Allocation' } /** * 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.applications.transfer.v1.TransferAuthorization = function (opt_data) { jspb.Message.initialize( this, opt_data, 0, -1, proto.ibc.applications.transfer.v1.TransferAuthorization.repeatedFields_, null, ) } goog.inherits( proto.ibc.applications.transfer.v1.TransferAuthorization, jspb.Message, ) if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.ibc.applications.transfer.v1.TransferAuthorization.displayName = 'proto.ibc.applications.transfer.v1.TransferAuthorization' } /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.ibc.applications.transfer.v1.Allocation.repeatedFields_ = [3, 4, 5] 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.applications.transfer.v1.Allocation.prototype.toObject = function ( opt_includeInstance, ) { return proto.ibc.applications.transfer.v1.Allocation.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.applications.transfer.v1.Allocation} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.ibc.applications.transfer.v1.Allocation.toObject = function ( includeInstance, msg, ) { var f, obj = { sourcePort: jspb.Message.getFieldWithDefault(msg, 1, ''), sourceChannel: jspb.Message.getFieldWithDefault(msg, 2, ''), spendLimitList: jspb.Message.toObjectList( msg.getSpendLimitList(), cosmos_base_v1beta1_coin_pb.Coin.toObject, includeInstance, ), allowListList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f, allowedPacketDataList: (f = jspb.Message.getRepeatedField(msg, 5)) == 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.applications.transfer.v1.Allocation} */ proto.ibc.applications.transfer.v1.Allocation.deserializeBinary = function ( bytes, ) { var reader = new jspb.BinaryReader(bytes) var msg = new proto.ibc.applications.transfer.v1.Allocation() return proto.ibc.applications.transfer.v1.Allocation.deserializeBinaryFromReader( msg, reader, ) } /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.ibc.applications.transfer.v1.Allocation} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.ibc.applications.transfer.v1.Allocation} */ proto.ibc.applications.transfer.v1.Allocation.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.setSourcePort(value) break case 2: var value = /** @type {string} */ (reader.readString()) msg.setSourceChannel(value) break case 3: var value = new cosmos_base_v1beta1_coin_pb.Coin() reader.readMessage( value, cosmos_base_v1beta1_coin_pb.Coin.deserializeBinaryFromReader, ) msg.addSpendLimit(value) break case 4: var value = /** @type {string} */ (reader.readString()) msg.addAllowList(value) break case 5: var value = /** @type {string} */ (reader.readString()) msg.addAllowedPacketData(value) break default: reader.skipField() break } } return msg } /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.ibc.applications.transfer.v1.Allocation.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter() proto.ibc.applications.transfer.v1.Allocation.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.applications.transfer.v1.Allocation} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.ibc.applications.transfer.v1.Allocation.serializeBinaryToWriter = function (message, writer) { var f = undefined f = message.getSourcePort() if (f.length > 0) { writer.writeString(1, f) } f = message.getSourceChannel() if (f.length > 0) { writer.writeString(2, f) } f = message.getSpendLimitList() if (f.length > 0) { writer.writeRepeatedMessage( 3, f, cosmos_base_v1beta1_coin_pb.Coin.serializeBinaryToWriter, ) } f = message.getAllowListList() if (f.length > 0) { writer.writeRepeatedString(4, f) } f = message.getAllowedPacketDataList() if (f.length > 0) { writer.writeRepeatedString(5, f) } } /** * optional string source_port = 1; * @return {string} */ proto.ibc.applications.transfer.v1.Allocation.prototype.getSourcePort = function () { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, '')) } /** * @param {string} value * @return {!proto.ibc.applications.transfer.v1.Allocation} returns this */ proto.ibc.applications.transfer.v1.Allocation.prototype.setSourcePort = function (value) { return jspb.Message.setProto3StringField(this, 1, value) } /** * optional string source_channel = 2; * @return {string} */ proto.ibc.applications.transfer.v1.Allocation.prototype.getSourceChannel = function () { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, '')) } /** * @param {string} value * @return {!proto.ibc.applications.transfer.v1.Allocation} returns this */ proto.ibc.applications.transfer.v1.Allocation.prototype.setSourceChannel = function (value) { return jspb.Message.setProto3StringField(this, 2, value) } /** * repeated cosmos.base.v1beta1.Coin spend_limit = 3; * @return {!Array<!proto.cosmos.base.v1beta1.Coin>} */ proto.ibc.applications.transfer.v1.Allocation.prototype.getSpendLimitList = function () { return /** @type{!Array<!proto.cosmos.base.v1beta1.Coin>} */ ( jspb.Message.getRepeatedWrapperField( this, cosmos_base_v1beta1_coin_pb.Coin, 3, ) ) } /** * @param {!Array<!proto.cosmos.base.v1beta1.Coin>} value * @return {!proto.ibc.applications.transfer.v1.Allocation} returns this */ proto.ibc.applications.transfer.v1.Allocation.prototype.setSpendLimitList = function (value) { return jspb.Message.setRepeatedWrapperField(this, 3, value) } /** * @param {!proto.cosmos.base.v1beta1.Coin=} opt_value * @param {number=} opt_index * @return {!proto.cosmos.base.v1beta1.Coin} */ proto.ibc.applications.transfer.v1.Allocation.prototype.addSpendLimit = function (opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField( this, 3, opt_value, proto.cosmos.base.v1beta1.Coin, opt_index, ) } /** * Clears the list making it empty but non-null. * @return {!proto.ibc.applications.transfer.v1.Allocation} returns this */ proto.ibc.applications.transfer.v1.Allocation.prototype.clearSpendLimitList = function () { return this.setSpendLimitList([]) } /** * repeated string allow_list = 4; * @return {!Array<string>} */ proto.ibc.applications.transfer.v1.Allocation.prototype.getAllowListList = function () { return /** @type {!Array<string>} */ ( jspb.Message.getRepeatedField(this, 4) ) } /** * @param {!Array<string>} value * @return {!proto.ibc.applications.transfer.v1.Allocation} returns this */ proto.ibc.applications.transfer.v1.Allocation.prototype.setAllowListList = function (value) { return jspb.Message.setField(this, 4, value || []) } /** * @param {string} value * @param {number=} opt_index * @return {!proto.ibc.applications.transfer.v1.Allocation} returns this */ proto.ibc.applications.transfer.v1.Allocation.prototype.addAllowList = function (value, opt_index) { return jspb.Message.addToRepeatedField(this, 4, value, opt_index) } /** * Clears the list making it empty but non-null. * @return {!proto.ibc.applications.transfer.v1.Allocation} returns this */ proto.ibc.applications.transfer.v1.Allocation.prototype.clearAllowListList = function () { return this.setAllowListList([]) } /** * repeated string allowed_packet_data = 5; * @return {!Array<string>} */ proto.ibc.applications.transfer.v1.Allocation.prototype.getAllowedPacketDataList = function () { return /** @type {!Array<string>} */ ( jspb.Message.getRepeatedField(this, 5) ) } /** * @param {!Array<string>} value * @return {!proto.ibc.applications.transfer.v1.Allocation} returns this */ proto.ibc.applications.transfer.v1.Allocation.prototype.setAllowedPacketDataList = function (value) { return jspb.Message.setField(this, 5, value || []) } /** * @param {string} value * @param {number=} opt_index * @return {!proto.ibc.applications.transfer.v1.Allocation} returns this */ proto.ibc.applications.transfer.v1.Allocation.prototype.addAllowedPacketData = function (value, opt_index) { return jspb.Message.addToRepeatedField(this, 5, value, opt_index) } /** * Clears the list making it empty but non-null. * @return {!proto.ibc.applications.transfer.v1.Allocation} returns this */ proto.ibc.applications.transfer.v1.Allocation.prototype.clearAllowedPacketDataList = function () { return this.setAllowedPacketDataList([]) } /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.ibc.applications.transfer.v1.TransferAuthorization.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.applications.transfer.v1.TransferAuthorization.prototype.toObject = function (opt_includeInstance) { return proto.ibc.applications.transfer.v1.TransferAuthorization.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.applications.transfer.v1.TransferAuthorization} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.ibc.applications.transfer.v1.TransferAuthorization.toObject = function ( includeInstance, msg, ) { var f, obj = { allocationsList: jspb.Message.toObjectList( msg.getAllocationsList(), proto.ibc.applications.transfer.v1.Allocation.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.applications.transfer.v1.TransferAuthorization} */ proto.ibc.applications.transfer.v1.TransferAuthorization.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes) var msg = new proto.ibc.applications.transfer.v1.TransferAuthorization() return proto.ibc.applications.transfer.v1.TransferAuthorization.deserializeBinaryFromReader( msg, reader, ) } /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.ibc.applications.transfer.v1.TransferAuthorization} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.ibc.applications.transfer.v1.TransferAuthorization} */ proto.ibc.applications.transfer.v1.TransferAuthorization.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break } var field = reader.getFieldNumber() switch (field) { case 1: var value = new proto.ibc.applications.transfer.v1.Allocation() reader.readMessage( value, proto.ibc.applications.transfer.v1.Allocation .deserializeBinaryFromReader, ) msg.addAllocations(value) break default: reader.skipField() break } } return msg } /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.ibc.applications.transfer.v1.TransferAuthorization.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter() proto.ibc.applications.transfer.v1.TransferAuthorization.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.applications.transfer.v1.TransferAuthorization} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.ibc.applications.transfer.v1.TransferAuthorization.serializeBinaryToWriter = function (message, writer) { var f = undefined f = message.getAllocationsList() if (f.length > 0) { writer.writeRepeatedMessage( 1, f, proto.ibc.applications.transfer.v1.Allocation.serializeBinaryToWriter, ) } } /** * repeated Allocation allocations = 1; * @return {!Array<!proto.ibc.applications.transfer.v1.Allocation>} */ proto.ibc.applications.transfer.v1.TransferAuthorization.prototype.getAllocationsList = function () { return /** @type{!Array<!proto.ibc.applications.transfer.v1.Allocation>} */ ( jspb.Message.getRepeatedWrapperField( this, proto.ibc.applications.transfer.v1.Allocation, 1, ) ) } /** * @param {!Array<!proto.ibc.applications.transfer.v1.Allocation>} value * @return {!proto.ibc.applications.transfer.v1.TransferAuthorization} returns this */ proto.ibc.applications.transfer.v1.TransferAuthorization.prototype.setAllocationsList = function (value) { return jspb.Message.setRepeatedWrapperField(this, 1, value) } /** * @param {!proto.ibc.applications.transfer.v1.Allocation=} opt_value * @param {number=} opt_index * @return {!proto.ibc.applications.transfer.v1.Allocation} */ proto.ibc.applications.transfer.v1.TransferAuthorization.prototype.addAllocations = function (opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField( this, 1, opt_value, proto.ibc.applications.transfer.v1.Allocation, opt_index, ) } /** * Clears the list making it empty but non-null. * @return {!proto.ibc.applications.transfer.v1.TransferAuthorization} returns this */ proto.ibc.applications.transfer.v1.TransferAuthorization.prototype.clearAllocationsList = function () { return this.setAllocationsList([]) } goog.object.extend(exports, proto.ibc.applications.transfer.v1)