@adaptic/utils 0.0.992 → 0.0.994
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -3
- package/dist/index.cjs +73 -79
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +73 -79
- package/dist/index.mjs.map +1 -1
- package/dist/test.js +0 -220
- package/dist/test.js.map +1 -1
- package/dist/types/technical-analysis.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/index.d.ts.map +1 -1
- package/package.json +5 -3
package/dist/index.mjs
CHANGED
|
@@ -11615,7 +11615,6 @@ function calculateBollingerBands(priceData, { period = 20, standardDeviations =
|
|
|
11615
11615
|
close: priceData[i].close,
|
|
11616
11616
|
});
|
|
11617
11617
|
}
|
|
11618
|
-
// logIfDebug(`Calculated Bollinger Bands for ${result.length} periods`);
|
|
11619
11618
|
return result;
|
|
11620
11619
|
}
|
|
11621
11620
|
/**
|
|
@@ -11678,7 +11677,6 @@ function calculateEMA(priceData, { period = 20, period2 = 9 } = {}) {
|
|
|
11678
11677
|
}
|
|
11679
11678
|
result.push(entry);
|
|
11680
11679
|
}
|
|
11681
|
-
// logIfDebug(`Calculated EMA for ${result.length} periods`);
|
|
11682
11680
|
return result;
|
|
11683
11681
|
}
|
|
11684
11682
|
/**
|
|
@@ -11740,7 +11738,6 @@ function calculateFibonacciLevels(priceData, { lookbackPeriod = 20, retracementL
|
|
|
11740
11738
|
close: priceData[i].close,
|
|
11741
11739
|
});
|
|
11742
11740
|
}
|
|
11743
|
-
// logIfDebug(`Calculated Fibonacci levels for ${result.length} periods`);
|
|
11744
11741
|
return result;
|
|
11745
11742
|
}
|
|
11746
11743
|
/**
|
|
@@ -11788,7 +11785,6 @@ function calculateMACD(priceData, { shortPeriod = 12, longPeriod = 26, signalPer
|
|
|
11788
11785
|
close: emaLong[i].close,
|
|
11789
11786
|
});
|
|
11790
11787
|
}
|
|
11791
|
-
// logIfDebug(`Calculated MACD for ${result.length} periods`);
|
|
11792
11788
|
return result;
|
|
11793
11789
|
}
|
|
11794
11790
|
/**
|
|
@@ -11844,7 +11840,6 @@ function calculateRSI(priceData, { period = 14 } = {}) {
|
|
|
11844
11840
|
close: priceData[i].close,
|
|
11845
11841
|
});
|
|
11846
11842
|
}
|
|
11847
|
-
// logIfDebug(`Calculated RSI for ${result.length} periods`);
|
|
11848
11843
|
return result;
|
|
11849
11844
|
}
|
|
11850
11845
|
/**
|
|
@@ -11897,7 +11892,6 @@ function calculateStochasticOscillator(priceData, { lookbackPeriod = 5, signalPe
|
|
|
11897
11892
|
});
|
|
11898
11893
|
}
|
|
11899
11894
|
}
|
|
11900
|
-
// logIfDebug(`Calculated Stochastic Oscillator for ${result.length} periods`);
|
|
11901
11895
|
return result;
|
|
11902
11896
|
}
|
|
11903
11897
|
/**
|
|
@@ -13844,17 +13838,17 @@ var hasRequiredBrowser;
|
|
|
13844
13838
|
function requireBrowser () {
|
|
13845
13839
|
if (hasRequiredBrowser) return browser.exports;
|
|
13846
13840
|
hasRequiredBrowser = 1;
|
|
13847
|
-
(function (module, exports
|
|
13841
|
+
(function (module, exports) {
|
|
13848
13842
|
/**
|
|
13849
13843
|
* This is the web browser implementation of `debug()`.
|
|
13850
13844
|
*/
|
|
13851
13845
|
|
|
13852
|
-
exports
|
|
13853
|
-
exports
|
|
13854
|
-
exports
|
|
13855
|
-
exports
|
|
13856
|
-
exports
|
|
13857
|
-
exports
|
|
13846
|
+
exports.formatArgs = formatArgs;
|
|
13847
|
+
exports.save = save;
|
|
13848
|
+
exports.load = load;
|
|
13849
|
+
exports.useColors = useColors;
|
|
13850
|
+
exports.storage = localstorage();
|
|
13851
|
+
exports.destroy = (() => {
|
|
13858
13852
|
let warned = false;
|
|
13859
13853
|
|
|
13860
13854
|
return () => {
|
|
@@ -13869,7 +13863,7 @@ function requireBrowser () {
|
|
|
13869
13863
|
* Colors.
|
|
13870
13864
|
*/
|
|
13871
13865
|
|
|
13872
|
-
exports
|
|
13866
|
+
exports.colors = [
|
|
13873
13867
|
'#0000CC',
|
|
13874
13868
|
'#0000FF',
|
|
13875
13869
|
'#0033CC',
|
|
@@ -14034,7 +14028,7 @@ function requireBrowser () {
|
|
|
14034
14028
|
*
|
|
14035
14029
|
* @api public
|
|
14036
14030
|
*/
|
|
14037
|
-
exports
|
|
14031
|
+
exports.log = console.debug || console.log || (() => {});
|
|
14038
14032
|
|
|
14039
14033
|
/**
|
|
14040
14034
|
* Save `namespaces`.
|
|
@@ -14045,9 +14039,9 @@ function requireBrowser () {
|
|
|
14045
14039
|
function save(namespaces) {
|
|
14046
14040
|
try {
|
|
14047
14041
|
if (namespaces) {
|
|
14048
|
-
exports
|
|
14042
|
+
exports.storage.setItem('debug', namespaces);
|
|
14049
14043
|
} else {
|
|
14050
|
-
exports
|
|
14044
|
+
exports.storage.removeItem('debug');
|
|
14051
14045
|
}
|
|
14052
14046
|
} catch (error) {
|
|
14053
14047
|
// Swallow
|
|
@@ -14064,7 +14058,7 @@ function requireBrowser () {
|
|
|
14064
14058
|
function load() {
|
|
14065
14059
|
let r;
|
|
14066
14060
|
try {
|
|
14067
|
-
r = exports
|
|
14061
|
+
r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;
|
|
14068
14062
|
} catch (error) {
|
|
14069
14063
|
// Swallow
|
|
14070
14064
|
// XXX (@Qix-) should we be logging these?
|
|
@@ -14100,7 +14094,7 @@ function requireBrowser () {
|
|
|
14100
14094
|
}
|
|
14101
14095
|
}
|
|
14102
14096
|
|
|
14103
|
-
module.exports = requireCommon()(exports
|
|
14097
|
+
module.exports = requireCommon()(exports);
|
|
14104
14098
|
|
|
14105
14099
|
const {formatters} = module.exports;
|
|
14106
14100
|
|
|
@@ -14289,7 +14283,7 @@ var hasRequiredNode$1;
|
|
|
14289
14283
|
function requireNode$1 () {
|
|
14290
14284
|
if (hasRequiredNode$1) return node$1.exports;
|
|
14291
14285
|
hasRequiredNode$1 = 1;
|
|
14292
|
-
(function (module, exports
|
|
14286
|
+
(function (module, exports) {
|
|
14293
14287
|
const tty = require$$1$1;
|
|
14294
14288
|
const util = require$$1$2;
|
|
14295
14289
|
|
|
@@ -14297,13 +14291,13 @@ function requireNode$1 () {
|
|
|
14297
14291
|
* This is the Node.js implementation of `debug()`.
|
|
14298
14292
|
*/
|
|
14299
14293
|
|
|
14300
|
-
exports
|
|
14301
|
-
exports
|
|
14302
|
-
exports
|
|
14303
|
-
exports
|
|
14304
|
-
exports
|
|
14305
|
-
exports
|
|
14306
|
-
exports
|
|
14294
|
+
exports.init = init;
|
|
14295
|
+
exports.log = log;
|
|
14296
|
+
exports.formatArgs = formatArgs;
|
|
14297
|
+
exports.save = save;
|
|
14298
|
+
exports.load = load;
|
|
14299
|
+
exports.useColors = useColors;
|
|
14300
|
+
exports.destroy = util.deprecate(
|
|
14307
14301
|
() => {},
|
|
14308
14302
|
'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
|
|
14309
14303
|
);
|
|
@@ -14312,7 +14306,7 @@ function requireNode$1 () {
|
|
|
14312
14306
|
* Colors.
|
|
14313
14307
|
*/
|
|
14314
14308
|
|
|
14315
|
-
exports
|
|
14309
|
+
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
14316
14310
|
|
|
14317
14311
|
try {
|
|
14318
14312
|
// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
|
|
@@ -14320,7 +14314,7 @@ function requireNode$1 () {
|
|
|
14320
14314
|
const supportsColor = requireSupportsColor();
|
|
14321
14315
|
|
|
14322
14316
|
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
14323
|
-
exports
|
|
14317
|
+
exports.colors = [
|
|
14324
14318
|
20,
|
|
14325
14319
|
21,
|
|
14326
14320
|
26,
|
|
@@ -14409,7 +14403,7 @@ function requireNode$1 () {
|
|
|
14409
14403
|
* $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
|
|
14410
14404
|
*/
|
|
14411
14405
|
|
|
14412
|
-
exports
|
|
14406
|
+
exports.inspectOpts = Object.keys(process.env).filter(key => {
|
|
14413
14407
|
return /^debug_/i.test(key);
|
|
14414
14408
|
}).reduce((obj, key) => {
|
|
14415
14409
|
// Camel-case
|
|
@@ -14441,8 +14435,8 @@ function requireNode$1 () {
|
|
|
14441
14435
|
*/
|
|
14442
14436
|
|
|
14443
14437
|
function useColors() {
|
|
14444
|
-
return 'colors' in exports
|
|
14445
|
-
Boolean(exports
|
|
14438
|
+
return 'colors' in exports.inspectOpts ?
|
|
14439
|
+
Boolean(exports.inspectOpts.colors) :
|
|
14446
14440
|
tty.isatty(process.stderr.fd);
|
|
14447
14441
|
}
|
|
14448
14442
|
|
|
@@ -14468,7 +14462,7 @@ function requireNode$1 () {
|
|
|
14468
14462
|
}
|
|
14469
14463
|
|
|
14470
14464
|
function getDate() {
|
|
14471
|
-
if (exports
|
|
14465
|
+
if (exports.inspectOpts.hideDate) {
|
|
14472
14466
|
return '';
|
|
14473
14467
|
}
|
|
14474
14468
|
return new Date().toISOString() + ' ';
|
|
@@ -14479,7 +14473,7 @@ function requireNode$1 () {
|
|
|
14479
14473
|
*/
|
|
14480
14474
|
|
|
14481
14475
|
function log(...args) {
|
|
14482
|
-
return process.stderr.write(util.formatWithOptions(exports
|
|
14476
|
+
return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
|
|
14483
14477
|
}
|
|
14484
14478
|
|
|
14485
14479
|
/**
|
|
@@ -14519,13 +14513,13 @@ function requireNode$1 () {
|
|
|
14519
14513
|
function init(debug) {
|
|
14520
14514
|
debug.inspectOpts = {};
|
|
14521
14515
|
|
|
14522
|
-
const keys = Object.keys(exports
|
|
14516
|
+
const keys = Object.keys(exports.inspectOpts);
|
|
14523
14517
|
for (let i = 0; i < keys.length; i++) {
|
|
14524
|
-
debug.inspectOpts[keys[i]] = exports
|
|
14518
|
+
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
14525
14519
|
}
|
|
14526
14520
|
}
|
|
14527
14521
|
|
|
14528
|
-
module.exports = requireCommon()(exports
|
|
14522
|
+
module.exports = requireCommon()(exports);
|
|
14529
14523
|
|
|
14530
14524
|
const {formatters} = module.exports;
|
|
14531
14525
|
|
|
@@ -15099,7 +15093,7 @@ function requireFollowRedirects () {
|
|
|
15099
15093
|
// Wraps the key/value object of protocols with redirect functionality
|
|
15100
15094
|
function wrap(protocols) {
|
|
15101
15095
|
// Default settings
|
|
15102
|
-
var exports
|
|
15096
|
+
var exports = {
|
|
15103
15097
|
maxRedirects: 21,
|
|
15104
15098
|
maxBodyLength: 10 * 1024 * 1024,
|
|
15105
15099
|
};
|
|
@@ -15109,7 +15103,7 @@ function requireFollowRedirects () {
|
|
|
15109
15103
|
Object.keys(protocols).forEach(function (scheme) {
|
|
15110
15104
|
var protocol = scheme + ":";
|
|
15111
15105
|
var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
|
|
15112
|
-
var wrappedProtocol = exports
|
|
15106
|
+
var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol);
|
|
15113
15107
|
|
|
15114
15108
|
// Executes a request, following redirects
|
|
15115
15109
|
function request(input, options, callback) {
|
|
@@ -15132,8 +15126,8 @@ function requireFollowRedirects () {
|
|
|
15132
15126
|
|
|
15133
15127
|
// Set defaults
|
|
15134
15128
|
options = Object.assign({
|
|
15135
|
-
maxRedirects: exports
|
|
15136
|
-
maxBodyLength: exports
|
|
15129
|
+
maxRedirects: exports.maxRedirects,
|
|
15130
|
+
maxBodyLength: exports.maxBodyLength,
|
|
15137
15131
|
}, input, options);
|
|
15138
15132
|
options.nativeProtocols = nativeProtocols;
|
|
15139
15133
|
if (!isString(options.host) && !isString(options.hostname)) {
|
|
@@ -15158,7 +15152,7 @@ function requireFollowRedirects () {
|
|
|
15158
15152
|
get: { value: get, configurable: true, enumerable: true, writable: true },
|
|
15159
15153
|
});
|
|
15160
15154
|
});
|
|
15161
|
-
return exports
|
|
15155
|
+
return exports;
|
|
15162
15156
|
}
|
|
15163
15157
|
|
|
15164
15158
|
function noop() { /* empty */ }
|
|
@@ -16764,7 +16758,7 @@ var hasRequiredLodash;
|
|
|
16764
16758
|
function requireLodash () {
|
|
16765
16759
|
if (hasRequiredLodash) return lodash$1.exports;
|
|
16766
16760
|
hasRequiredLodash = 1;
|
|
16767
|
-
(function (module, exports
|
|
16761
|
+
(function (module, exports) {
|
|
16768
16762
|
(function() {
|
|
16769
16763
|
|
|
16770
16764
|
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
|
|
@@ -17195,7 +17189,7 @@ function requireLodash () {
|
|
|
17195
17189
|
var root = freeGlobal || freeSelf || Function('return this')();
|
|
17196
17190
|
|
|
17197
17191
|
/** Detect free variable `exports`. */
|
|
17198
|
-
var freeExports = exports
|
|
17192
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
17199
17193
|
|
|
17200
17194
|
/** Detect free variable `module`. */
|
|
17201
17195
|
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
@@ -35025,12 +35019,12 @@ var hasRequiredIsBuffer;
|
|
|
35025
35019
|
function requireIsBuffer () {
|
|
35026
35020
|
if (hasRequiredIsBuffer) return isBuffer.exports;
|
|
35027
35021
|
hasRequiredIsBuffer = 1;
|
|
35028
|
-
(function (module, exports
|
|
35022
|
+
(function (module, exports) {
|
|
35029
35023
|
var root = require_root(),
|
|
35030
35024
|
stubFalse = requireStubFalse();
|
|
35031
35025
|
|
|
35032
35026
|
/** Detect free variable `exports`. */
|
|
35033
|
-
var freeExports = exports
|
|
35027
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
35034
35028
|
|
|
35035
35029
|
/** Detect free variable `module`. */
|
|
35036
35030
|
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
@@ -35250,11 +35244,11 @@ var hasRequired_nodeUtil;
|
|
|
35250
35244
|
function require_nodeUtil () {
|
|
35251
35245
|
if (hasRequired_nodeUtil) return _nodeUtil.exports;
|
|
35252
35246
|
hasRequired_nodeUtil = 1;
|
|
35253
|
-
(function (module, exports
|
|
35247
|
+
(function (module, exports) {
|
|
35254
35248
|
var freeGlobal = require_freeGlobal();
|
|
35255
35249
|
|
|
35256
35250
|
/** Detect free variable `exports`. */
|
|
35257
|
-
var freeExports = exports
|
|
35251
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
35258
35252
|
|
|
35259
35253
|
/** Detect free variable `module`. */
|
|
35260
35254
|
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
@@ -44176,7 +44170,7 @@ var hasRequiredSafeBuffer;
|
|
|
44176
44170
|
function requireSafeBuffer () {
|
|
44177
44171
|
if (hasRequiredSafeBuffer) return safeBuffer.exports;
|
|
44178
44172
|
hasRequiredSafeBuffer = 1;
|
|
44179
|
-
(function (module, exports
|
|
44173
|
+
(function (module, exports) {
|
|
44180
44174
|
/* eslint-disable node/no-deprecated-api */
|
|
44181
44175
|
var buffer = require$$0$5;
|
|
44182
44176
|
var Buffer = buffer.Buffer;
|
|
@@ -44191,8 +44185,8 @@ function requireSafeBuffer () {
|
|
|
44191
44185
|
module.exports = buffer;
|
|
44192
44186
|
} else {
|
|
44193
44187
|
// Copy properties from require('buffer')
|
|
44194
|
-
copyProps(buffer, exports
|
|
44195
|
-
exports
|
|
44188
|
+
copyProps(buffer, exports);
|
|
44189
|
+
exports.Buffer = SafeBuffer;
|
|
44196
44190
|
}
|
|
44197
44191
|
|
|
44198
44192
|
function SafeBuffer (arg, encodingOrOffset, length) {
|
|
@@ -47390,22 +47384,22 @@ var hasRequiredReadable;
|
|
|
47390
47384
|
function requireReadable () {
|
|
47391
47385
|
if (hasRequiredReadable) return readable.exports;
|
|
47392
47386
|
hasRequiredReadable = 1;
|
|
47393
|
-
(function (module, exports
|
|
47387
|
+
(function (module, exports) {
|
|
47394
47388
|
var Stream = require$$0$3;
|
|
47395
47389
|
if (process.env.READABLE_STREAM === 'disable' && Stream) {
|
|
47396
47390
|
module.exports = Stream.Readable;
|
|
47397
47391
|
Object.assign(module.exports, Stream);
|
|
47398
47392
|
module.exports.Stream = Stream;
|
|
47399
47393
|
} else {
|
|
47400
|
-
exports
|
|
47401
|
-
exports
|
|
47402
|
-
exports
|
|
47403
|
-
exports
|
|
47404
|
-
exports
|
|
47405
|
-
exports
|
|
47406
|
-
exports
|
|
47407
|
-
exports
|
|
47408
|
-
exports
|
|
47394
|
+
exports = module.exports = require_stream_readable();
|
|
47395
|
+
exports.Stream = Stream || exports;
|
|
47396
|
+
exports.Readable = exports;
|
|
47397
|
+
exports.Writable = require_stream_writable();
|
|
47398
|
+
exports.Duplex = require_stream_duplex();
|
|
47399
|
+
exports.Transform = require_stream_transform();
|
|
47400
|
+
exports.PassThrough = require_stream_passthrough();
|
|
47401
|
+
exports.finished = requireEndOfStream();
|
|
47402
|
+
exports.pipeline = requirePipeline();
|
|
47409
47403
|
}
|
|
47410
47404
|
} (readable, readable.exports));
|
|
47411
47405
|
return readable.exports;
|
|
@@ -48840,12 +48834,12 @@ var hasRequiredWebsocket;
|
|
|
48840
48834
|
function requireWebsocket () {
|
|
48841
48835
|
if (hasRequiredWebsocket) return websocket$1;
|
|
48842
48836
|
hasRequiredWebsocket = 1;
|
|
48843
|
-
(function (exports
|
|
48837
|
+
(function (exports) {
|
|
48844
48838
|
var __importDefault = (websocket$1 && websocket$1.__importDefault) || function (mod) {
|
|
48845
48839
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
48846
48840
|
};
|
|
48847
|
-
Object.defineProperty(exports
|
|
48848
|
-
exports
|
|
48841
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48842
|
+
exports.AlpacaWebsocket = exports.ERROR = exports.CONN_ERROR = exports.EVENT = exports.STATE = void 0;
|
|
48849
48843
|
const events_1 = __importDefault(require$$0$4);
|
|
48850
48844
|
const ws_1 = __importDefault(requireWs());
|
|
48851
48845
|
const msgpack5_1 = __importDefault(requireMsgpack5());
|
|
@@ -48859,7 +48853,7 @@ function requireWebsocket () {
|
|
|
48859
48853
|
STATE["DISCONNECTED"] = "disconnected";
|
|
48860
48854
|
STATE["WAITING_TO_CONNECT"] = "waiting to connect";
|
|
48861
48855
|
STATE["WAITING_TO_RECONNECT"] = "waiting to reconnect";
|
|
48862
|
-
})(STATE || (exports
|
|
48856
|
+
})(STATE || (exports.STATE = STATE = {}));
|
|
48863
48857
|
// Client events
|
|
48864
48858
|
var EVENT;
|
|
48865
48859
|
(function (EVENT) {
|
|
@@ -48878,9 +48872,9 @@ function requireWebsocket () {
|
|
|
48878
48872
|
EVENT["CORRECTIONS"] = "corrections";
|
|
48879
48873
|
EVENT["ORDERBOOKS"] = "orderbooks";
|
|
48880
48874
|
EVENT["NEWS"] = "news";
|
|
48881
|
-
})(EVENT || (exports
|
|
48875
|
+
})(EVENT || (exports.EVENT = EVENT = {}));
|
|
48882
48876
|
// Connection errors by code
|
|
48883
|
-
exports
|
|
48877
|
+
exports.CONN_ERROR = new Map([
|
|
48884
48878
|
[400, "invalid syntax"],
|
|
48885
48879
|
[401, "not authenticated"],
|
|
48886
48880
|
[402, "auth failed"],
|
|
@@ -48899,7 +48893,7 @@ function requireWebsocket () {
|
|
|
48899
48893
|
ERROR["MISSING_SECERT_KEY"] = "missing secret key";
|
|
48900
48894
|
ERROR["MISSING_API_KEY"] = "missing api key";
|
|
48901
48895
|
ERROR["UNEXPECTED_MESSAGE"] = "unexpected message";
|
|
48902
|
-
})(ERROR || (exports
|
|
48896
|
+
})(ERROR || (exports.ERROR = ERROR = {}));
|
|
48903
48897
|
class AlpacaWebsocket extends events_1.default.EventEmitter {
|
|
48904
48898
|
constructor(options) {
|
|
48905
48899
|
super();
|
|
@@ -49056,7 +49050,7 @@ function requireWebsocket () {
|
|
|
49056
49050
|
this.updateSubscriptions(data[0]);
|
|
49057
49051
|
break;
|
|
49058
49052
|
case "error":
|
|
49059
|
-
this.emit(EVENT.CLIENT_ERROR, exports
|
|
49053
|
+
this.emit(EVENT.CLIENT_ERROR, exports.CONN_ERROR.get(data[0].code));
|
|
49060
49054
|
break;
|
|
49061
49055
|
default:
|
|
49062
49056
|
this.dataHandler(data);
|
|
@@ -49085,7 +49079,7 @@ function requireWebsocket () {
|
|
|
49085
49079
|
}
|
|
49086
49080
|
}
|
|
49087
49081
|
}
|
|
49088
|
-
exports
|
|
49082
|
+
exports.AlpacaWebsocket = AlpacaWebsocket;
|
|
49089
49083
|
} (websocket$1));
|
|
49090
49084
|
return websocket$1;
|
|
49091
49085
|
}
|
|
@@ -49719,8 +49713,8 @@ var hasRequiredWebsockets;
|
|
|
49719
49713
|
function requireWebsockets () {
|
|
49720
49714
|
if (hasRequiredWebsockets) return websockets;
|
|
49721
49715
|
hasRequiredWebsockets = 1;
|
|
49722
|
-
(function (exports
|
|
49723
|
-
Object.defineProperty(exports
|
|
49716
|
+
(function (exports) {
|
|
49717
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49724
49718
|
const events = require$$0$4;
|
|
49725
49719
|
const WebSocket = requireWs();
|
|
49726
49720
|
const entity = requireEntity();
|
|
@@ -49735,7 +49729,7 @@ function requireWebsockets () {
|
|
|
49735
49729
|
STATE.DISCONNECTED = "disconnected";
|
|
49736
49730
|
STATE.WAITING_TO_CONNECT = "waiting to connect";
|
|
49737
49731
|
STATE.WAITING_TO_RECONNECT = "waiting to reconnect";
|
|
49738
|
-
})((STATE = exports
|
|
49732
|
+
})((STATE = exports.STATE || (exports.STATE = {})));
|
|
49739
49733
|
// Client events
|
|
49740
49734
|
var EVENT;
|
|
49741
49735
|
(function (EVENT) {
|
|
@@ -49749,7 +49743,7 @@ function requireWebsockets () {
|
|
|
49749
49743
|
EVENT.STOCK_QUOTES = "stock_quotes";
|
|
49750
49744
|
EVENT.STOCK_AGG_SEC = "stock_agg_sec";
|
|
49751
49745
|
EVENT.STOCK_AGG_MIN = "stock_agg_min";
|
|
49752
|
-
})((EVENT = exports
|
|
49746
|
+
})((EVENT = exports.EVENT || (exports.EVENT = {})));
|
|
49753
49747
|
// Connection errors Each of these will also emit EVENT.ERROR
|
|
49754
49748
|
var ERROR;
|
|
49755
49749
|
(function (ERROR) {
|
|
@@ -49758,7 +49752,7 @@ function requireWebsockets () {
|
|
|
49758
49752
|
ERROR.MISSING_API_KEY = "missing api key";
|
|
49759
49753
|
ERROR.MISSING_SECRET_KEY = "missing secret key";
|
|
49760
49754
|
ERROR.UNKNOWN = "unknown error";
|
|
49761
|
-
})((ERROR = exports
|
|
49755
|
+
})((ERROR = exports.ERROR || (exports.ERROR = {})));
|
|
49762
49756
|
/**
|
|
49763
49757
|
* AlpacaStreamClient manages a connection to Alpaca's websocket api
|
|
49764
49758
|
*/
|
|
@@ -50071,7 +50065,7 @@ function requireWebsockets () {
|
|
|
50071
50065
|
}
|
|
50072
50066
|
}
|
|
50073
50067
|
}
|
|
50074
|
-
exports
|
|
50068
|
+
exports.AlpacaStreamClient = AlpacaStreamClient;
|
|
50075
50069
|
} (websockets));
|
|
50076
50070
|
return websockets;
|
|
50077
50071
|
}
|
|
@@ -50323,13 +50317,13 @@ var hasRequiredDist;
|
|
|
50323
50317
|
function requireDist () {
|
|
50324
50318
|
if (hasRequiredDist) return dist$1.exports;
|
|
50325
50319
|
hasRequiredDist = 1;
|
|
50326
|
-
(function (module, exports
|
|
50320
|
+
(function (module, exports) {
|
|
50327
50321
|
var __importDefault = (dist && dist.__importDefault) || function (mod) {
|
|
50328
50322
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
50329
50323
|
};
|
|
50330
|
-
Object.defineProperty(exports
|
|
50324
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50331
50325
|
const alpaca_trade_api_1 = __importDefault(requireAlpacaTradeApi());
|
|
50332
|
-
exports
|
|
50326
|
+
exports.default = alpaca_trade_api_1.default;
|
|
50333
50327
|
module.exports = alpaca_trade_api_1.default;
|
|
50334
50328
|
} (dist$1, dist$1.exports));
|
|
50335
50329
|
return dist$1.exports;
|