| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259 |
- /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
- "use strict";
- var $protobuf = require("protobufjs/minimal");
- // Common aliases
- var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
- // Exported root namespace
- var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
- $root.type = (function() {
- /**
- * Namespace type.
- * @exports type
- * @namespace
- */
- var type = {};
- type.googleapis = (function() {
- /**
- * Namespace googleapis.
- * @memberof type
- * @namespace
- */
- var googleapis = {};
- googleapis.com = (function() {
- /**
- * Namespace com.
- * @memberof type.googleapis
- * @namespace
- */
- var com = {};
- com.Response = (function() {
- /**
- * Properties of a Response.
- * @memberof type.googleapis.com
- * @interface IResponse
- * @property {string|null} [biz] Response biz
- * @property {string|null} [type] Response type
- * @property {string|null} [base] Response base
- * @property {string|null} [quote] Response quote
- * @property {string|null} [contractcode] Response contractcode
- * @property {string|null} [granularity] Response granularity
- * @property {type.googleapis.com.IData|null} [data] Response data
- * @property {number|null} [env] Response env
- */
- /**
- * Constructs a new Response.
- * @memberof type.googleapis.com
- * @classdesc Represents a Response.
- * @implements IResponse
- * @constructor
- * @param {type.googleapis.com.IResponse=} [properties] Properties to set
- */
- function Response(properties) {
- if (properties)
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
- if (properties[keys[i]] != null)
- this[keys[i]] = properties[keys[i]];
- }
- /**
- * Response biz.
- * @member {string} biz
- * @memberof type.googleapis.com.Response
- * @instance
- */
- Response.prototype.biz = "";
- /**
- * Response type.
- * @member {string} type
- * @memberof type.googleapis.com.Response
- * @instance
- */
- Response.prototype.type = "";
- /**
- * Response base.
- * @member {string} base
- * @memberof type.googleapis.com.Response
- * @instance
- */
- Response.prototype.base = "";
- /**
- * Response quote.
- * @member {string} quote
- * @memberof type.googleapis.com.Response
- * @instance
- */
- Response.prototype.quote = "";
- /**
- * Response contractcode.
- * @member {string} contractcode
- * @memberof type.googleapis.com.Response
- * @instance
- */
- Response.prototype.contractcode = "";
- /**
- * Response granularity.
- * @member {string} granularity
- * @memberof type.googleapis.com.Response
- * @instance
- */
- Response.prototype.granularity = "";
- /**
- * Response data.
- * @member {type.googleapis.com.IData|null|undefined} data
- * @memberof type.googleapis.com.Response
- * @instance
- */
- Response.prototype.data = null;
- /**
- * Response env.
- * @member {number} env
- * @memberof type.googleapis.com.Response
- * @instance
- */
- Response.prototype.env = 0;
- /**
- * Creates a new Response instance using the specified properties.
- * @function create
- * @memberof type.googleapis.com.Response
- * @static
- * @param {type.googleapis.com.IResponse=} [properties] Properties to set
- * @returns {type.googleapis.com.Response} Response instance
- */
- Response.create = function create(properties) {
- return new Response(properties);
- };
- /**
- * Encodes the specified Response message. Does not implicitly {@link type.googleapis.com.Response.verify|verify} messages.
- * @function encode
- * @memberof type.googleapis.com.Response
- * @static
- * @param {type.googleapis.com.IResponse} message Response message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- Response.encode = function encode(message, writer) {
- if (!writer)
- writer = $Writer.create();
- if (message.biz != null && Object.hasOwnProperty.call(message, "biz"))
- writer.uint32(/* id 1, wireType 2 =*/10).string(message.biz);
- if (message.type != null && Object.hasOwnProperty.call(message, "type"))
- writer.uint32(/* id 2, wireType 2 =*/18).string(message.type);
- if (message.base != null && Object.hasOwnProperty.call(message, "base"))
- writer.uint32(/* id 3, wireType 2 =*/26).string(message.base);
- if (message.quote != null && Object.hasOwnProperty.call(message, "quote"))
- writer.uint32(/* id 4, wireType 2 =*/34).string(message.quote);
- if (message.contractcode != null && Object.hasOwnProperty.call(message, "contractcode"))
- writer.uint32(/* id 5, wireType 2 =*/42).string(message.contractcode);
- if (message.granularity != null && Object.hasOwnProperty.call(message, "granularity"))
- writer.uint32(/* id 6, wireType 2 =*/50).string(message.granularity);
- if (message.data != null && Object.hasOwnProperty.call(message, "data"))
- $root.type.googleapis.com.Data.encode(message.data, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
- if (message.env != null && Object.hasOwnProperty.call(message, "env"))
- writer.uint32(/* id 8, wireType 0 =*/64).int32(message.env);
- return writer;
- };
- /**
- * Encodes the specified Response message, length delimited. Does not implicitly {@link type.googleapis.com.Response.verify|verify} messages.
- * @function encodeDelimited
- * @memberof type.googleapis.com.Response
- * @static
- * @param {type.googleapis.com.IResponse} message Response message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- Response.encodeDelimited = function encodeDelimited(message, writer) {
- return this.encode(message, writer).ldelim();
- };
- /**
- * Decodes a Response message from the specified reader or buffer.
- * @function decode
- * @memberof type.googleapis.com.Response
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @param {number} [length] Message length if known beforehand
- * @returns {type.googleapis.com.Response} Response
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- Response.decode = function decode(reader, length) {
- if (!(reader instanceof $Reader))
- reader = $Reader.create(reader);
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.type.googleapis.com.Response();
- while (reader.pos < end) {
- var tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- message.biz = reader.string();
- break;
- }
- case 2: {
- message.type = reader.string();
- break;
- }
- case 3: {
- message.base = reader.string();
- break;
- }
- case 4: {
- message.quote = reader.string();
- break;
- }
- case 5: {
- message.contractcode = reader.string();
- break;
- }
- case 6: {
- message.granularity = reader.string();
- break;
- }
- case 7: {
- message.data = $root.type.googleapis.com.Data.decode(reader, reader.uint32());
- break;
- }
- case 8: {
- message.env = reader.int32();
- break;
- }
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- };
- /**
- * Decodes a Response message from the specified reader or buffer, length delimited.
- * @function decodeDelimited
- * @memberof type.googleapis.com.Response
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @returns {type.googleapis.com.Response} Response
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- Response.decodeDelimited = function decodeDelimited(reader) {
- if (!(reader instanceof $Reader))
- reader = new $Reader(reader);
- return this.decode(reader, reader.uint32());
- };
- /**
- * Verifies a Response message.
- * @function verify
- * @memberof type.googleapis.com.Response
- * @static
- * @param {Object.<string,*>} message Plain object to verify
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
- */
- Response.verify = function verify(message) {
- if (typeof message !== "object" || message === null)
- return "object expected";
- if (message.biz != null && message.hasOwnProperty("biz"))
- if (!$util.isString(message.biz))
- return "biz: string expected";
- if (message.type != null && message.hasOwnProperty("type"))
- if (!$util.isString(message.type))
- return "type: string expected";
- if (message.base != null && message.hasOwnProperty("base"))
- if (!$util.isString(message.base))
- return "base: string expected";
- if (message.quote != null && message.hasOwnProperty("quote"))
- if (!$util.isString(message.quote))
- return "quote: string expected";
- if (message.contractcode != null && message.hasOwnProperty("contractcode"))
- if (!$util.isString(message.contractcode))
- return "contractcode: string expected";
- if (message.granularity != null && message.hasOwnProperty("granularity"))
- if (!$util.isString(message.granularity))
- return "granularity: string expected";
- if (message.data != null && message.hasOwnProperty("data")) {
- var error = $root.type.googleapis.com.Data.verify(message.data);
- if (error)
- return "data." + error;
- }
- if (message.env != null && message.hasOwnProperty("env"))
- if (!$util.isInteger(message.env))
- return "env: integer expected";
- return null;
- };
- /**
- * Creates a Response message from a plain object. Also converts values to their respective internal types.
- * @function fromObject
- * @memberof type.googleapis.com.Response
- * @static
- * @param {Object.<string,*>} object Plain object
- * @returns {type.googleapis.com.Response} Response
- */
- Response.fromObject = function fromObject(object) {
- if (object instanceof $root.type.googleapis.com.Response)
- return object;
- var message = new $root.type.googleapis.com.Response();
- if (object.biz != null)
- message.biz = String(object.biz);
- if (object.type != null)
- message.type = String(object.type);
- if (object.base != null)
- message.base = String(object.base);
- if (object.quote != null)
- message.quote = String(object.quote);
- if (object.contractcode != null)
- message.contractcode = String(object.contractcode);
- if (object.granularity != null)
- message.granularity = String(object.granularity);
- if (object.data != null) {
- if (typeof object.data !== "object")
- throw TypeError(".type.googleapis.com.Response.data: object expected");
- message.data = $root.type.googleapis.com.Data.fromObject(object.data);
- }
- if (object.env != null)
- message.env = object.env | 0;
- return message;
- };
- /**
- * Creates a plain object from a Response message. Also converts values to other types if specified.
- * @function toObject
- * @memberof type.googleapis.com.Response
- * @static
- * @param {type.googleapis.com.Response} message Response
- * @param {$protobuf.IConversionOptions} [options] Conversion options
- * @returns {Object.<string,*>} Plain object
- */
- Response.toObject = function toObject(message, options) {
- if (!options)
- options = {};
- var object = {};
- if (options.defaults) {
- object.biz = "";
- object.type = "";
- object.base = "";
- object.quote = "";
- object.contractcode = "";
- object.granularity = "";
- object.data = null;
- object.env = 0;
- }
- if (message.biz != null && message.hasOwnProperty("biz"))
- object.biz = message.biz;
- if (message.type != null && message.hasOwnProperty("type"))
- object.type = message.type;
- if (message.base != null && message.hasOwnProperty("base"))
- object.base = message.base;
- if (message.quote != null && message.hasOwnProperty("quote"))
- object.quote = message.quote;
- if (message.contractcode != null && message.hasOwnProperty("contractcode"))
- object.contractcode = message.contractcode;
- if (message.granularity != null && message.hasOwnProperty("granularity"))
- object.granularity = message.granularity;
- if (message.data != null && message.hasOwnProperty("data"))
- object.data = $root.type.googleapis.com.Data.toObject(message.data, options);
- if (message.env != null && message.hasOwnProperty("env"))
- object.env = message.env;
- return object;
- };
- /**
- * Converts this Response to JSON.
- * @function toJSON
- * @memberof type.googleapis.com.Response
- * @instance
- * @returns {Object.<string,*>} JSON object
- */
- Response.prototype.toJSON = function toJSON() {
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
- };
- /**
- * Gets the default type url for Response
- * @function getTypeUrl
- * @memberof type.googleapis.com.Response
- * @static
- * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
- * @returns {string} The default type url
- */
- Response.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
- if (typeUrlPrefix === undefined) {
- typeUrlPrefix = "type.googleapis.com";
- }
- return typeUrlPrefix + "/type.googleapis.com.Response";
- };
- return Response;
- })();
- com.Data = (function() {
- /**
- * Properties of a Data.
- * @memberof type.googleapis.com
- * @interface IData
- * @property {string|null} [typeUrl] Data typeUrl
- * @property {type.googleapis.com.IContractInfo|null} [value] Data value
- */
- /**
- * Constructs a new Data.
- * @memberof type.googleapis.com
- * @classdesc Represents a Data.
- * @implements IData
- * @constructor
- * @param {type.googleapis.com.IData=} [properties] Properties to set
- */
- function Data(properties) {
- if (properties)
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
- if (properties[keys[i]] != null)
- this[keys[i]] = properties[keys[i]];
- }
- /**
- * Data typeUrl.
- * @member {string} typeUrl
- * @memberof type.googleapis.com.Data
- * @instance
- */
- Data.prototype.typeUrl = "";
- /**
- * Data value.
- * @member {type.googleapis.com.IContractInfo|null|undefined} value
- * @memberof type.googleapis.com.Data
- * @instance
- */
- Data.prototype.value = null;
- /**
- * Creates a new Data instance using the specified properties.
- * @function create
- * @memberof type.googleapis.com.Data
- * @static
- * @param {type.googleapis.com.IData=} [properties] Properties to set
- * @returns {type.googleapis.com.Data} Data instance
- */
- Data.create = function create(properties) {
- return new Data(properties);
- };
- /**
- * Encodes the specified Data message. Does not implicitly {@link type.googleapis.com.Data.verify|verify} messages.
- * @function encode
- * @memberof type.googleapis.com.Data
- * @static
- * @param {type.googleapis.com.IData} message Data message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- Data.encode = function encode(message, writer) {
- if (!writer)
- writer = $Writer.create();
- if (message.typeUrl != null && Object.hasOwnProperty.call(message, "typeUrl"))
- writer.uint32(/* id 1, wireType 2 =*/10).string(message.typeUrl);
- if (message.value != null && Object.hasOwnProperty.call(message, "value"))
- $root.type.googleapis.com.ContractInfo.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
- return writer;
- };
- /**
- * Encodes the specified Data message, length delimited. Does not implicitly {@link type.googleapis.com.Data.verify|verify} messages.
- * @function encodeDelimited
- * @memberof type.googleapis.com.Data
- * @static
- * @param {type.googleapis.com.IData} message Data message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- Data.encodeDelimited = function encodeDelimited(message, writer) {
- return this.encode(message, writer).ldelim();
- };
- /**
- * Decodes a Data message from the specified reader or buffer.
- * @function decode
- * @memberof type.googleapis.com.Data
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @param {number} [length] Message length if known beforehand
- * @returns {type.googleapis.com.Data} Data
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- Data.decode = function decode(reader, length) {
- if (!(reader instanceof $Reader))
- reader = $Reader.create(reader);
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.type.googleapis.com.Data();
- while (reader.pos < end) {
- var tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- message.typeUrl = reader.string();
- break;
- }
- case 2: {
- message.value = $root.type.googleapis.com.ContractInfo.decode(reader, reader.uint32());
- break;
- }
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- };
- /**
- * Decodes a Data message from the specified reader or buffer, length delimited.
- * @function decodeDelimited
- * @memberof type.googleapis.com.Data
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @returns {type.googleapis.com.Data} Data
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- Data.decodeDelimited = function decodeDelimited(reader) {
- if (!(reader instanceof $Reader))
- reader = new $Reader(reader);
- return this.decode(reader, reader.uint32());
- };
- /**
- * Verifies a Data message.
- * @function verify
- * @memberof type.googleapis.com.Data
- * @static
- * @param {Object.<string,*>} message Plain object to verify
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
- */
- Data.verify = function verify(message) {
- if (typeof message !== "object" || message === null)
- return "object expected";
- if (message.typeUrl != null && message.hasOwnProperty("typeUrl"))
- if (!$util.isString(message.typeUrl))
- return "typeUrl: string expected";
- if (message.value != null && message.hasOwnProperty("value")) {
- var error = $root.type.googleapis.com.ContractInfo.verify(message.value);
- if (error)
- return "value." + error;
- }
- return null;
- };
- /**
- * Creates a Data message from a plain object. Also converts values to their respective internal types.
- * @function fromObject
- * @memberof type.googleapis.com.Data
- * @static
- * @param {Object.<string,*>} object Plain object
- * @returns {type.googleapis.com.Data} Data
- */
- Data.fromObject = function fromObject(object) {
- if (object instanceof $root.type.googleapis.com.Data)
- return object;
- var message = new $root.type.googleapis.com.Data();
- if (object.typeUrl != null)
- message.typeUrl = String(object.typeUrl);
- if (object.value != null) {
- if (typeof object.value !== "object")
- throw TypeError(".type.googleapis.com.Data.value: object expected");
- message.value = $root.type.googleapis.com.ContractInfo.fromObject(object.value);
- }
- return message;
- };
- /**
- * Creates a plain object from a Data message. Also converts values to other types if specified.
- * @function toObject
- * @memberof type.googleapis.com.Data
- * @static
- * @param {type.googleapis.com.Data} message Data
- * @param {$protobuf.IConversionOptions} [options] Conversion options
- * @returns {Object.<string,*>} Plain object
- */
- Data.toObject = function toObject(message, options) {
- if (!options)
- options = {};
- var object = {};
- if (options.defaults) {
- object.typeUrl = "";
- object.value = null;
- }
- if (message.typeUrl != null && message.hasOwnProperty("typeUrl"))
- object.typeUrl = message.typeUrl;
- if (message.value != null && message.hasOwnProperty("value"))
- object.value = $root.type.googleapis.com.ContractInfo.toObject(message.value, options);
- return object;
- };
- /**
- * Converts this Data to JSON.
- * @function toJSON
- * @memberof type.googleapis.com.Data
- * @instance
- * @returns {Object.<string,*>} JSON object
- */
- Data.prototype.toJSON = function toJSON() {
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
- };
- /**
- * Gets the default type url for Data
- * @function getTypeUrl
- * @memberof type.googleapis.com.Data
- * @static
- * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
- * @returns {string} The default type url
- */
- Data.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
- if (typeUrlPrefix === undefined) {
- typeUrlPrefix = "type.googleapis.com";
- }
- return typeUrlPrefix + "/type.googleapis.com.Data";
- };
- return Data;
- })();
- com.ContractInfo = (function() {
- /**
- * Properties of a ContractInfo.
- * @memberof type.googleapis.com
- * @interface IContractInfo
- * @property {string|null} [contractcode] ContractInfo contractcode
- * @property {string|null} [markprice] ContractInfo markprice
- * @property {string|null} [indexprice] ContractInfo indexprice
- * @property {string|null} [feeRate] ContractInfo feeRate
- * @property {string|null} [estimateFeeRate] ContractInfo estimateFeeRate
- * @property {number|Long|null} [nextLiquidationInterval] ContractInfo nextLiquidationInterval
- * @property {string|null} [totalPosition] ContractInfo totalPosition
- * @property {string|null} [indexCny] ContractInfo indexCny
- * @property {string|null} [markCny] ContractInfo markCny
- * @property {number|null} [env] ContractInfo env
- * @property {string|null} [base] ContractInfo base
- * @property {string|null} [indexBase] ContractInfo indexBase
- * @property {string|null} [quote] ContractInfo quote
- * @property {string|null} [baseDisplayName] ContractInfo baseDisplayName
- * @property {string|null} [indexBaseDisplayName] ContractInfo indexBaseDisplayName
- * @property {string|null} [quoteDisplayName] ContractInfo quoteDisplayName
- * @property {string|null} [preDeliveryPrice] ContractInfo preDeliveryPrice
- * @property {number|null} [online] ContractInfo online
- */
- /**
- * Constructs a new ContractInfo.
- * @memberof type.googleapis.com
- * @classdesc Represents a ContractInfo.
- * @implements IContractInfo
- * @constructor
- * @param {type.googleapis.com.IContractInfo=} [properties] Properties to set
- */
- function ContractInfo(properties) {
- if (properties)
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
- if (properties[keys[i]] != null)
- this[keys[i]] = properties[keys[i]];
- }
- /**
- * ContractInfo contractcode.
- * @member {string} contractcode
- * @memberof type.googleapis.com.ContractInfo
- * @instance
- */
- ContractInfo.prototype.contractcode = "";
- /**
- * ContractInfo markprice.
- * @member {string} markprice
- * @memberof type.googleapis.com.ContractInfo
- * @instance
- */
- ContractInfo.prototype.markprice = "";
- /**
- * ContractInfo indexprice.
- * @member {string} indexprice
- * @memberof type.googleapis.com.ContractInfo
- * @instance
- */
- ContractInfo.prototype.indexprice = "";
- /**
- * ContractInfo feeRate.
- * @member {string} feeRate
- * @memberof type.googleapis.com.ContractInfo
- * @instance
- */
- ContractInfo.prototype.feeRate = "";
- /**
- * ContractInfo estimateFeeRate.
- * @member {string} estimateFeeRate
- * @memberof type.googleapis.com.ContractInfo
- * @instance
- */
- ContractInfo.prototype.estimateFeeRate = "";
- /**
- * ContractInfo nextLiquidationInterval.
- * @member {number|Long} nextLiquidationInterval
- * @memberof type.googleapis.com.ContractInfo
- * @instance
- */
- ContractInfo.prototype.nextLiquidationInterval = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
- /**
- * ContractInfo totalPosition.
- * @member {string} totalPosition
- * @memberof type.googleapis.com.ContractInfo
- * @instance
- */
- ContractInfo.prototype.totalPosition = "";
- /**
- * ContractInfo indexCny.
- * @member {string} indexCny
- * @memberof type.googleapis.com.ContractInfo
- * @instance
- */
- ContractInfo.prototype.indexCny = "";
- /**
- * ContractInfo markCny.
- * @member {string} markCny
- * @memberof type.googleapis.com.ContractInfo
- * @instance
- */
- ContractInfo.prototype.markCny = "";
- /**
- * ContractInfo env.
- * @member {number} env
- * @memberof type.googleapis.com.ContractInfo
- * @instance
- */
- ContractInfo.prototype.env = 0;
- /**
- * ContractInfo base.
- * @member {string} base
- * @memberof type.googleapis.com.ContractInfo
- * @instance
- */
- ContractInfo.prototype.base = "";
- /**
- * ContractInfo indexBase.
- * @member {string} indexBase
- * @memberof type.googleapis.com.ContractInfo
- * @instance
- */
- ContractInfo.prototype.indexBase = "";
- /**
- * ContractInfo quote.
- * @member {string} quote
- * @memberof type.googleapis.com.ContractInfo
- * @instance
- */
- ContractInfo.prototype.quote = "";
- /**
- * ContractInfo baseDisplayName.
- * @member {string} baseDisplayName
- * @memberof type.googleapis.com.ContractInfo
- * @instance
- */
- ContractInfo.prototype.baseDisplayName = "";
- /**
- * ContractInfo indexBaseDisplayName.
- * @member {string} indexBaseDisplayName
- * @memberof type.googleapis.com.ContractInfo
- * @instance
- */
- ContractInfo.prototype.indexBaseDisplayName = "";
- /**
- * ContractInfo quoteDisplayName.
- * @member {string} quoteDisplayName
- * @memberof type.googleapis.com.ContractInfo
- * @instance
- */
- ContractInfo.prototype.quoteDisplayName = "";
- /**
- * ContractInfo preDeliveryPrice.
- * @member {string} preDeliveryPrice
- * @memberof type.googleapis.com.ContractInfo
- * @instance
- */
- ContractInfo.prototype.preDeliveryPrice = "";
- /**
- * ContractInfo online.
- * @member {number} online
- * @memberof type.googleapis.com.ContractInfo
- * @instance
- */
- ContractInfo.prototype.online = 0;
- /**
- * Creates a new ContractInfo instance using the specified properties.
- * @function create
- * @memberof type.googleapis.com.ContractInfo
- * @static
- * @param {type.googleapis.com.IContractInfo=} [properties] Properties to set
- * @returns {type.googleapis.com.ContractInfo} ContractInfo instance
- */
- ContractInfo.create = function create(properties) {
- return new ContractInfo(properties);
- };
- /**
- * Encodes the specified ContractInfo message. Does not implicitly {@link type.googleapis.com.ContractInfo.verify|verify} messages.
- * @function encode
- * @memberof type.googleapis.com.ContractInfo
- * @static
- * @param {type.googleapis.com.IContractInfo} message ContractInfo message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- ContractInfo.encode = function encode(message, writer) {
- if (!writer)
- writer = $Writer.create();
- if (message.contractcode != null && Object.hasOwnProperty.call(message, "contractcode"))
- writer.uint32(/* id 1, wireType 2 =*/10).string(message.contractcode);
- if (message.markprice != null && Object.hasOwnProperty.call(message, "markprice"))
- writer.uint32(/* id 2, wireType 2 =*/18).string(message.markprice);
- if (message.indexprice != null && Object.hasOwnProperty.call(message, "indexprice"))
- writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexprice);
- if (message.feeRate != null && Object.hasOwnProperty.call(message, "feeRate"))
- writer.uint32(/* id 4, wireType 2 =*/34).string(message.feeRate);
- if (message.estimateFeeRate != null && Object.hasOwnProperty.call(message, "estimateFeeRate"))
- writer.uint32(/* id 5, wireType 2 =*/42).string(message.estimateFeeRate);
- if (message.nextLiquidationInterval != null && Object.hasOwnProperty.call(message, "nextLiquidationInterval"))
- writer.uint32(/* id 6, wireType 0 =*/48).int64(message.nextLiquidationInterval);
- if (message.totalPosition != null && Object.hasOwnProperty.call(message, "totalPosition"))
- writer.uint32(/* id 7, wireType 2 =*/58).string(message.totalPosition);
- if (message.indexCny != null && Object.hasOwnProperty.call(message, "indexCny"))
- writer.uint32(/* id 8, wireType 2 =*/66).string(message.indexCny);
- if (message.markCny != null && Object.hasOwnProperty.call(message, "markCny"))
- writer.uint32(/* id 9, wireType 2 =*/74).string(message.markCny);
- if (message.env != null && Object.hasOwnProperty.call(message, "env"))
- writer.uint32(/* id 10, wireType 0 =*/80).int32(message.env);
- if (message.base != null && Object.hasOwnProperty.call(message, "base"))
- writer.uint32(/* id 11, wireType 2 =*/90).string(message.base);
- if (message.indexBase != null && Object.hasOwnProperty.call(message, "indexBase"))
- writer.uint32(/* id 12, wireType 2 =*/98).string(message.indexBase);
- if (message.quote != null && Object.hasOwnProperty.call(message, "quote"))
- writer.uint32(/* id 13, wireType 2 =*/106).string(message.quote);
- if (message.baseDisplayName != null && Object.hasOwnProperty.call(message, "baseDisplayName"))
- writer.uint32(/* id 14, wireType 2 =*/114).string(message.baseDisplayName);
- if (message.indexBaseDisplayName != null && Object.hasOwnProperty.call(message, "indexBaseDisplayName"))
- writer.uint32(/* id 15, wireType 2 =*/122).string(message.indexBaseDisplayName);
- if (message.quoteDisplayName != null && Object.hasOwnProperty.call(message, "quoteDisplayName"))
- writer.uint32(/* id 16, wireType 2 =*/130).string(message.quoteDisplayName);
- if (message.preDeliveryPrice != null && Object.hasOwnProperty.call(message, "preDeliveryPrice"))
- writer.uint32(/* id 17, wireType 2 =*/138).string(message.preDeliveryPrice);
- if (message.online != null && Object.hasOwnProperty.call(message, "online"))
- writer.uint32(/* id 18, wireType 0 =*/144).int32(message.online);
- return writer;
- };
- /**
- * Encodes the specified ContractInfo message, length delimited. Does not implicitly {@link type.googleapis.com.ContractInfo.verify|verify} messages.
- * @function encodeDelimited
- * @memberof type.googleapis.com.ContractInfo
- * @static
- * @param {type.googleapis.com.IContractInfo} message ContractInfo message or plain object to encode
- * @param {$protobuf.Writer} [writer] Writer to encode to
- * @returns {$protobuf.Writer} Writer
- */
- ContractInfo.encodeDelimited = function encodeDelimited(message, writer) {
- return this.encode(message, writer).ldelim();
- };
- /**
- * Decodes a ContractInfo message from the specified reader or buffer.
- * @function decode
- * @memberof type.googleapis.com.ContractInfo
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @param {number} [length] Message length if known beforehand
- * @returns {type.googleapis.com.ContractInfo} ContractInfo
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- ContractInfo.decode = function decode(reader, length) {
- if (!(reader instanceof $Reader))
- reader = $Reader.create(reader);
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.type.googleapis.com.ContractInfo();
- while (reader.pos < end) {
- var tag = reader.uint32();
- switch (tag >>> 3) {
- case 1: {
- message.contractcode = reader.string();
- break;
- }
- case 2: {
- message.markprice = reader.string();
- break;
- }
- case 3: {
- message.indexprice = reader.string();
- break;
- }
- case 4: {
- message.feeRate = reader.string();
- break;
- }
- case 5: {
- message.estimateFeeRate = reader.string();
- break;
- }
- case 6: {
- message.nextLiquidationInterval = reader.int64();
- break;
- }
- case 7: {
- message.totalPosition = reader.string();
- break;
- }
- case 8: {
- message.indexCny = reader.string();
- break;
- }
- case 9: {
- message.markCny = reader.string();
- break;
- }
- case 10: {
- message.env = reader.int32();
- break;
- }
- case 11: {
- message.base = reader.string();
- break;
- }
- case 12: {
- message.indexBase = reader.string();
- break;
- }
- case 13: {
- message.quote = reader.string();
- break;
- }
- case 14: {
- message.baseDisplayName = reader.string();
- break;
- }
- case 15: {
- message.indexBaseDisplayName = reader.string();
- break;
- }
- case 16: {
- message.quoteDisplayName = reader.string();
- break;
- }
- case 17: {
- message.preDeliveryPrice = reader.string();
- break;
- }
- case 18: {
- message.online = reader.int32();
- break;
- }
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- };
- /**
- * Decodes a ContractInfo message from the specified reader or buffer, length delimited.
- * @function decodeDelimited
- * @memberof type.googleapis.com.ContractInfo
- * @static
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
- * @returns {type.googleapis.com.ContractInfo} ContractInfo
- * @throws {Error} If the payload is not a reader or valid buffer
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
- */
- ContractInfo.decodeDelimited = function decodeDelimited(reader) {
- if (!(reader instanceof $Reader))
- reader = new $Reader(reader);
- return this.decode(reader, reader.uint32());
- };
- /**
- * Verifies a ContractInfo message.
- * @function verify
- * @memberof type.googleapis.com.ContractInfo
- * @static
- * @param {Object.<string,*>} message Plain object to verify
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
- */
- ContractInfo.verify = function verify(message) {
- if (typeof message !== "object" || message === null)
- return "object expected";
- if (message.contractcode != null && message.hasOwnProperty("contractcode"))
- if (!$util.isString(message.contractcode))
- return "contractcode: string expected";
- if (message.markprice != null && message.hasOwnProperty("markprice"))
- if (!$util.isString(message.markprice))
- return "markprice: string expected";
- if (message.indexprice != null && message.hasOwnProperty("indexprice"))
- if (!$util.isString(message.indexprice))
- return "indexprice: string expected";
- if (message.feeRate != null && message.hasOwnProperty("feeRate"))
- if (!$util.isString(message.feeRate))
- return "feeRate: string expected";
- if (message.estimateFeeRate != null && message.hasOwnProperty("estimateFeeRate"))
- if (!$util.isString(message.estimateFeeRate))
- return "estimateFeeRate: string expected";
- if (message.nextLiquidationInterval != null && message.hasOwnProperty("nextLiquidationInterval"))
- if (!$util.isInteger(message.nextLiquidationInterval) && !(message.nextLiquidationInterval && $util.isInteger(message.nextLiquidationInterval.low) && $util.isInteger(message.nextLiquidationInterval.high)))
- return "nextLiquidationInterval: integer|Long expected";
- if (message.totalPosition != null && message.hasOwnProperty("totalPosition"))
- if (!$util.isString(message.totalPosition))
- return "totalPosition: string expected";
- if (message.indexCny != null && message.hasOwnProperty("indexCny"))
- if (!$util.isString(message.indexCny))
- return "indexCny: string expected";
- if (message.markCny != null && message.hasOwnProperty("markCny"))
- if (!$util.isString(message.markCny))
- return "markCny: string expected";
- if (message.env != null && message.hasOwnProperty("env"))
- if (!$util.isInteger(message.env))
- return "env: integer expected";
- if (message.base != null && message.hasOwnProperty("base"))
- if (!$util.isString(message.base))
- return "base: string expected";
- if (message.indexBase != null && message.hasOwnProperty("indexBase"))
- if (!$util.isString(message.indexBase))
- return "indexBase: string expected";
- if (message.quote != null && message.hasOwnProperty("quote"))
- if (!$util.isString(message.quote))
- return "quote: string expected";
- if (message.baseDisplayName != null && message.hasOwnProperty("baseDisplayName"))
- if (!$util.isString(message.baseDisplayName))
- return "baseDisplayName: string expected";
- if (message.indexBaseDisplayName != null && message.hasOwnProperty("indexBaseDisplayName"))
- if (!$util.isString(message.indexBaseDisplayName))
- return "indexBaseDisplayName: string expected";
- if (message.quoteDisplayName != null && message.hasOwnProperty("quoteDisplayName"))
- if (!$util.isString(message.quoteDisplayName))
- return "quoteDisplayName: string expected";
- if (message.preDeliveryPrice != null && message.hasOwnProperty("preDeliveryPrice"))
- if (!$util.isString(message.preDeliveryPrice))
- return "preDeliveryPrice: string expected";
- if (message.online != null && message.hasOwnProperty("online"))
- if (!$util.isInteger(message.online))
- return "online: integer expected";
- return null;
- };
- /**
- * Creates a ContractInfo message from a plain object. Also converts values to their respective internal types.
- * @function fromObject
- * @memberof type.googleapis.com.ContractInfo
- * @static
- * @param {Object.<string,*>} object Plain object
- * @returns {type.googleapis.com.ContractInfo} ContractInfo
- */
- ContractInfo.fromObject = function fromObject(object) {
- if (object instanceof $root.type.googleapis.com.ContractInfo)
- return object;
- var message = new $root.type.googleapis.com.ContractInfo();
- if (object.contractcode != null)
- message.contractcode = String(object.contractcode);
- if (object.markprice != null)
- message.markprice = String(object.markprice);
- if (object.indexprice != null)
- message.indexprice = String(object.indexprice);
- if (object.feeRate != null)
- message.feeRate = String(object.feeRate);
- if (object.estimateFeeRate != null)
- message.estimateFeeRate = String(object.estimateFeeRate);
- if (object.nextLiquidationInterval != null)
- if ($util.Long)
- (message.nextLiquidationInterval = $util.Long.fromValue(object.nextLiquidationInterval)).unsigned = false;
- else if (typeof object.nextLiquidationInterval === "string")
- message.nextLiquidationInterval = parseInt(object.nextLiquidationInterval, 10);
- else if (typeof object.nextLiquidationInterval === "number")
- message.nextLiquidationInterval = object.nextLiquidationInterval;
- else if (typeof object.nextLiquidationInterval === "object")
- message.nextLiquidationInterval = new $util.LongBits(object.nextLiquidationInterval.low >>> 0, object.nextLiquidationInterval.high >>> 0).toNumber();
- if (object.totalPosition != null)
- message.totalPosition = String(object.totalPosition);
- if (object.indexCny != null)
- message.indexCny = String(object.indexCny);
- if (object.markCny != null)
- message.markCny = String(object.markCny);
- if (object.env != null)
- message.env = object.env | 0;
- if (object.base != null)
- message.base = String(object.base);
- if (object.indexBase != null)
- message.indexBase = String(object.indexBase);
- if (object.quote != null)
- message.quote = String(object.quote);
- if (object.baseDisplayName != null)
- message.baseDisplayName = String(object.baseDisplayName);
- if (object.indexBaseDisplayName != null)
- message.indexBaseDisplayName = String(object.indexBaseDisplayName);
- if (object.quoteDisplayName != null)
- message.quoteDisplayName = String(object.quoteDisplayName);
- if (object.preDeliveryPrice != null)
- message.preDeliveryPrice = String(object.preDeliveryPrice);
- if (object.online != null)
- message.online = object.online | 0;
- return message;
- };
- /**
- * Creates a plain object from a ContractInfo message. Also converts values to other types if specified.
- * @function toObject
- * @memberof type.googleapis.com.ContractInfo
- * @static
- * @param {type.googleapis.com.ContractInfo} message ContractInfo
- * @param {$protobuf.IConversionOptions} [options] Conversion options
- * @returns {Object.<string,*>} Plain object
- */
- ContractInfo.toObject = function toObject(message, options) {
- if (!options)
- options = {};
- var object = {};
- if (options.defaults) {
- object.contractcode = "";
- object.markprice = "";
- object.indexprice = "";
- object.feeRate = "";
- object.estimateFeeRate = "";
- if ($util.Long) {
- var long = new $util.Long(0, 0, false);
- object.nextLiquidationInterval = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
- } else
- object.nextLiquidationInterval = options.longs === String ? "0" : 0;
- object.totalPosition = "";
- object.indexCny = "";
- object.markCny = "";
- object.env = 0;
- object.base = "";
- object.indexBase = "";
- object.quote = "";
- object.baseDisplayName = "";
- object.indexBaseDisplayName = "";
- object.quoteDisplayName = "";
- object.preDeliveryPrice = "";
- object.online = 0;
- }
- if (message.contractcode != null && message.hasOwnProperty("contractcode"))
- object.contractcode = message.contractcode;
- if (message.markprice != null && message.hasOwnProperty("markprice"))
- object.markprice = message.markprice;
- if (message.indexprice != null && message.hasOwnProperty("indexprice"))
- object.indexprice = message.indexprice;
- if (message.feeRate != null && message.hasOwnProperty("feeRate"))
- object.feeRate = message.feeRate;
- if (message.estimateFeeRate != null && message.hasOwnProperty("estimateFeeRate"))
- object.estimateFeeRate = message.estimateFeeRate;
- if (message.nextLiquidationInterval != null && message.hasOwnProperty("nextLiquidationInterval"))
- if (typeof message.nextLiquidationInterval === "number")
- object.nextLiquidationInterval = options.longs === String ? String(message.nextLiquidationInterval) : message.nextLiquidationInterval;
- else
- object.nextLiquidationInterval = options.longs === String ? $util.Long.prototype.toString.call(message.nextLiquidationInterval) : options.longs === Number ? new $util.LongBits(message.nextLiquidationInterval.low >>> 0, message.nextLiquidationInterval.high >>> 0).toNumber() : message.nextLiquidationInterval;
- if (message.totalPosition != null && message.hasOwnProperty("totalPosition"))
- object.totalPosition = message.totalPosition;
- if (message.indexCny != null && message.hasOwnProperty("indexCny"))
- object.indexCny = message.indexCny;
- if (message.markCny != null && message.hasOwnProperty("markCny"))
- object.markCny = message.markCny;
- if (message.env != null && message.hasOwnProperty("env"))
- object.env = message.env;
- if (message.base != null && message.hasOwnProperty("base"))
- object.base = message.base;
- if (message.indexBase != null && message.hasOwnProperty("indexBase"))
- object.indexBase = message.indexBase;
- if (message.quote != null && message.hasOwnProperty("quote"))
- object.quote = message.quote;
- if (message.baseDisplayName != null && message.hasOwnProperty("baseDisplayName"))
- object.baseDisplayName = message.baseDisplayName;
- if (message.indexBaseDisplayName != null && message.hasOwnProperty("indexBaseDisplayName"))
- object.indexBaseDisplayName = message.indexBaseDisplayName;
- if (message.quoteDisplayName != null && message.hasOwnProperty("quoteDisplayName"))
- object.quoteDisplayName = message.quoteDisplayName;
- if (message.preDeliveryPrice != null && message.hasOwnProperty("preDeliveryPrice"))
- object.preDeliveryPrice = message.preDeliveryPrice;
- if (message.online != null && message.hasOwnProperty("online"))
- object.online = message.online;
- return object;
- };
- /**
- * Converts this ContractInfo to JSON.
- * @function toJSON
- * @memberof type.googleapis.com.ContractInfo
- * @instance
- * @returns {Object.<string,*>} JSON object
- */
- ContractInfo.prototype.toJSON = function toJSON() {
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
- };
- /**
- * Gets the default type url for ContractInfo
- * @function getTypeUrl
- * @memberof type.googleapis.com.ContractInfo
- * @static
- * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
- * @returns {string} The default type url
- */
- ContractInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
- if (typeUrlPrefix === undefined) {
- typeUrlPrefix = "type.googleapis.com";
- }
- return typeUrlPrefix + "/type.googleapis.com.ContractInfo";
- };
- return ContractInfo;
- })();
- return com;
- })();
- return googleapis;
- })();
- return type;
- })();
- module.exports = $root;
|