UNPKG

ccxt

Version:

A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go

1,286 lines (1,189 loc) • 320 kB
"use strict"; (self["webpackChunkccxt"] = self["webpackChunkccxt"] || []).push([[373],{ /***/ 2373: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ var $protobuf = __webpack_require__(Object(function webpackMissingModule() { var e = new Error("Cannot find module 'protobufjs/minimal'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())); // Common aliases var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); $root.PrivateAccountV3Api = (function() { /** * Properties of a PrivateAccountV3Api. * @exports IPrivateAccountV3Api * @interface IPrivateAccountV3Api * @property {string|null} [vcoinName] PrivateAccountV3Api vcoinName * @property {string|null} [coinId] PrivateAccountV3Api coinId * @property {string|null} [balanceAmount] PrivateAccountV3Api balanceAmount * @property {string|null} [balanceAmountChange] PrivateAccountV3Api balanceAmountChange * @property {string|null} [frozenAmount] PrivateAccountV3Api frozenAmount * @property {string|null} [frozenAmountChange] PrivateAccountV3Api frozenAmountChange * @property {string|null} [type] PrivateAccountV3Api type * @property {number|Long|null} [time] PrivateAccountV3Api time */ /** * Constructs a new PrivateAccountV3Api. * @exports PrivateAccountV3Api * @classdesc Represents a PrivateAccountV3Api. * @implements IPrivateAccountV3Api * @constructor * @param {IPrivateAccountV3Api=} [properties] Properties to set */ function PrivateAccountV3Api(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]]; } /** * PrivateAccountV3Api vcoinName. * @member {string} vcoinName * @memberof PrivateAccountV3Api * @instance */ PrivateAccountV3Api.prototype.vcoinName = ""; /** * PrivateAccountV3Api coinId. * @member {string} coinId * @memberof PrivateAccountV3Api * @instance */ PrivateAccountV3Api.prototype.coinId = ""; /** * PrivateAccountV3Api balanceAmount. * @member {string} balanceAmount * @memberof PrivateAccountV3Api * @instance */ PrivateAccountV3Api.prototype.balanceAmount = ""; /** * PrivateAccountV3Api balanceAmountChange. * @member {string} balanceAmountChange * @memberof PrivateAccountV3Api * @instance */ PrivateAccountV3Api.prototype.balanceAmountChange = ""; /** * PrivateAccountV3Api frozenAmount. * @member {string} frozenAmount * @memberof PrivateAccountV3Api * @instance */ PrivateAccountV3Api.prototype.frozenAmount = ""; /** * PrivateAccountV3Api frozenAmountChange. * @member {string} frozenAmountChange * @memberof PrivateAccountV3Api * @instance */ PrivateAccountV3Api.prototype.frozenAmountChange = ""; /** * PrivateAccountV3Api type. * @member {string} type * @memberof PrivateAccountV3Api * @instance */ PrivateAccountV3Api.prototype.type = ""; /** * PrivateAccountV3Api time. * @member {number|Long} time * @memberof PrivateAccountV3Api * @instance */ PrivateAccountV3Api.prototype.time = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * Creates a new PrivateAccountV3Api instance using the specified properties. * @function create * @memberof PrivateAccountV3Api * @static * @param {IPrivateAccountV3Api=} [properties] Properties to set * @returns {PrivateAccountV3Api} PrivateAccountV3Api instance */ PrivateAccountV3Api.create = function create(properties) { return new PrivateAccountV3Api(properties); }; /** * Encodes the specified PrivateAccountV3Api message. Does not implicitly {@link PrivateAccountV3Api.verify|verify} messages. * @function encode * @memberof PrivateAccountV3Api * @static * @param {IPrivateAccountV3Api} message PrivateAccountV3Api message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ PrivateAccountV3Api.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.vcoinName != null && Object.hasOwnProperty.call(message, "vcoinName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.vcoinName); if (message.coinId != null && Object.hasOwnProperty.call(message, "coinId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.coinId); if (message.balanceAmount != null && Object.hasOwnProperty.call(message, "balanceAmount")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.balanceAmount); if (message.balanceAmountChange != null && Object.hasOwnProperty.call(message, "balanceAmountChange")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.balanceAmountChange); if (message.frozenAmount != null && Object.hasOwnProperty.call(message, "frozenAmount")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.frozenAmount); if (message.frozenAmountChange != null && Object.hasOwnProperty.call(message, "frozenAmountChange")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.frozenAmountChange); if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.type); if (message.time != null && Object.hasOwnProperty.call(message, "time")) writer.uint32(/* id 8, wireType 0 =*/64).int64(message.time); return writer; }; /** * Encodes the specified PrivateAccountV3Api message, length delimited. Does not implicitly {@link PrivateAccountV3Api.verify|verify} messages. * @function encodeDelimited * @memberof PrivateAccountV3Api * @static * @param {IPrivateAccountV3Api} message PrivateAccountV3Api message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ PrivateAccountV3Api.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a PrivateAccountV3Api message from the specified reader or buffer. * @function decode * @memberof PrivateAccountV3Api * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {PrivateAccountV3Api} PrivateAccountV3Api * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PrivateAccountV3Api.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.PrivateAccountV3Api(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message.vcoinName = reader.string(); break; } case 2: { message.coinId = reader.string(); break; } case 3: { message.balanceAmount = reader.string(); break; } case 4: { message.balanceAmountChange = reader.string(); break; } case 5: { message.frozenAmount = reader.string(); break; } case 6: { message.frozenAmountChange = reader.string(); break; } case 7: { message.type = reader.string(); break; } case 8: { message.time = reader.int64(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a PrivateAccountV3Api message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof PrivateAccountV3Api * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {PrivateAccountV3Api} PrivateAccountV3Api * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PrivateAccountV3Api.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a PrivateAccountV3Api message. * @function verify * @memberof PrivateAccountV3Api * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ PrivateAccountV3Api.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.vcoinName != null && message.hasOwnProperty("vcoinName")) if (!$util.isString(message.vcoinName)) return "vcoinName: string expected"; if (message.coinId != null && message.hasOwnProperty("coinId")) if (!$util.isString(message.coinId)) return "coinId: string expected"; if (message.balanceAmount != null && message.hasOwnProperty("balanceAmount")) if (!$util.isString(message.balanceAmount)) return "balanceAmount: string expected"; if (message.balanceAmountChange != null && message.hasOwnProperty("balanceAmountChange")) if (!$util.isString(message.balanceAmountChange)) return "balanceAmountChange: string expected"; if (message.frozenAmount != null && message.hasOwnProperty("frozenAmount")) if (!$util.isString(message.frozenAmount)) return "frozenAmount: string expected"; if (message.frozenAmountChange != null && message.hasOwnProperty("frozenAmountChange")) if (!$util.isString(message.frozenAmountChange)) return "frozenAmountChange: string expected"; if (message.type != null && message.hasOwnProperty("type")) if (!$util.isString(message.type)) return "type: string expected"; if (message.time != null && message.hasOwnProperty("time")) if (!$util.isInteger(message.time) && !(message.time && $util.isInteger(message.time.low) && $util.isInteger(message.time.high))) return "time: integer|Long expected"; return null; }; /** * Creates a PrivateAccountV3Api message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof PrivateAccountV3Api * @static * @param {Object.<string,*>} object Plain object * @returns {PrivateAccountV3Api} PrivateAccountV3Api */ PrivateAccountV3Api.fromObject = function fromObject(object) { if (object instanceof $root.PrivateAccountV3Api) return object; var message = new $root.PrivateAccountV3Api(); if (object.vcoinName != null) message.vcoinName = String(object.vcoinName); if (object.coinId != null) message.coinId = String(object.coinId); if (object.balanceAmount != null) message.balanceAmount = String(object.balanceAmount); if (object.balanceAmountChange != null) message.balanceAmountChange = String(object.balanceAmountChange); if (object.frozenAmount != null) message.frozenAmount = String(object.frozenAmount); if (object.frozenAmountChange != null) message.frozenAmountChange = String(object.frozenAmountChange); if (object.type != null) message.type = String(object.type); if (object.time != null) if ($util.Long) (message.time = $util.Long.fromValue(object.time)).unsigned = false; else if (typeof object.time === "string") message.time = parseInt(object.time, 10); else if (typeof object.time === "number") message.time = object.time; else if (typeof object.time === "object") message.time = new $util.LongBits(object.time.low >>> 0, object.time.high >>> 0).toNumber(); return message; }; /** * Creates a plain object from a PrivateAccountV3Api message. Also converts values to other types if specified. * @function toObject * @memberof PrivateAccountV3Api * @static * @param {PrivateAccountV3Api} message PrivateAccountV3Api * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ PrivateAccountV3Api.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.vcoinName = ""; object.coinId = ""; object.balanceAmount = ""; object.balanceAmountChange = ""; object.frozenAmount = ""; object.frozenAmountChange = ""; object.type = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); object.time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.time = options.longs === String ? "0" : 0; } if (message.vcoinName != null && message.hasOwnProperty("vcoinName")) object.vcoinName = message.vcoinName; if (message.coinId != null && message.hasOwnProperty("coinId")) object.coinId = message.coinId; if (message.balanceAmount != null && message.hasOwnProperty("balanceAmount")) object.balanceAmount = message.balanceAmount; if (message.balanceAmountChange != null && message.hasOwnProperty("balanceAmountChange")) object.balanceAmountChange = message.balanceAmountChange; if (message.frozenAmount != null && message.hasOwnProperty("frozenAmount")) object.frozenAmount = message.frozenAmount; if (message.frozenAmountChange != null && message.hasOwnProperty("frozenAmountChange")) object.frozenAmountChange = message.frozenAmountChange; if (message.type != null && message.hasOwnProperty("type")) object.type = message.type; if (message.time != null && message.hasOwnProperty("time")) if (typeof message.time === "number") object.time = options.longs === String ? String(message.time) : message.time; else object.time = options.longs === String ? $util.Long.prototype.toString.call(message.time) : options.longs === Number ? new $util.LongBits(message.time.low >>> 0, message.time.high >>> 0).toNumber() : message.time; return object; }; /** * Converts this PrivateAccountV3Api to JSON. * @function toJSON * @memberof PrivateAccountV3Api * @instance * @returns {Object.<string,*>} JSON object */ PrivateAccountV3Api.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for PrivateAccountV3Api * @function getTypeUrl * @memberof PrivateAccountV3Api * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ PrivateAccountV3Api.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/PrivateAccountV3Api"; }; return PrivateAccountV3Api; })(); $root.PrivateDealsV3Api = (function() { /** * Properties of a PrivateDealsV3Api. * @exports IPrivateDealsV3Api * @interface IPrivateDealsV3Api * @property {string|null} [price] PrivateDealsV3Api price * @property {string|null} [quantity] PrivateDealsV3Api quantity * @property {string|null} [amount] PrivateDealsV3Api amount * @property {number|null} [tradeType] PrivateDealsV3Api tradeType * @property {boolean|null} [isMaker] PrivateDealsV3Api isMaker * @property {boolean|null} [isSelfTrade] PrivateDealsV3Api isSelfTrade * @property {string|null} [tradeId] PrivateDealsV3Api tradeId * @property {string|null} [clientOrderId] PrivateDealsV3Api clientOrderId * @property {string|null} [orderId] PrivateDealsV3Api orderId * @property {string|null} [feeAmount] PrivateDealsV3Api feeAmount * @property {string|null} [feeCurrency] PrivateDealsV3Api feeCurrency * @property {number|Long|null} [time] PrivateDealsV3Api time */ /** * Constructs a new PrivateDealsV3Api. * @exports PrivateDealsV3Api * @classdesc Represents a PrivateDealsV3Api. * @implements IPrivateDealsV3Api * @constructor * @param {IPrivateDealsV3Api=} [properties] Properties to set */ function PrivateDealsV3Api(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]]; } /** * PrivateDealsV3Api price. * @member {string} price * @memberof PrivateDealsV3Api * @instance */ PrivateDealsV3Api.prototype.price = ""; /** * PrivateDealsV3Api quantity. * @member {string} quantity * @memberof PrivateDealsV3Api * @instance */ PrivateDealsV3Api.prototype.quantity = ""; /** * PrivateDealsV3Api amount. * @member {string} amount * @memberof PrivateDealsV3Api * @instance */ PrivateDealsV3Api.prototype.amount = ""; /** * PrivateDealsV3Api tradeType. * @member {number} tradeType * @memberof PrivateDealsV3Api * @instance */ PrivateDealsV3Api.prototype.tradeType = 0; /** * PrivateDealsV3Api isMaker. * @member {boolean} isMaker * @memberof PrivateDealsV3Api * @instance */ PrivateDealsV3Api.prototype.isMaker = false; /** * PrivateDealsV3Api isSelfTrade. * @member {boolean} isSelfTrade * @memberof PrivateDealsV3Api * @instance */ PrivateDealsV3Api.prototype.isSelfTrade = false; /** * PrivateDealsV3Api tradeId. * @member {string} tradeId * @memberof PrivateDealsV3Api * @instance */ PrivateDealsV3Api.prototype.tradeId = ""; /** * PrivateDealsV3Api clientOrderId. * @member {string} clientOrderId * @memberof PrivateDealsV3Api * @instance */ PrivateDealsV3Api.prototype.clientOrderId = ""; /** * PrivateDealsV3Api orderId. * @member {string} orderId * @memberof PrivateDealsV3Api * @instance */ PrivateDealsV3Api.prototype.orderId = ""; /** * PrivateDealsV3Api feeAmount. * @member {string} feeAmount * @memberof PrivateDealsV3Api * @instance */ PrivateDealsV3Api.prototype.feeAmount = ""; /** * PrivateDealsV3Api feeCurrency. * @member {string} feeCurrency * @memberof PrivateDealsV3Api * @instance */ PrivateDealsV3Api.prototype.feeCurrency = ""; /** * PrivateDealsV3Api time. * @member {number|Long} time * @memberof PrivateDealsV3Api * @instance */ PrivateDealsV3Api.prototype.time = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * Creates a new PrivateDealsV3Api instance using the specified properties. * @function create * @memberof PrivateDealsV3Api * @static * @param {IPrivateDealsV3Api=} [properties] Properties to set * @returns {PrivateDealsV3Api} PrivateDealsV3Api instance */ PrivateDealsV3Api.create = function create(properties) { return new PrivateDealsV3Api(properties); }; /** * Encodes the specified PrivateDealsV3Api message. Does not implicitly {@link PrivateDealsV3Api.verify|verify} messages. * @function encode * @memberof PrivateDealsV3Api * @static * @param {IPrivateDealsV3Api} message PrivateDealsV3Api message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ PrivateDealsV3Api.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.price != null && Object.hasOwnProperty.call(message, "price")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.price); if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.quantity); if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.amount); if (message.tradeType != null && Object.hasOwnProperty.call(message, "tradeType")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.tradeType); if (message.isMaker != null && Object.hasOwnProperty.call(message, "isMaker")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.isMaker); if (message.isSelfTrade != null && Object.hasOwnProperty.call(message, "isSelfTrade")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.isSelfTrade); if (message.tradeId != null && Object.hasOwnProperty.call(message, "tradeId")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.tradeId); if (message.clientOrderId != null && Object.hasOwnProperty.call(message, "clientOrderId")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.clientOrderId); if (message.orderId != null && Object.hasOwnProperty.call(message, "orderId")) writer.uint32(/* id 9, wireType 2 =*/74).string(message.orderId); if (message.feeAmount != null && Object.hasOwnProperty.call(message, "feeAmount")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.feeAmount); if (message.feeCurrency != null && Object.hasOwnProperty.call(message, "feeCurrency")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.feeCurrency); if (message.time != null && Object.hasOwnProperty.call(message, "time")) writer.uint32(/* id 12, wireType 0 =*/96).int64(message.time); return writer; }; /** * Encodes the specified PrivateDealsV3Api message, length delimited. Does not implicitly {@link PrivateDealsV3Api.verify|verify} messages. * @function encodeDelimited * @memberof PrivateDealsV3Api * @static * @param {IPrivateDealsV3Api} message PrivateDealsV3Api message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ PrivateDealsV3Api.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** * Decodes a PrivateDealsV3Api message from the specified reader or buffer. * @function decode * @memberof PrivateDealsV3Api * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand * @returns {PrivateDealsV3Api} PrivateDealsV3Api * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PrivateDealsV3Api.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); var end = length === undefined ? reader.len : reader.pos + length, message = new $root.PrivateDealsV3Api(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { message.price = reader.string(); break; } case 2: { message.quantity = reader.string(); break; } case 3: { message.amount = reader.string(); break; } case 4: { message.tradeType = reader.int32(); break; } case 5: { message.isMaker = reader.bool(); break; } case 6: { message.isSelfTrade = reader.bool(); break; } case 7: { message.tradeId = reader.string(); break; } case 8: { message.clientOrderId = reader.string(); break; } case 9: { message.orderId = reader.string(); break; } case 10: { message.feeAmount = reader.string(); break; } case 11: { message.feeCurrency = reader.string(); break; } case 12: { message.time = reader.int64(); break; } default: reader.skipType(tag & 7); break; } } return message; }; /** * Decodes a PrivateDealsV3Api message from the specified reader or buffer, length delimited. * @function decodeDelimited * @memberof PrivateDealsV3Api * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @returns {PrivateDealsV3Api} PrivateDealsV3Api * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ PrivateDealsV3Api.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** * Verifies a PrivateDealsV3Api message. * @function verify * @memberof PrivateDealsV3Api * @static * @param {Object.<string,*>} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ PrivateDealsV3Api.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.price != null && message.hasOwnProperty("price")) if (!$util.isString(message.price)) return "price: string expected"; if (message.quantity != null && message.hasOwnProperty("quantity")) if (!$util.isString(message.quantity)) return "quantity: string expected"; if (message.amount != null && message.hasOwnProperty("amount")) if (!$util.isString(message.amount)) return "amount: string expected"; if (message.tradeType != null && message.hasOwnProperty("tradeType")) if (!$util.isInteger(message.tradeType)) return "tradeType: integer expected"; if (message.isMaker != null && message.hasOwnProperty("isMaker")) if (typeof message.isMaker !== "boolean") return "isMaker: boolean expected"; if (message.isSelfTrade != null && message.hasOwnProperty("isSelfTrade")) if (typeof message.isSelfTrade !== "boolean") return "isSelfTrade: boolean expected"; if (message.tradeId != null && message.hasOwnProperty("tradeId")) if (!$util.isString(message.tradeId)) return "tradeId: string expected"; if (message.clientOrderId != null && message.hasOwnProperty("clientOrderId")) if (!$util.isString(message.clientOrderId)) return "clientOrderId: string expected"; if (message.orderId != null && message.hasOwnProperty("orderId")) if (!$util.isString(message.orderId)) return "orderId: string expected"; if (message.feeAmount != null && message.hasOwnProperty("feeAmount")) if (!$util.isString(message.feeAmount)) return "feeAmount: string expected"; if (message.feeCurrency != null && message.hasOwnProperty("feeCurrency")) if (!$util.isString(message.feeCurrency)) return "feeCurrency: string expected"; if (message.time != null && message.hasOwnProperty("time")) if (!$util.isInteger(message.time) && !(message.time && $util.isInteger(message.time.low) && $util.isInteger(message.time.high))) return "time: integer|Long expected"; return null; }; /** * Creates a PrivateDealsV3Api message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof PrivateDealsV3Api * @static * @param {Object.<string,*>} object Plain object * @returns {PrivateDealsV3Api} PrivateDealsV3Api */ PrivateDealsV3Api.fromObject = function fromObject(object) { if (object instanceof $root.PrivateDealsV3Api) return object; var message = new $root.PrivateDealsV3Api(); if (object.price != null) message.price = String(object.price); if (object.quantity != null) message.quantity = String(object.quantity); if (object.amount != null) message.amount = String(object.amount); if (object.tradeType != null) message.tradeType = object.tradeType | 0; if (object.isMaker != null) message.isMaker = Boolean(object.isMaker); if (object.isSelfTrade != null) message.isSelfTrade = Boolean(object.isSelfTrade); if (object.tradeId != null) message.tradeId = String(object.tradeId); if (object.clientOrderId != null) message.clientOrderId = String(object.clientOrderId); if (object.orderId != null) message.orderId = String(object.orderId); if (object.feeAmount != null) message.feeAmount = String(object.feeAmount); if (object.feeCurrency != null) message.feeCurrency = String(object.feeCurrency); if (object.time != null) if ($util.Long) (message.time = $util.Long.fromValue(object.time)).unsigned = false; else if (typeof object.time === "string") message.time = parseInt(object.time, 10); else if (typeof object.time === "number") message.time = object.time; else if (typeof object.time === "object") message.time = new $util.LongBits(object.time.low >>> 0, object.time.high >>> 0).toNumber(); return message; }; /** * Creates a plain object from a PrivateDealsV3Api message. Also converts values to other types if specified. * @function toObject * @memberof PrivateDealsV3Api * @static * @param {PrivateDealsV3Api} message PrivateDealsV3Api * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.<string,*>} Plain object */ PrivateDealsV3Api.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.price = ""; object.quantity = ""; object.amount = ""; object.tradeType = 0; object.isMaker = false; object.isSelfTrade = false; object.tradeId = ""; object.clientOrderId = ""; object.orderId = ""; object.feeAmount = ""; object.feeCurrency = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); object.time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.time = options.longs === String ? "0" : 0; } if (message.price != null && message.hasOwnProperty("price")) object.price = message.price; if (message.quantity != null && message.hasOwnProperty("quantity")) object.quantity = message.quantity; if (message.amount != null && message.hasOwnProperty("amount")) object.amount = message.amount; if (message.tradeType != null && message.hasOwnProperty("tradeType")) object.tradeType = message.tradeType; if (message.isMaker != null && message.hasOwnProperty("isMaker")) object.isMaker = message.isMaker; if (message.isSelfTrade != null && message.hasOwnProperty("isSelfTrade")) object.isSelfTrade = message.isSelfTrade; if (message.tradeId != null && message.hasOwnProperty("tradeId")) object.tradeId = message.tradeId; if (message.clientOrderId != null && message.hasOwnProperty("clientOrderId")) object.clientOrderId = message.clientOrderId; if (message.orderId != null && message.hasOwnProperty("orderId")) object.orderId = message.orderId; if (message.feeAmount != null && message.hasOwnProperty("feeAmount")) object.feeAmount = message.feeAmount; if (message.feeCurrency != null && message.hasOwnProperty("feeCurrency")) object.feeCurrency = message.feeCurrency; if (message.time != null && message.hasOwnProperty("time")) if (typeof message.time === "number") object.time = options.longs === String ? String(message.time) : message.time; else object.time = options.longs === String ? $util.Long.prototype.toString.call(message.time) : options.longs === Number ? new $util.LongBits(message.time.low >>> 0, message.time.high >>> 0).toNumber() : message.time; return object; }; /** * Converts this PrivateDealsV3Api to JSON. * @function toJSON * @memberof PrivateDealsV3Api * @instance * @returns {Object.<string,*>} JSON object */ PrivateDealsV3Api.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** * Gets the default type url for PrivateDealsV3Api * @function getTypeUrl * @memberof PrivateDealsV3Api * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ PrivateDealsV3Api.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } return typeUrlPrefix + "/PrivateDealsV3Api"; }; return PrivateDealsV3Api; })(); $root.PrivateOrdersV3Api = (function() { /** * Properties of a PrivateOrdersV3Api. * @exports IPrivateOrdersV3Api * @interface IPrivateOrdersV3Api * @property {string|null} [id] PrivateOrdersV3Api id * @property {string|null} [clientId] PrivateOrdersV3Api clientId * @property {string|null} [price] PrivateOrdersV3Api price * @property {string|null} [quantity] PrivateOrdersV3Api quantity * @property {string|null} [amount] PrivateOrdersV3Api amount * @property {string|null} [avgPrice] PrivateOrdersV3Api avgPrice * @property {number|null} [orderType] PrivateOrdersV3Api orderType * @property {number|null} [tradeType] PrivateOrdersV3Api tradeType * @property {boolean|null} [isMaker] PrivateOrdersV3Api isMaker * @property {string|null} [remainAmount] PrivateOrdersV3Api remainAmount * @property {string|null} [remainQuantity] PrivateOrdersV3Api remainQuantity * @property {string|null} [lastDealQuantity] PrivateOrdersV3Api lastDealQuantity * @property {string|null} [cumulativeQuantity] PrivateOrdersV3Api cumulativeQuantity * @property {string|null} [cumulativeAmount] PrivateOrdersV3Api cumulativeAmount * @property {number|null} [status] PrivateOrdersV3Api status * @property {number|Long|null} [createTime] PrivateOrdersV3Api createTime * @property {string|null} [market] PrivateOrdersV3Api market * @property {number|null} [triggerType] PrivateOrdersV3Api triggerType * @property {string|null} [triggerPrice] PrivateOrdersV3Api triggerPrice * @property {number|null} [state] PrivateOrdersV3Api state * @property {string|null} [ocoId] PrivateOrdersV3Api ocoId * @property {string|null} [routeFactor] PrivateOrdersV3Api routeFactor * @property {string|null} [symbolId] PrivateOrdersV3Api symbolId * @property {string|null} [marketId] PrivateOrdersV3Api marketId * @property {string|null} [marketCurrencyId] PrivateOrdersV3Api marketCurrencyId * @property {string|null} [currencyId] PrivateOrdersV3Api currencyId */ /** * Constructs a new PrivateOrdersV3Api. * @exports PrivateOrdersV3Api * @classdesc Represents a PrivateOrdersV3Api. * @implements IPrivateOrdersV3Api * @constructor * @param {IPrivateOrdersV3Api=} [properties] Properties to set */ function PrivateOrdersV3Api(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]]; } /** * PrivateOrdersV3Api id. * @member {string} id * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.id = ""; /** * PrivateOrdersV3Api clientId. * @member {string} clientId * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.clientId = ""; /** * PrivateOrdersV3Api price. * @member {string} price * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.price = ""; /** * PrivateOrdersV3Api quantity. * @member {string} quantity * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.quantity = ""; /** * PrivateOrdersV3Api amount. * @member {string} amount * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.amount = ""; /** * PrivateOrdersV3Api avgPrice. * @member {string} avgPrice * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.avgPrice = ""; /** * PrivateOrdersV3Api orderType. * @member {number} orderType * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.orderType = 0; /** * PrivateOrdersV3Api tradeType. * @member {number} tradeType * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.tradeType = 0; /** * PrivateOrdersV3Api isMaker. * @member {boolean} isMaker * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.isMaker = false; /** * PrivateOrdersV3Api remainAmount. * @member {string} remainAmount * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.remainAmount = ""; /** * PrivateOrdersV3Api remainQuantity. * @member {string} remainQuantity * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.remainQuantity = ""; /** * PrivateOrdersV3Api lastDealQuantity. * @member {string|null|undefined} lastDealQuantity * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.lastDealQuantity = null; /** * PrivateOrdersV3Api cumulativeQuantity. * @member {string} cumulativeQuantity * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.cumulativeQuantity = ""; /** * PrivateOrdersV3Api cumulativeAmount. * @member {string} cumulativeAmount * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.cumulativeAmount = ""; /** * PrivateOrdersV3Api status. * @member {number} status * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.status = 0; /** * PrivateOrdersV3Api createTime. * @member {number|Long} createTime * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.createTime = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * PrivateOrdersV3Api market. * @member {string|null|undefined} market * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.market = null; /** * PrivateOrdersV3Api triggerType. * @member {number|null|undefined} triggerType * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.triggerType = null; /** * PrivateOrdersV3Api triggerPrice. * @member {string|null|undefined} triggerPrice * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.triggerPrice = null; /** * PrivateOrdersV3Api state. * @member {number|null|undefined} state * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.state = null; /** * PrivateOrdersV3Api ocoId. * @member {string|null|undefined} ocoId * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.ocoId = null; /** * PrivateOrdersV3Api routeFactor. * @member {string|null|undefined} routeFactor * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.routeFactor = null; /** * PrivateOrdersV3Api symbolId. * @member {string|null|undefined} symbolId * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.symbolId = null; /** * PrivateOrdersV3Api marketId. * @member {string|null|undefined} marketId * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.marketId = null; /** * PrivateOrdersV3Api marketCurrencyId. * @member {string|null|undefined} marketCurrencyId * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.marketCurrencyId = null; /** * PrivateOrdersV3Api currencyId. * @member {string|null|undefined} currencyId * @memberof PrivateOrdersV3Api * @instance */ PrivateOrdersV3Api.prototype.currencyId = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * PrivateOrdersV3Api _lastDealQuantity. * @member {"lastDealQuantity"|undefined} _lastDealQuantity * @memberof PrivateOrdersV3Api * @instance */ Object.defineProperty(PrivateOrdersV3Api.prototype, "_lastDealQuantity", { get: $util.oneOfGetter($oneOfFields = ["lastDealQuantity"]), set: $util.oneOfSetter($oneOfFields) }); /** * PrivateOrdersV3Api _market. * @member {"market"|undefined} _market * @memberof PrivateOrdersV3Api * @instance */ Object.defineProperty(PrivateOrdersV3Api.prototype, "_market", { get: $util.oneOfGetter($oneOfFields = ["market"]), set: $util.oneOfSetter($oneOfFields) }); /** * PrivateOrdersV3Api _triggerType. * @member {"triggerType"|undefined} _triggerType * @memberof PrivateOrdersV3Api * @instance */ Object.defineProperty(PrivateOrdersV3Api.prototype, "_triggerType", { get: $util.oneOfGetter($oneOfFields = ["triggerType"]), set: $util.oneOfSetter($oneOfFields) }); /** * PrivateOrdersV3Api _triggerPrice. * @member {"triggerPrice"|undefined} _triggerPrice * @memberof PrivateOrdersV3Api * @instance */ Object.defineProperty(PrivateOrdersV3Api.prototype, "_triggerPrice", { get: $util.oneOfGetter($oneOfFields = ["triggerPrice"]), set: $util.oneOfSetter($oneOfFields) }); /** * PrivateOrdersV3Api _state. * @member {"state"|undefined} _state * @memberof PrivateOrdersV3Api * @instance */ Object.defineProperty(PrivateOrdersV3Api.prototype, "_state", { get: $util.oneOfGetter($oneOfFields = ["state"]), set: $util.oneOfSetter($oneOfFields) }); /** * PrivateOrdersV3Api _ocoId. * @member {"ocoId"|undefined} _ocoId * @memberof PrivateOrdersV3Api * @instance */ Object.defineProperty(PrivateOrdersV3Api.prototype, "_ocoId", { get: $util.oneOfGetter($oneOfFields = ["ocoId"]), set: $util.oneOfSetter($oneOfFields) }); /** * PrivateOrdersV3Api _routeFactor. * @member {"routeFactor"|undefined} _routeFactor * @memberof PrivateOrdersV3Api * @instance */ Object.defineProperty(PrivateOrdersV3Api.prototype, "_routeFactor", { get: $util.oneOfGetter($oneOfFields = ["routeFactor"]), set: $util.oneOfSetter($oneOfFields) }); /** * PrivateOrdersV3Api _symbolId. * @member {"symbolId"|undefined} _symbolId * @memberof PrivateOrdersV3Api * @instance */ Object.defineProperty(PrivateOrdersV3Api.prototype, "_symbolId", { get: $util.oneOfGetter($oneOfFields = ["symbolId"]), set: $util.oneOfSetter($oneOfFields) }); /** * PrivateOrdersV3Api _marketId. * @member {"marketId"|undefined} _marketId * @memberof PrivateOrdersV3Api * @instance */ Object.defineProperty(PrivateOrdersV3Api.prototype, "_marketId", { get: $util.oneOfGetter($oneOfFields = ["marketId"]), set: $util.oneOfSetter($oneOfFields) }); /** * PrivateOrdersV3Api _marketCurrencyId. * @member {"marketCurrencyId"|undefined} _marketCurrencyId * @memberof PrivateOrdersV3Api * @instance */ Object.defineProperty(PrivateOrdersV3Api.prototype, "_marketCurrencyId", { get: $util.oneOfGetter($oneOfFields = ["marketCurrencyId"]), set: $util.oneOfSetter($oneOfFields) }); /** * PrivateOrdersV3Api _currencyId. * @member {"currencyId"|undefined} _currencyId * @memberof PrivateOrdersV3Api * @instance */ Object.defineProperty(PrivateOrdersV3Api.prototype, "_currencyId", { get: $util.oneOfGetter($oneOfFields = ["currencyId"]), set: $util.oneOfSetter($oneOfFields) }); /** * Creates a new PrivateOrdersV3Api instance using the specified properties. * @function create * @memberof PrivateOrdersV3Api * @static * @param {IPrivateOrdersV3Api=} [properties] Properties to set * @returns {PrivateOrdersV3Api} PrivateOrdersV3Api instance */ PrivateOrdersV3Api.create = function create(properties) { return new PrivateOrdersV3Api(properties); }; /** * Encodes the specified PrivateOrdersV3Api message. Does not implicitly {@link PrivateOrdersV3Api.verify|verify} messages. * @function encode * @memberof PrivateOrdersV3Api * @static * @param {IPrivateOrdersV3Api} message PrivateOrdersV3Api message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ PrivateOrdersV3Api.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.id != null && Object.hasOwnProperty.call(message, "id")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientId); if (message.price != null && Object.hasOwnProperty.call(message, "price")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.price); if (message.quantity != null && Object.hasOwnProperty.call(message, "quantity")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.quantity); if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) writer.uint32(/* id