market.v2.trade.main.pair.js 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953
  1. /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
  2. "use strict";
  3. var $protobuf = require("protobufjs/minimal");
  4. // Common aliases
  5. var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
  6. // Exported root namespace
  7. var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
  8. $root.market = (function() {
  9. /**
  10. * Namespace market.
  11. * @exports market
  12. * @namespace
  13. */
  14. var market = {};
  15. market.v2 = (function() {
  16. /**
  17. * Namespace v2.
  18. * @memberof market
  19. * @namespace
  20. */
  21. var v2 = {};
  22. v2.trade = (function() {
  23. /**
  24. * Namespace trade.
  25. * @memberof market.v2
  26. * @namespace
  27. */
  28. var trade = {};
  29. trade.main = (function() {
  30. /**
  31. * Namespace main.
  32. * @memberof market.v2.trade
  33. * @namespace
  34. */
  35. var main = {};
  36. main.pair = (function() {
  37. /**
  38. * Namespace pair.
  39. * @memberof market.v2.trade.main
  40. * @namespace
  41. */
  42. var pair = {};
  43. pair.Response = (function() {
  44. /**
  45. * Properties of a Response.
  46. * @memberof market.v2.trade.main.pair
  47. * @interface IResponse
  48. * @property {number|null} [code] Response code
  49. * @property {string|null} [msg] Response msg
  50. * @property {string|null} [status] Response status
  51. * @property {number|Long|null} [ts] Response ts
  52. * @property {string|null} [ch] Response ch
  53. * @property {market.v2.trade.main.pair.IMainPair|null} [mainpair] Response mainpair
  54. */
  55. /**
  56. * Constructs a new Response.
  57. * @memberof market.v2.trade.main.pair
  58. * @classdesc Represents a Response.
  59. * @implements IResponse
  60. * @constructor
  61. * @param {market.v2.trade.main.pair.IResponse=} [properties] Properties to set
  62. */
  63. function Response(properties) {
  64. if (properties)
  65. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  66. if (properties[keys[i]] != null)
  67. this[keys[i]] = properties[keys[i]];
  68. }
  69. /**
  70. * Response code.
  71. * @member {number} code
  72. * @memberof market.v2.trade.main.pair.Response
  73. * @instance
  74. */
  75. Response.prototype.code = 0;
  76. /**
  77. * Response msg.
  78. * @member {string} msg
  79. * @memberof market.v2.trade.main.pair.Response
  80. * @instance
  81. */
  82. Response.prototype.msg = "";
  83. /**
  84. * Response status.
  85. * @member {string} status
  86. * @memberof market.v2.trade.main.pair.Response
  87. * @instance
  88. */
  89. Response.prototype.status = "";
  90. /**
  91. * Response ts.
  92. * @member {number|Long} ts
  93. * @memberof market.v2.trade.main.pair.Response
  94. * @instance
  95. */
  96. Response.prototype.ts = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
  97. /**
  98. * Response ch.
  99. * @member {string} ch
  100. * @memberof market.v2.trade.main.pair.Response
  101. * @instance
  102. */
  103. Response.prototype.ch = "";
  104. /**
  105. * Response mainpair.
  106. * @member {market.v2.trade.main.pair.IMainPair|null|undefined} mainpair
  107. * @memberof market.v2.trade.main.pair.Response
  108. * @instance
  109. */
  110. Response.prototype.mainpair = null;
  111. /**
  112. * Creates a new Response instance using the specified properties.
  113. * @function create
  114. * @memberof market.v2.trade.main.pair.Response
  115. * @static
  116. * @param {market.v2.trade.main.pair.IResponse=} [properties] Properties to set
  117. * @returns {market.v2.trade.main.pair.Response} Response instance
  118. */
  119. Response.create = function create(properties) {
  120. return new Response(properties);
  121. };
  122. /**
  123. * Encodes the specified Response message. Does not implicitly {@link market.v2.trade.main.pair.Response.verify|verify} messages.
  124. * @function encode
  125. * @memberof market.v2.trade.main.pair.Response
  126. * @static
  127. * @param {market.v2.trade.main.pair.IResponse} message Response message or plain object to encode
  128. * @param {$protobuf.Writer} [writer] Writer to encode to
  129. * @returns {$protobuf.Writer} Writer
  130. */
  131. Response.encode = function encode(message, writer) {
  132. if (!writer)
  133. writer = $Writer.create();
  134. if (message.code != null && Object.hasOwnProperty.call(message, "code"))
  135. writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code);
  136. if (message.msg != null && Object.hasOwnProperty.call(message, "msg"))
  137. writer.uint32(/* id 2, wireType 2 =*/18).string(message.msg);
  138. if (message.status != null && Object.hasOwnProperty.call(message, "status"))
  139. writer.uint32(/* id 3, wireType 2 =*/26).string(message.status);
  140. if (message.ts != null && Object.hasOwnProperty.call(message, "ts"))
  141. writer.uint32(/* id 4, wireType 0 =*/32).int64(message.ts);
  142. if (message.ch != null && Object.hasOwnProperty.call(message, "ch"))
  143. writer.uint32(/* id 5, wireType 2 =*/42).string(message.ch);
  144. if (message.mainpair != null && Object.hasOwnProperty.call(message, "mainpair"))
  145. $root.market.v2.trade.main.pair.MainPair.encode(message.mainpair, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
  146. return writer;
  147. };
  148. /**
  149. * Encodes the specified Response message, length delimited. Does not implicitly {@link market.v2.trade.main.pair.Response.verify|verify} messages.
  150. * @function encodeDelimited
  151. * @memberof market.v2.trade.main.pair.Response
  152. * @static
  153. * @param {market.v2.trade.main.pair.IResponse} message Response message or plain object to encode
  154. * @param {$protobuf.Writer} [writer] Writer to encode to
  155. * @returns {$protobuf.Writer} Writer
  156. */
  157. Response.encodeDelimited = function encodeDelimited(message, writer) {
  158. return this.encode(message, writer).ldelim();
  159. };
  160. /**
  161. * Decodes a Response message from the specified reader or buffer.
  162. * @function decode
  163. * @memberof market.v2.trade.main.pair.Response
  164. * @static
  165. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  166. * @param {number} [length] Message length if known beforehand
  167. * @returns {market.v2.trade.main.pair.Response} Response
  168. * @throws {Error} If the payload is not a reader or valid buffer
  169. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  170. */
  171. Response.decode = function decode(reader, length) {
  172. if (!(reader instanceof $Reader))
  173. reader = $Reader.create(reader);
  174. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.market.v2.trade.main.pair.Response();
  175. while (reader.pos < end) {
  176. var tag = reader.uint32();
  177. switch (tag >>> 3) {
  178. case 1: {
  179. message.code = reader.int32();
  180. break;
  181. }
  182. case 2: {
  183. message.msg = reader.string();
  184. break;
  185. }
  186. case 3: {
  187. message.status = reader.string();
  188. break;
  189. }
  190. case 4: {
  191. message.ts = reader.int64();
  192. break;
  193. }
  194. case 5: {
  195. message.ch = reader.string();
  196. break;
  197. }
  198. case 6: {
  199. message.mainpair = $root.market.v2.trade.main.pair.MainPair.decode(reader, reader.uint32());
  200. break;
  201. }
  202. default:
  203. reader.skipType(tag & 7);
  204. break;
  205. }
  206. }
  207. return message;
  208. };
  209. /**
  210. * Decodes a Response message from the specified reader or buffer, length delimited.
  211. * @function decodeDelimited
  212. * @memberof market.v2.trade.main.pair.Response
  213. * @static
  214. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  215. * @returns {market.v2.trade.main.pair.Response} Response
  216. * @throws {Error} If the payload is not a reader or valid buffer
  217. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  218. */
  219. Response.decodeDelimited = function decodeDelimited(reader) {
  220. if (!(reader instanceof $Reader))
  221. reader = new $Reader(reader);
  222. return this.decode(reader, reader.uint32());
  223. };
  224. /**
  225. * Verifies a Response message.
  226. * @function verify
  227. * @memberof market.v2.trade.main.pair.Response
  228. * @static
  229. * @param {Object.<string,*>} message Plain object to verify
  230. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  231. */
  232. Response.verify = function verify(message) {
  233. if (typeof message !== "object" || message === null)
  234. return "object expected";
  235. if (message.code != null && message.hasOwnProperty("code"))
  236. if (!$util.isInteger(message.code))
  237. return "code: integer expected";
  238. if (message.msg != null && message.hasOwnProperty("msg"))
  239. if (!$util.isString(message.msg))
  240. return "msg: string expected";
  241. if (message.status != null && message.hasOwnProperty("status"))
  242. if (!$util.isString(message.status))
  243. return "status: string expected";
  244. if (message.ts != null && message.hasOwnProperty("ts"))
  245. if (!$util.isInteger(message.ts) && !(message.ts && $util.isInteger(message.ts.low) && $util.isInteger(message.ts.high)))
  246. return "ts: integer|Long expected";
  247. if (message.ch != null && message.hasOwnProperty("ch"))
  248. if (!$util.isString(message.ch))
  249. return "ch: string expected";
  250. if (message.mainpair != null && message.hasOwnProperty("mainpair")) {
  251. var error = $root.market.v2.trade.main.pair.MainPair.verify(message.mainpair);
  252. if (error)
  253. return "mainpair." + error;
  254. }
  255. return null;
  256. };
  257. /**
  258. * Creates a Response message from a plain object. Also converts values to their respective internal types.
  259. * @function fromObject
  260. * @memberof market.v2.trade.main.pair.Response
  261. * @static
  262. * @param {Object.<string,*>} object Plain object
  263. * @returns {market.v2.trade.main.pair.Response} Response
  264. */
  265. Response.fromObject = function fromObject(object) {
  266. if (object instanceof $root.market.v2.trade.main.pair.Response)
  267. return object;
  268. var message = new $root.market.v2.trade.main.pair.Response();
  269. if (object.code != null)
  270. message.code = object.code | 0;
  271. if (object.msg != null)
  272. message.msg = String(object.msg);
  273. if (object.status != null)
  274. message.status = String(object.status);
  275. if (object.ts != null)
  276. if ($util.Long)
  277. (message.ts = $util.Long.fromValue(object.ts)).unsigned = false;
  278. else if (typeof object.ts === "string")
  279. message.ts = parseInt(object.ts, 10);
  280. else if (typeof object.ts === "number")
  281. message.ts = object.ts;
  282. else if (typeof object.ts === "object")
  283. message.ts = new $util.LongBits(object.ts.low >>> 0, object.ts.high >>> 0).toNumber();
  284. if (object.ch != null)
  285. message.ch = String(object.ch);
  286. if (object.mainpair != null) {
  287. if (typeof object.mainpair !== "object")
  288. throw TypeError(".market.v2.trade.main.pair.Response.mainpair: object expected");
  289. message.mainpair = $root.market.v2.trade.main.pair.MainPair.fromObject(object.mainpair);
  290. }
  291. return message;
  292. };
  293. /**
  294. * Creates a plain object from a Response message. Also converts values to other types if specified.
  295. * @function toObject
  296. * @memberof market.v2.trade.main.pair.Response
  297. * @static
  298. * @param {market.v2.trade.main.pair.Response} message Response
  299. * @param {$protobuf.IConversionOptions} [options] Conversion options
  300. * @returns {Object.<string,*>} Plain object
  301. */
  302. Response.toObject = function toObject(message, options) {
  303. if (!options)
  304. options = {};
  305. var object = {};
  306. if (options.defaults) {
  307. object.code = 0;
  308. object.msg = "";
  309. object.status = "";
  310. if ($util.Long) {
  311. var long = new $util.Long(0, 0, false);
  312. object.ts = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
  313. } else
  314. object.ts = options.longs === String ? "0" : 0;
  315. object.ch = "";
  316. object.mainpair = null;
  317. }
  318. if (message.code != null && message.hasOwnProperty("code"))
  319. object.code = message.code;
  320. if (message.msg != null && message.hasOwnProperty("msg"))
  321. object.msg = message.msg;
  322. if (message.status != null && message.hasOwnProperty("status"))
  323. object.status = message.status;
  324. if (message.ts != null && message.hasOwnProperty("ts"))
  325. if (typeof message.ts === "number")
  326. object.ts = options.longs === String ? String(message.ts) : message.ts;
  327. else
  328. object.ts = options.longs === String ? $util.Long.prototype.toString.call(message.ts) : options.longs === Number ? new $util.LongBits(message.ts.low >>> 0, message.ts.high >>> 0).toNumber() : message.ts;
  329. if (message.ch != null && message.hasOwnProperty("ch"))
  330. object.ch = message.ch;
  331. if (message.mainpair != null && message.hasOwnProperty("mainpair"))
  332. object.mainpair = $root.market.v2.trade.main.pair.MainPair.toObject(message.mainpair, options);
  333. return object;
  334. };
  335. /**
  336. * Converts this Response to JSON.
  337. * @function toJSON
  338. * @memberof market.v2.trade.main.pair.Response
  339. * @instance
  340. * @returns {Object.<string,*>} JSON object
  341. */
  342. Response.prototype.toJSON = function toJSON() {
  343. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  344. };
  345. /**
  346. * Gets the default type url for Response
  347. * @function getTypeUrl
  348. * @memberof market.v2.trade.main.pair.Response
  349. * @static
  350. * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
  351. * @returns {string} The default type url
  352. */
  353. Response.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
  354. if (typeUrlPrefix === undefined) {
  355. typeUrlPrefix = "type.googleapis.com";
  356. }
  357. return typeUrlPrefix + "/market.v2.trade.main.pair.Response";
  358. };
  359. return Response;
  360. })();
  361. pair.MainPair = (function() {
  362. /**
  363. * Properties of a MainPair.
  364. * @memberof market.v2.trade.main.pair
  365. * @interface IMainPair
  366. * @property {Array.<market.v2.trade.main.pair.IPairInfo>|null} [listList] MainPair listList
  367. */
  368. /**
  369. * Constructs a new MainPair.
  370. * @memberof market.v2.trade.main.pair
  371. * @classdesc Represents a MainPair.
  372. * @implements IMainPair
  373. * @constructor
  374. * @param {market.v2.trade.main.pair.IMainPair=} [properties] Properties to set
  375. */
  376. function MainPair(properties) {
  377. this.listList = [];
  378. if (properties)
  379. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  380. if (properties[keys[i]] != null)
  381. this[keys[i]] = properties[keys[i]];
  382. }
  383. /**
  384. * MainPair listList.
  385. * @member {Array.<market.v2.trade.main.pair.IPairInfo>} listList
  386. * @memberof market.v2.trade.main.pair.MainPair
  387. * @instance
  388. */
  389. MainPair.prototype.listList = $util.emptyArray;
  390. /**
  391. * Creates a new MainPair instance using the specified properties.
  392. * @function create
  393. * @memberof market.v2.trade.main.pair.MainPair
  394. * @static
  395. * @param {market.v2.trade.main.pair.IMainPair=} [properties] Properties to set
  396. * @returns {market.v2.trade.main.pair.MainPair} MainPair instance
  397. */
  398. MainPair.create = function create(properties) {
  399. return new MainPair(properties);
  400. };
  401. /**
  402. * Encodes the specified MainPair message. Does not implicitly {@link market.v2.trade.main.pair.MainPair.verify|verify} messages.
  403. * @function encode
  404. * @memberof market.v2.trade.main.pair.MainPair
  405. * @static
  406. * @param {market.v2.trade.main.pair.IMainPair} message MainPair message or plain object to encode
  407. * @param {$protobuf.Writer} [writer] Writer to encode to
  408. * @returns {$protobuf.Writer} Writer
  409. */
  410. MainPair.encode = function encode(message, writer) {
  411. if (!writer)
  412. writer = $Writer.create();
  413. if (message.listList != null && message.listList.length)
  414. for (var i = 0; i < message.listList.length; ++i)
  415. $root.market.v2.trade.main.pair.PairInfo.encode(message.listList[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
  416. return writer;
  417. };
  418. /**
  419. * Encodes the specified MainPair message, length delimited. Does not implicitly {@link market.v2.trade.main.pair.MainPair.verify|verify} messages.
  420. * @function encodeDelimited
  421. * @memberof market.v2.trade.main.pair.MainPair
  422. * @static
  423. * @param {market.v2.trade.main.pair.IMainPair} message MainPair message or plain object to encode
  424. * @param {$protobuf.Writer} [writer] Writer to encode to
  425. * @returns {$protobuf.Writer} Writer
  426. */
  427. MainPair.encodeDelimited = function encodeDelimited(message, writer) {
  428. return this.encode(message, writer).ldelim();
  429. };
  430. /**
  431. * Decodes a MainPair message from the specified reader or buffer.
  432. * @function decode
  433. * @memberof market.v2.trade.main.pair.MainPair
  434. * @static
  435. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  436. * @param {number} [length] Message length if known beforehand
  437. * @returns {market.v2.trade.main.pair.MainPair} MainPair
  438. * @throws {Error} If the payload is not a reader or valid buffer
  439. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  440. */
  441. MainPair.decode = function decode(reader, length) {
  442. if (!(reader instanceof $Reader))
  443. reader = $Reader.create(reader);
  444. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.market.v2.trade.main.pair.MainPair();
  445. while (reader.pos < end) {
  446. var tag = reader.uint32();
  447. switch (tag >>> 3) {
  448. case 1: {
  449. if (!(message.listList && message.listList.length))
  450. message.listList = [];
  451. message.listList.push($root.market.v2.trade.main.pair.PairInfo.decode(reader, reader.uint32()));
  452. break;
  453. }
  454. default:
  455. reader.skipType(tag & 7);
  456. break;
  457. }
  458. }
  459. return message;
  460. };
  461. /**
  462. * Decodes a MainPair message from the specified reader or buffer, length delimited.
  463. * @function decodeDelimited
  464. * @memberof market.v2.trade.main.pair.MainPair
  465. * @static
  466. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  467. * @returns {market.v2.trade.main.pair.MainPair} MainPair
  468. * @throws {Error} If the payload is not a reader or valid buffer
  469. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  470. */
  471. MainPair.decodeDelimited = function decodeDelimited(reader) {
  472. if (!(reader instanceof $Reader))
  473. reader = new $Reader(reader);
  474. return this.decode(reader, reader.uint32());
  475. };
  476. /**
  477. * Verifies a MainPair message.
  478. * @function verify
  479. * @memberof market.v2.trade.main.pair.MainPair
  480. * @static
  481. * @param {Object.<string,*>} message Plain object to verify
  482. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  483. */
  484. MainPair.verify = function verify(message) {
  485. if (typeof message !== "object" || message === null)
  486. return "object expected";
  487. if (message.listList != null && message.hasOwnProperty("listList")) {
  488. if (!Array.isArray(message.listList))
  489. return "listList: array expected";
  490. for (var i = 0; i < message.listList.length; ++i) {
  491. var error = $root.market.v2.trade.main.pair.PairInfo.verify(message.listList[i]);
  492. if (error)
  493. return "listList." + error;
  494. }
  495. }
  496. return null;
  497. };
  498. /**
  499. * Creates a MainPair message from a plain object. Also converts values to their respective internal types.
  500. * @function fromObject
  501. * @memberof market.v2.trade.main.pair.MainPair
  502. * @static
  503. * @param {Object.<string,*>} object Plain object
  504. * @returns {market.v2.trade.main.pair.MainPair} MainPair
  505. */
  506. MainPair.fromObject = function fromObject(object) {
  507. if (object instanceof $root.market.v2.trade.main.pair.MainPair)
  508. return object;
  509. var message = new $root.market.v2.trade.main.pair.MainPair();
  510. if (object.listList) {
  511. if (!Array.isArray(object.listList))
  512. throw TypeError(".market.v2.trade.main.pair.MainPair.listList: array expected");
  513. message.listList = [];
  514. for (var i = 0; i < object.listList.length; ++i) {
  515. if (typeof object.listList[i] !== "object")
  516. throw TypeError(".market.v2.trade.main.pair.MainPair.listList: object expected");
  517. message.listList[i] = $root.market.v2.trade.main.pair.PairInfo.fromObject(object.listList[i]);
  518. }
  519. }
  520. return message;
  521. };
  522. /**
  523. * Creates a plain object from a MainPair message. Also converts values to other types if specified.
  524. * @function toObject
  525. * @memberof market.v2.trade.main.pair.MainPair
  526. * @static
  527. * @param {market.v2.trade.main.pair.MainPair} message MainPair
  528. * @param {$protobuf.IConversionOptions} [options] Conversion options
  529. * @returns {Object.<string,*>} Plain object
  530. */
  531. MainPair.toObject = function toObject(message, options) {
  532. if (!options)
  533. options = {};
  534. var object = {};
  535. if (options.arrays || options.defaults)
  536. object.listList = [];
  537. if (message.listList && message.listList.length) {
  538. object.listList = [];
  539. for (var j = 0; j < message.listList.length; ++j)
  540. object.listList[j] = $root.market.v2.trade.main.pair.PairInfo.toObject(message.listList[j], options);
  541. }
  542. return object;
  543. };
  544. /**
  545. * Converts this MainPair to JSON.
  546. * @function toJSON
  547. * @memberof market.v2.trade.main.pair.MainPair
  548. * @instance
  549. * @returns {Object.<string,*>} JSON object
  550. */
  551. MainPair.prototype.toJSON = function toJSON() {
  552. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  553. };
  554. /**
  555. * Gets the default type url for MainPair
  556. * @function getTypeUrl
  557. * @memberof market.v2.trade.main.pair.MainPair
  558. * @static
  559. * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
  560. * @returns {string} The default type url
  561. */
  562. MainPair.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
  563. if (typeUrlPrefix === undefined) {
  564. typeUrlPrefix = "type.googleapis.com";
  565. }
  566. return typeUrlPrefix + "/market.v2.trade.main.pair.MainPair";
  567. };
  568. return MainPair;
  569. })();
  570. pair.PairInfo = (function() {
  571. /**
  572. * Properties of a PairInfo.
  573. * @memberof market.v2.trade.main.pair
  574. * @interface IPairInfo
  575. * @property {number|null} [tradeId] PairInfo tradeId
  576. * @property {string|null} [cny] PairInfo cny
  577. * @property {string|null} [totalamount] PairInfo totalamount
  578. * @property {string|null} [last] PairInfo last
  579. * @property {string|null} [volume] PairInfo volume
  580. * @property {string|null} [change] PairInfo change
  581. */
  582. /**
  583. * Constructs a new PairInfo.
  584. * @memberof market.v2.trade.main.pair
  585. * @classdesc Represents a PairInfo.
  586. * @implements IPairInfo
  587. * @constructor
  588. * @param {market.v2.trade.main.pair.IPairInfo=} [properties] Properties to set
  589. */
  590. function PairInfo(properties) {
  591. if (properties)
  592. for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
  593. if (properties[keys[i]] != null)
  594. this[keys[i]] = properties[keys[i]];
  595. }
  596. /**
  597. * PairInfo tradeId.
  598. * @member {number} tradeId
  599. * @memberof market.v2.trade.main.pair.PairInfo
  600. * @instance
  601. */
  602. PairInfo.prototype.tradeId = 0;
  603. /**
  604. * PairInfo cny.
  605. * @member {string} cny
  606. * @memberof market.v2.trade.main.pair.PairInfo
  607. * @instance
  608. */
  609. PairInfo.prototype.cny = "";
  610. /**
  611. * PairInfo totalamount.
  612. * @member {string} totalamount
  613. * @memberof market.v2.trade.main.pair.PairInfo
  614. * @instance
  615. */
  616. PairInfo.prototype.totalamount = "";
  617. /**
  618. * PairInfo last.
  619. * @member {string} last
  620. * @memberof market.v2.trade.main.pair.PairInfo
  621. * @instance
  622. */
  623. PairInfo.prototype.last = "";
  624. /**
  625. * PairInfo volume.
  626. * @member {string} volume
  627. * @memberof market.v2.trade.main.pair.PairInfo
  628. * @instance
  629. */
  630. PairInfo.prototype.volume = "";
  631. /**
  632. * PairInfo change.
  633. * @member {string} change
  634. * @memberof market.v2.trade.main.pair.PairInfo
  635. * @instance
  636. */
  637. PairInfo.prototype.change = "";
  638. /**
  639. * Creates a new PairInfo instance using the specified properties.
  640. * @function create
  641. * @memberof market.v2.trade.main.pair.PairInfo
  642. * @static
  643. * @param {market.v2.trade.main.pair.IPairInfo=} [properties] Properties to set
  644. * @returns {market.v2.trade.main.pair.PairInfo} PairInfo instance
  645. */
  646. PairInfo.create = function create(properties) {
  647. return new PairInfo(properties);
  648. };
  649. /**
  650. * Encodes the specified PairInfo message. Does not implicitly {@link market.v2.trade.main.pair.PairInfo.verify|verify} messages.
  651. * @function encode
  652. * @memberof market.v2.trade.main.pair.PairInfo
  653. * @static
  654. * @param {market.v2.trade.main.pair.IPairInfo} message PairInfo message or plain object to encode
  655. * @param {$protobuf.Writer} [writer] Writer to encode to
  656. * @returns {$protobuf.Writer} Writer
  657. */
  658. PairInfo.encode = function encode(message, writer) {
  659. if (!writer)
  660. writer = $Writer.create();
  661. if (message.tradeId != null && Object.hasOwnProperty.call(message, "tradeId"))
  662. writer.uint32(/* id 1, wireType 0 =*/8).int32(message.tradeId);
  663. if (message.cny != null && Object.hasOwnProperty.call(message, "cny"))
  664. writer.uint32(/* id 2, wireType 2 =*/18).string(message.cny);
  665. if (message.totalamount != null && Object.hasOwnProperty.call(message, "totalamount"))
  666. writer.uint32(/* id 3, wireType 2 =*/26).string(message.totalamount);
  667. if (message.last != null && Object.hasOwnProperty.call(message, "last"))
  668. writer.uint32(/* id 4, wireType 2 =*/34).string(message.last);
  669. if (message.volume != null && Object.hasOwnProperty.call(message, "volume"))
  670. writer.uint32(/* id 5, wireType 2 =*/42).string(message.volume);
  671. if (message.change != null && Object.hasOwnProperty.call(message, "change"))
  672. writer.uint32(/* id 6, wireType 2 =*/50).string(message.change);
  673. return writer;
  674. };
  675. /**
  676. * Encodes the specified PairInfo message, length delimited. Does not implicitly {@link market.v2.trade.main.pair.PairInfo.verify|verify} messages.
  677. * @function encodeDelimited
  678. * @memberof market.v2.trade.main.pair.PairInfo
  679. * @static
  680. * @param {market.v2.trade.main.pair.IPairInfo} message PairInfo message or plain object to encode
  681. * @param {$protobuf.Writer} [writer] Writer to encode to
  682. * @returns {$protobuf.Writer} Writer
  683. */
  684. PairInfo.encodeDelimited = function encodeDelimited(message, writer) {
  685. return this.encode(message, writer).ldelim();
  686. };
  687. /**
  688. * Decodes a PairInfo message from the specified reader or buffer.
  689. * @function decode
  690. * @memberof market.v2.trade.main.pair.PairInfo
  691. * @static
  692. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  693. * @param {number} [length] Message length if known beforehand
  694. * @returns {market.v2.trade.main.pair.PairInfo} PairInfo
  695. * @throws {Error} If the payload is not a reader or valid buffer
  696. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  697. */
  698. PairInfo.decode = function decode(reader, length) {
  699. if (!(reader instanceof $Reader))
  700. reader = $Reader.create(reader);
  701. var end = length === undefined ? reader.len : reader.pos + length, message = new $root.market.v2.trade.main.pair.PairInfo();
  702. while (reader.pos < end) {
  703. var tag = reader.uint32();
  704. switch (tag >>> 3) {
  705. case 1: {
  706. message.tradeId = reader.int32();
  707. break;
  708. }
  709. case 2: {
  710. message.cny = reader.string();
  711. break;
  712. }
  713. case 3: {
  714. message.totalamount = reader.string();
  715. break;
  716. }
  717. case 4: {
  718. message.last = reader.string();
  719. break;
  720. }
  721. case 5: {
  722. message.volume = reader.string();
  723. break;
  724. }
  725. case 6: {
  726. message.change = reader.string();
  727. break;
  728. }
  729. default:
  730. reader.skipType(tag & 7);
  731. break;
  732. }
  733. }
  734. return message;
  735. };
  736. /**
  737. * Decodes a PairInfo message from the specified reader or buffer, length delimited.
  738. * @function decodeDelimited
  739. * @memberof market.v2.trade.main.pair.PairInfo
  740. * @static
  741. * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
  742. * @returns {market.v2.trade.main.pair.PairInfo} PairInfo
  743. * @throws {Error} If the payload is not a reader or valid buffer
  744. * @throws {$protobuf.util.ProtocolError} If required fields are missing
  745. */
  746. PairInfo.decodeDelimited = function decodeDelimited(reader) {
  747. if (!(reader instanceof $Reader))
  748. reader = new $Reader(reader);
  749. return this.decode(reader, reader.uint32());
  750. };
  751. /**
  752. * Verifies a PairInfo message.
  753. * @function verify
  754. * @memberof market.v2.trade.main.pair.PairInfo
  755. * @static
  756. * @param {Object.<string,*>} message Plain object to verify
  757. * @returns {string|null} `null` if valid, otherwise the reason why it is not
  758. */
  759. PairInfo.verify = function verify(message) {
  760. if (typeof message !== "object" || message === null)
  761. return "object expected";
  762. if (message.tradeId != null && message.hasOwnProperty("tradeId"))
  763. if (!$util.isInteger(message.tradeId))
  764. return "tradeId: integer expected";
  765. if (message.cny != null && message.hasOwnProperty("cny"))
  766. if (!$util.isString(message.cny))
  767. return "cny: string expected";
  768. if (message.totalamount != null && message.hasOwnProperty("totalamount"))
  769. if (!$util.isString(message.totalamount))
  770. return "totalamount: string expected";
  771. if (message.last != null && message.hasOwnProperty("last"))
  772. if (!$util.isString(message.last))
  773. return "last: string expected";
  774. if (message.volume != null && message.hasOwnProperty("volume"))
  775. if (!$util.isString(message.volume))
  776. return "volume: string expected";
  777. if (message.change != null && message.hasOwnProperty("change"))
  778. if (!$util.isString(message.change))
  779. return "change: string expected";
  780. return null;
  781. };
  782. /**
  783. * Creates a PairInfo message from a plain object. Also converts values to their respective internal types.
  784. * @function fromObject
  785. * @memberof market.v2.trade.main.pair.PairInfo
  786. * @static
  787. * @param {Object.<string,*>} object Plain object
  788. * @returns {market.v2.trade.main.pair.PairInfo} PairInfo
  789. */
  790. PairInfo.fromObject = function fromObject(object) {
  791. if (object instanceof $root.market.v2.trade.main.pair.PairInfo)
  792. return object;
  793. var message = new $root.market.v2.trade.main.pair.PairInfo();
  794. if (object.tradeId != null)
  795. message.tradeId = object.tradeId | 0;
  796. if (object.cny != null)
  797. message.cny = String(object.cny);
  798. if (object.totalamount != null)
  799. message.totalamount = String(object.totalamount);
  800. if (object.last != null)
  801. message.last = String(object.last);
  802. if (object.volume != null)
  803. message.volume = String(object.volume);
  804. if (object.change != null)
  805. message.change = String(object.change);
  806. return message;
  807. };
  808. /**
  809. * Creates a plain object from a PairInfo message. Also converts values to other types if specified.
  810. * @function toObject
  811. * @memberof market.v2.trade.main.pair.PairInfo
  812. * @static
  813. * @param {market.v2.trade.main.pair.PairInfo} message PairInfo
  814. * @param {$protobuf.IConversionOptions} [options] Conversion options
  815. * @returns {Object.<string,*>} Plain object
  816. */
  817. PairInfo.toObject = function toObject(message, options) {
  818. if (!options)
  819. options = {};
  820. var object = {};
  821. if (options.defaults) {
  822. object.tradeId = 0;
  823. object.cny = "";
  824. object.totalamount = "";
  825. object.last = "";
  826. object.volume = "";
  827. object.change = "";
  828. }
  829. if (message.tradeId != null && message.hasOwnProperty("tradeId"))
  830. object.tradeId = message.tradeId;
  831. if (message.cny != null && message.hasOwnProperty("cny"))
  832. object.cny = message.cny;
  833. if (message.totalamount != null && message.hasOwnProperty("totalamount"))
  834. object.totalamount = message.totalamount;
  835. if (message.last != null && message.hasOwnProperty("last"))
  836. object.last = message.last;
  837. if (message.volume != null && message.hasOwnProperty("volume"))
  838. object.volume = message.volume;
  839. if (message.change != null && message.hasOwnProperty("change"))
  840. object.change = message.change;
  841. return object;
  842. };
  843. /**
  844. * Converts this PairInfo to JSON.
  845. * @function toJSON
  846. * @memberof market.v2.trade.main.pair.PairInfo
  847. * @instance
  848. * @returns {Object.<string,*>} JSON object
  849. */
  850. PairInfo.prototype.toJSON = function toJSON() {
  851. return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
  852. };
  853. /**
  854. * Gets the default type url for PairInfo
  855. * @function getTypeUrl
  856. * @memberof market.v2.trade.main.pair.PairInfo
  857. * @static
  858. * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
  859. * @returns {string} The default type url
  860. */
  861. PairInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
  862. if (typeUrlPrefix === undefined) {
  863. typeUrlPrefix = "type.googleapis.com";
  864. }
  865. return typeUrlPrefix + "/market.v2.trade.main.pair.PairInfo";
  866. };
  867. return PairInfo;
  868. })();
  869. return pair;
  870. })();
  871. return main;
  872. })();
  873. return trade;
  874. })();
  875. return v2;
  876. })();
  877. return market;
  878. })();
  879. module.exports = $root;