ib-client
Version:
Interactive Brokers API client library for Node.js
17 lines (14 loc) • 1.01 kB
JavaScript
;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 conId = _ref.conId,symbol = _ref.symbol,currency = _ref.currency,exchange = _ref.exchange;_classCallCheck(this, _default);
if (!conId) {
(0, _validators.validateInput)(typeof symbol === 'string' && symbol.length > 0, 'Symbol must be a string.');
} else {
(0, _validators.validateInput)(typeof conId === 'number', 'Contract Id must be a number.');
}
this.conId = conId || undefined;
this.symbol = symbol || undefined;
this.secType = _constants.SEC_TYPE.STOCK;
this.currency = currency || _constants.DEFAULT_CURRENCY;
this.exchange = exchange || _constants.DEFAULT_EXCHANGE;
};exports["default"] = _default;