@provenanceio/wallet-utils
Version:
Typescript Utilities for Provenance Blockchain Wallet
967 lines (791 loc) • 29.9 kB
JavaScript
"use strict";
// source: provenance/exchange/v1/commitments.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 || window || global || self || Function('return this')();
}.call(null);
var cosmos_base_v1beta1_coin_pb = require('../../../cosmos/base/v1beta1/coin_pb.js');
goog.object.extend(proto, cosmos_base_v1beta1_coin_pb);
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);
goog.exportSymbol('proto.provenance.exchange.v1.AccountAmount', null, global);
goog.exportSymbol('proto.provenance.exchange.v1.Commitment', null, global);
goog.exportSymbol('proto.provenance.exchange.v1.MarketAmount', null, global);
goog.exportSymbol('proto.provenance.exchange.v1.NetAssetPrice', 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.provenance.exchange.v1.Commitment = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.provenance.exchange.v1.Commitment.repeatedFields_, null);
};
goog.inherits(proto.provenance.exchange.v1.Commitment, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.provenance.exchange.v1.Commitment.displayName = 'proto.provenance.exchange.v1.Commitment';
}
/**
* 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.provenance.exchange.v1.AccountAmount = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.provenance.exchange.v1.AccountAmount.repeatedFields_, null);
};
goog.inherits(proto.provenance.exchange.v1.AccountAmount, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.provenance.exchange.v1.AccountAmount.displayName = 'proto.provenance.exchange.v1.AccountAmount';
}
/**
* 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.provenance.exchange.v1.MarketAmount = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.provenance.exchange.v1.MarketAmount.repeatedFields_, null);
};
goog.inherits(proto.provenance.exchange.v1.MarketAmount, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.provenance.exchange.v1.MarketAmount.displayName = 'proto.provenance.exchange.v1.MarketAmount';
}
/**
* 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.provenance.exchange.v1.NetAssetPrice = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.provenance.exchange.v1.NetAssetPrice, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.provenance.exchange.v1.NetAssetPrice.displayName = 'proto.provenance.exchange.v1.NetAssetPrice';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.provenance.exchange.v1.Commitment.repeatedFields_ = [3];
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.provenance.exchange.v1.Commitment.prototype.toObject = function (opt_includeInstance) {
return proto.provenance.exchange.v1.Commitment.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.provenance.exchange.v1.Commitment} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.provenance.exchange.v1.Commitment.toObject = function (includeInstance, msg) {
var f,
obj = {
account: jspb.Message.getFieldWithDefault(msg, 1, ""),
marketId: jspb.Message.getFieldWithDefault(msg, 2, 0),
amountList: jspb.Message.toObjectList(msg.getAmountList(), cosmos_base_v1beta1_coin_pb.Coin.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.provenance.exchange.v1.Commitment}
*/
proto.provenance.exchange.v1.Commitment.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.provenance.exchange.v1.Commitment();
return proto.provenance.exchange.v1.Commitment.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.provenance.exchange.v1.Commitment} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.provenance.exchange.v1.Commitment}
*/
proto.provenance.exchange.v1.Commitment.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.setAccount(value);
break;
case 2:
var value =
/** @type {number} */
reader.readUint32();
msg.setMarketId(value);
break;
case 3:
var value = new cosmos_base_v1beta1_coin_pb.Coin();
reader.readMessage(value, cosmos_base_v1beta1_coin_pb.Coin.deserializeBinaryFromReader);
msg.addAmount(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.provenance.exchange.v1.Commitment.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
proto.provenance.exchange.v1.Commitment.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.provenance.exchange.v1.Commitment} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.provenance.exchange.v1.Commitment.serializeBinaryToWriter = function (message, writer) {
var f = undefined;
f = message.getAccount();
if (f.length > 0) {
writer.writeString(1, f);
}
f = message.getMarketId();
if (f !== 0) {
writer.writeUint32(2, f);
}
f = message.getAmountList();
if (f.length > 0) {
writer.writeRepeatedMessage(3, f, cosmos_base_v1beta1_coin_pb.Coin.serializeBinaryToWriter);
}
};
/**
* optional string account = 1;
* @return {string}
*/
proto.provenance.exchange.v1.Commitment.prototype.getAccount = function () {
return (
/** @type {string} */
jspb.Message.getFieldWithDefault(this, 1, "")
);
};
/**
* @param {string} value
* @return {!proto.provenance.exchange.v1.Commitment} returns this
*/
proto.provenance.exchange.v1.Commitment.prototype.setAccount = function (value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional uint32 market_id = 2;
* @return {number}
*/
proto.provenance.exchange.v1.Commitment.prototype.getMarketId = function () {
return (
/** @type {number} */
jspb.Message.getFieldWithDefault(this, 2, 0)
);
};
/**
* @param {number} value
* @return {!proto.provenance.exchange.v1.Commitment} returns this
*/
proto.provenance.exchange.v1.Commitment.prototype.setMarketId = function (value) {
return jspb.Message.setProto3IntField(this, 2, value);
};
/**
* repeated cosmos.base.v1beta1.Coin amount = 3;
* @return {!Array<!proto.cosmos.base.v1beta1.Coin>}
*/
proto.provenance.exchange.v1.Commitment.prototype.getAmountList = 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.provenance.exchange.v1.Commitment} returns this
*/
proto.provenance.exchange.v1.Commitment.prototype.setAmountList = 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.provenance.exchange.v1.Commitment.prototype.addAmount = 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.provenance.exchange.v1.Commitment} returns this
*/
proto.provenance.exchange.v1.Commitment.prototype.clearAmountList = function () {
return this.setAmountList([]);
};
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.provenance.exchange.v1.AccountAmount.repeatedFields_ = [2];
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.provenance.exchange.v1.AccountAmount.prototype.toObject = function (opt_includeInstance) {
return proto.provenance.exchange.v1.AccountAmount.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.provenance.exchange.v1.AccountAmount} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.provenance.exchange.v1.AccountAmount.toObject = function (includeInstance, msg) {
var f,
obj = {
account: jspb.Message.getFieldWithDefault(msg, 1, ""),
amountList: jspb.Message.toObjectList(msg.getAmountList(), cosmos_base_v1beta1_coin_pb.Coin.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.provenance.exchange.v1.AccountAmount}
*/
proto.provenance.exchange.v1.AccountAmount.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.provenance.exchange.v1.AccountAmount();
return proto.provenance.exchange.v1.AccountAmount.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.provenance.exchange.v1.AccountAmount} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.provenance.exchange.v1.AccountAmount}
*/
proto.provenance.exchange.v1.AccountAmount.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.setAccount(value);
break;
case 2:
var value = new cosmos_base_v1beta1_coin_pb.Coin();
reader.readMessage(value, cosmos_base_v1beta1_coin_pb.Coin.deserializeBinaryFromReader);
msg.addAmount(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.provenance.exchange.v1.AccountAmount.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
proto.provenance.exchange.v1.AccountAmount.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.provenance.exchange.v1.AccountAmount} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.provenance.exchange.v1.AccountAmount.serializeBinaryToWriter = function (message, writer) {
var f = undefined;
f = message.getAccount();
if (f.length > 0) {
writer.writeString(1, f);
}
f = message.getAmountList();
if (f.length > 0) {
writer.writeRepeatedMessage(2, f, cosmos_base_v1beta1_coin_pb.Coin.serializeBinaryToWriter);
}
};
/**
* optional string account = 1;
* @return {string}
*/
proto.provenance.exchange.v1.AccountAmount.prototype.getAccount = function () {
return (
/** @type {string} */
jspb.Message.getFieldWithDefault(this, 1, "")
);
};
/**
* @param {string} value
* @return {!proto.provenance.exchange.v1.AccountAmount} returns this
*/
proto.provenance.exchange.v1.AccountAmount.prototype.setAccount = function (value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* repeated cosmos.base.v1beta1.Coin amount = 2;
* @return {!Array<!proto.cosmos.base.v1beta1.Coin>}
*/
proto.provenance.exchange.v1.AccountAmount.prototype.getAmountList = function () {
return (
/** @type{!Array<!proto.cosmos.base.v1beta1.Coin>} */
jspb.Message.getRepeatedWrapperField(this, cosmos_base_v1beta1_coin_pb.Coin, 2)
);
};
/**
* @param {!Array<!proto.cosmos.base.v1beta1.Coin>} value
* @return {!proto.provenance.exchange.v1.AccountAmount} returns this
*/
proto.provenance.exchange.v1.AccountAmount.prototype.setAmountList = function (value) {
return jspb.Message.setRepeatedWrapperField(this, 2, value);
};
/**
* @param {!proto.cosmos.base.v1beta1.Coin=} opt_value
* @param {number=} opt_index
* @return {!proto.cosmos.base.v1beta1.Coin}
*/
proto.provenance.exchange.v1.AccountAmount.prototype.addAmount = function (opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.cosmos.base.v1beta1.Coin, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.provenance.exchange.v1.AccountAmount} returns this
*/
proto.provenance.exchange.v1.AccountAmount.prototype.clearAmountList = function () {
return this.setAmountList([]);
};
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.provenance.exchange.v1.MarketAmount.repeatedFields_ = [2];
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.provenance.exchange.v1.MarketAmount.prototype.toObject = function (opt_includeInstance) {
return proto.provenance.exchange.v1.MarketAmount.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.provenance.exchange.v1.MarketAmount} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.provenance.exchange.v1.MarketAmount.toObject = function (includeInstance, msg) {
var f,
obj = {
marketId: jspb.Message.getFieldWithDefault(msg, 1, 0),
amountList: jspb.Message.toObjectList(msg.getAmountList(), cosmos_base_v1beta1_coin_pb.Coin.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.provenance.exchange.v1.MarketAmount}
*/
proto.provenance.exchange.v1.MarketAmount.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.provenance.exchange.v1.MarketAmount();
return proto.provenance.exchange.v1.MarketAmount.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.provenance.exchange.v1.MarketAmount} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.provenance.exchange.v1.MarketAmount}
*/
proto.provenance.exchange.v1.MarketAmount.deserializeBinaryFromReader = function (msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value =
/** @type {number} */
reader.readUint32();
msg.setMarketId(value);
break;
case 2:
var value = new cosmos_base_v1beta1_coin_pb.Coin();
reader.readMessage(value, cosmos_base_v1beta1_coin_pb.Coin.deserializeBinaryFromReader);
msg.addAmount(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.provenance.exchange.v1.MarketAmount.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
proto.provenance.exchange.v1.MarketAmount.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.provenance.exchange.v1.MarketAmount} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.provenance.exchange.v1.MarketAmount.serializeBinaryToWriter = function (message, writer) {
var f = undefined;
f = message.getMarketId();
if (f !== 0) {
writer.writeUint32(1, f);
}
f = message.getAmountList();
if (f.length > 0) {
writer.writeRepeatedMessage(2, f, cosmos_base_v1beta1_coin_pb.Coin.serializeBinaryToWriter);
}
};
/**
* optional uint32 market_id = 1;
* @return {number}
*/
proto.provenance.exchange.v1.MarketAmount.prototype.getMarketId = function () {
return (
/** @type {number} */
jspb.Message.getFieldWithDefault(this, 1, 0)
);
};
/**
* @param {number} value
* @return {!proto.provenance.exchange.v1.MarketAmount} returns this
*/
proto.provenance.exchange.v1.MarketAmount.prototype.setMarketId = function (value) {
return jspb.Message.setProto3IntField(this, 1, value);
};
/**
* repeated cosmos.base.v1beta1.Coin amount = 2;
* @return {!Array<!proto.cosmos.base.v1beta1.Coin>}
*/
proto.provenance.exchange.v1.MarketAmount.prototype.getAmountList = function () {
return (
/** @type{!Array<!proto.cosmos.base.v1beta1.Coin>} */
jspb.Message.getRepeatedWrapperField(this, cosmos_base_v1beta1_coin_pb.Coin, 2)
);
};
/**
* @param {!Array<!proto.cosmos.base.v1beta1.Coin>} value
* @return {!proto.provenance.exchange.v1.MarketAmount} returns this
*/
proto.provenance.exchange.v1.MarketAmount.prototype.setAmountList = function (value) {
return jspb.Message.setRepeatedWrapperField(this, 2, value);
};
/**
* @param {!proto.cosmos.base.v1beta1.Coin=} opt_value
* @param {number=} opt_index
* @return {!proto.cosmos.base.v1beta1.Coin}
*/
proto.provenance.exchange.v1.MarketAmount.prototype.addAmount = function (opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.cosmos.base.v1beta1.Coin, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.provenance.exchange.v1.MarketAmount} returns this
*/
proto.provenance.exchange.v1.MarketAmount.prototype.clearAmountList = function () {
return this.setAmountList([]);
};
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.provenance.exchange.v1.NetAssetPrice.prototype.toObject = function (opt_includeInstance) {
return proto.provenance.exchange.v1.NetAssetPrice.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.provenance.exchange.v1.NetAssetPrice} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.provenance.exchange.v1.NetAssetPrice.toObject = function (includeInstance, msg) {
var f,
obj = {
assets: (f = msg.getAssets()) && cosmos_base_v1beta1_coin_pb.Coin.toObject(includeInstance, f),
price: (f = msg.getPrice()) && cosmos_base_v1beta1_coin_pb.Coin.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.provenance.exchange.v1.NetAssetPrice}
*/
proto.provenance.exchange.v1.NetAssetPrice.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.provenance.exchange.v1.NetAssetPrice();
return proto.provenance.exchange.v1.NetAssetPrice.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.provenance.exchange.v1.NetAssetPrice} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.provenance.exchange.v1.NetAssetPrice}
*/
proto.provenance.exchange.v1.NetAssetPrice.deserializeBinaryFromReader = function (msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new cosmos_base_v1beta1_coin_pb.Coin();
reader.readMessage(value, cosmos_base_v1beta1_coin_pb.Coin.deserializeBinaryFromReader);
msg.setAssets(value);
break;
case 2:
var value = new cosmos_base_v1beta1_coin_pb.Coin();
reader.readMessage(value, cosmos_base_v1beta1_coin_pb.Coin.deserializeBinaryFromReader);
msg.setPrice(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.provenance.exchange.v1.NetAssetPrice.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
proto.provenance.exchange.v1.NetAssetPrice.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.provenance.exchange.v1.NetAssetPrice} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.provenance.exchange.v1.NetAssetPrice.serializeBinaryToWriter = function (message, writer) {
var f = undefined;
f = message.getAssets();
if (f != null) {
writer.writeMessage(1, f, cosmos_base_v1beta1_coin_pb.Coin.serializeBinaryToWriter);
}
f = message.getPrice();
if (f != null) {
writer.writeMessage(2, f, cosmos_base_v1beta1_coin_pb.Coin.serializeBinaryToWriter);
}
};
/**
* optional cosmos.base.v1beta1.Coin assets = 1;
* @return {?proto.cosmos.base.v1beta1.Coin}
*/
proto.provenance.exchange.v1.NetAssetPrice.prototype.getAssets = function () {
return (
/** @type{?proto.cosmos.base.v1beta1.Coin} */
jspb.Message.getWrapperField(this, cosmos_base_v1beta1_coin_pb.Coin, 1)
);
};
/**
* @param {?proto.cosmos.base.v1beta1.Coin|undefined} value
* @return {!proto.provenance.exchange.v1.NetAssetPrice} returns this
*/
proto.provenance.exchange.v1.NetAssetPrice.prototype.setAssets = function (value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.provenance.exchange.v1.NetAssetPrice} returns this
*/
proto.provenance.exchange.v1.NetAssetPrice.prototype.clearAssets = function () {
return this.setAssets(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.provenance.exchange.v1.NetAssetPrice.prototype.hasAssets = function () {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional cosmos.base.v1beta1.Coin price = 2;
* @return {?proto.cosmos.base.v1beta1.Coin}
*/
proto.provenance.exchange.v1.NetAssetPrice.prototype.getPrice = function () {
return (
/** @type{?proto.cosmos.base.v1beta1.Coin} */
jspb.Message.getWrapperField(this, cosmos_base_v1beta1_coin_pb.Coin, 2)
);
};
/**
* @param {?proto.cosmos.base.v1beta1.Coin|undefined} value
* @return {!proto.provenance.exchange.v1.NetAssetPrice} returns this
*/
proto.provenance.exchange.v1.NetAssetPrice.prototype.setPrice = function (value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.provenance.exchange.v1.NetAssetPrice} returns this
*/
proto.provenance.exchange.v1.NetAssetPrice.prototype.clearPrice = function () {
return this.setPrice(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.provenance.exchange.v1.NetAssetPrice.prototype.hasPrice = function () {
return jspb.Message.getField(this, 2) != null;
};
goog.object.extend(exports, proto.provenance.exchange.v1);