UNPKG

ib-client

Version:

Interactive Brokers API client library for Node.js

14 lines (11 loc) 1.01 kB
"use strict";Object.defineProperty(exports, "__esModule", { value: true });exports["default"] = void 0;var _validators = require("../validators"); var _constants = require("../constants");function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}var _default = function _default(_ref) {var symbol = _ref.symbol,comboLegs = _ref.comboLegs,currency = _ref.currency,exchange = _ref.exchange;_classCallCheck(this, _default); (0, _validators.validateInput)(typeof symbol === 'string' && symbol.length > 0, 'Symbol must be a string.'); (0, _validators.validateInput)(Array.isArray(comboLegs) && comboLegs.length > 0, 'Combo Legs must be an array.'); this.symbol = symbol || undefined; this.secType = _constants.SEC_TYPE.BAG; this.comboLegs = comboLegs || null; this.currency = currency || _constants.DEFAULT_CURRENCY; this.exchange = exchange || _constants.DEFAULT_EXCHANGE; };exports["default"] = _default;