@tradejs/node 1.0.0

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.
@@ -0,0 +1,468 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/connectors.ts
31
+ var connectors_exports = {};
32
+ __export(connectors_exports, {
33
+ BUILTIN_CONNECTOR_NAMES: () => BUILTIN_CONNECTOR_NAMES,
34
+ DEFAULT_CONNECTOR_NAME: () => DEFAULT_CONNECTOR_NAME,
35
+ ensureConnectorPluginsLoaded: () => ensureConnectorPluginsLoaded,
36
+ getAvailableConnectorNames: () => getAvailableConnectorNames,
37
+ getAvailableConnectorProviders: () => getAvailableConnectorProviders,
38
+ getConnectorCreatorByName: () => getConnectorCreatorByName,
39
+ getConnectorCreatorByProvider: () => getConnectorCreatorByProvider,
40
+ getConnectorNameByProvider: () => getConnectorNameByProvider,
41
+ registerConnectorEntries: () => registerConnectorEntries,
42
+ resetConnectorRegistryCache: () => resetConnectorRegistryCache,
43
+ resolveConnectorName: () => resolveConnectorName
44
+ });
45
+ module.exports = __toCommonJS(connectors_exports);
46
+
47
+ // src/connectorsRegistry.ts
48
+ var import_logger2 = require("@tradejs/infra/logger");
49
+
50
+ // src/tradejsConfig.ts
51
+ var import_fs = __toESM(require("fs"));
52
+ var import_path = __toESM(require("path"));
53
+ var import_module = require("module");
54
+ var import_url = require("url");
55
+ var import_logger = require("@tradejs/infra/logger");
56
+ var CONFIG_FILE_NAMES = [
57
+ "tradejs.config.ts",
58
+ "tradejs.config.mts",
59
+ "tradejs.config.js",
60
+ "tradejs.config.mjs",
61
+ "tradejs.config.cjs"
62
+ ];
63
+ var TS_MODULE_RE = /\.(cts|mts|ts)$/i;
64
+ var cachedByCwd = /* @__PURE__ */ new Map();
65
+ var announcedConfigFile = /* @__PURE__ */ new Set();
66
+ var tsNodeRegistered = false;
67
+ var getTradejsProjectCwd = (cwd) => {
68
+ const explicit = String(cwd ?? "").trim();
69
+ if (explicit) {
70
+ return import_path.default.resolve(explicit);
71
+ }
72
+ const fromEnv = String(process.env.PROJECT_CWD || "").trim();
73
+ if (fromEnv) {
74
+ return import_path.default.resolve(fromEnv);
75
+ }
76
+ return process.cwd();
77
+ };
78
+ var normalizeConfig = (rawConfig) => {
79
+ if (!rawConfig || typeof rawConfig !== "object") {
80
+ return {};
81
+ }
82
+ const config = rawConfig;
83
+ const strategies = Array.isArray(config.strategies) ? config.strategies.map((value) => String(value || "").trim()).filter(Boolean) : [];
84
+ const indicators = Array.isArray(config.indicators) ? config.indicators.map((value) => String(value || "").trim()).filter(Boolean) : [];
85
+ const connectors = Array.isArray(config.connectors) ? config.connectors.map((value) => String(value || "").trim()).filter(Boolean) : [];
86
+ return {
87
+ strategies,
88
+ indicators,
89
+ connectors
90
+ };
91
+ };
92
+ var getRequireFn = (cwd = getTradejsProjectCwd()) => (0, import_module.createRequire)(import_path.default.join(import_path.default.resolve(cwd), "__tradejs_loader__.js"));
93
+ var ensureTsNodeRegistered = async () => {
94
+ if (tsNodeRegistered) {
95
+ return;
96
+ }
97
+ const tsNodeModule = await import("ts-node");
98
+ const tsNode = tsNodeModule.default ?? tsNodeModule;
99
+ tsNode.register?.({
100
+ transpileOnly: true,
101
+ compilerOptions: {
102
+ module: "commonjs",
103
+ moduleResolution: "node"
104
+ }
105
+ });
106
+ tsNodeRegistered = true;
107
+ };
108
+ var toImportSpecifier = (moduleName) => {
109
+ if (moduleName.startsWith("file://")) {
110
+ return moduleName;
111
+ }
112
+ if (import_path.default.isAbsolute(moduleName)) {
113
+ return (0, import_url.pathToFileURL)(moduleName).href;
114
+ }
115
+ return moduleName;
116
+ };
117
+ var isTsModulePath = (moduleName) => TS_MODULE_RE.test(moduleName.split("?")[0]);
118
+ var isRelativeModulePath = (moduleName) => moduleName.startsWith("./") || moduleName.startsWith("../");
119
+ var isBareModuleSpecifier = (moduleName) => {
120
+ const normalized = String(moduleName ?? "").trim();
121
+ if (!normalized) {
122
+ return false;
123
+ }
124
+ if (normalized.startsWith("file://") || import_path.default.isAbsolute(normalized) || isRelativeModulePath(normalized)) {
125
+ return false;
126
+ }
127
+ return true;
128
+ };
129
+ var importConfigFile = async (configFilePath) => {
130
+ const ext = import_path.default.extname(configFilePath).toLowerCase();
131
+ const configFileUrl = `${toImportSpecifier(configFilePath)}?t=${Date.now()}`;
132
+ if (ext === ".ts" || ext === ".mts") {
133
+ const requireFn = getRequireFn(import_path.default.dirname(configFilePath));
134
+ await ensureTsNodeRegistered();
135
+ return requireFn(configFilePath);
136
+ }
137
+ return import(
138
+ /* webpackIgnore: true */
139
+ configFileUrl
140
+ );
141
+ };
142
+ var importTradejsModule = async (moduleName) => {
143
+ const normalized = String(moduleName ?? "").trim();
144
+ if (!normalized) {
145
+ return {};
146
+ }
147
+ let modulePath = normalized;
148
+ if (normalized.startsWith("file://")) {
149
+ try {
150
+ modulePath = (0, import_url.fileURLToPath)(normalized);
151
+ } catch {
152
+ modulePath = normalized;
153
+ }
154
+ }
155
+ const requireFn = getRequireFn(
156
+ import_path.default.isAbsolute(modulePath) ? import_path.default.dirname(modulePath) : getTradejsProjectCwd()
157
+ );
158
+ if (isTsModulePath(modulePath)) {
159
+ await ensureTsNodeRegistered();
160
+ return requireFn(modulePath);
161
+ }
162
+ if (isBareModuleSpecifier(normalized)) {
163
+ return requireFn(normalized);
164
+ }
165
+ try {
166
+ return await import(
167
+ /* webpackIgnore: true */
168
+ toImportSpecifier(normalized)
169
+ );
170
+ } catch (error) {
171
+ if (isTsModulePath(modulePath)) {
172
+ await ensureTsNodeRegistered();
173
+ return requireFn(modulePath);
174
+ }
175
+ throw error;
176
+ }
177
+ };
178
+ var resolveExportedConfig = (moduleExports) => {
179
+ const candidate = moduleExports && typeof moduleExports === "object" && "default" in moduleExports ? moduleExports.default : moduleExports;
180
+ return normalizeConfig(candidate);
181
+ };
182
+ var findConfigFilePath = (cwd) => {
183
+ let currentDir = import_path.default.resolve(cwd);
184
+ while (true) {
185
+ for (const fileName of CONFIG_FILE_NAMES) {
186
+ const fullPath = import_path.default.join(currentDir, fileName);
187
+ if (import_fs.default.existsSync(fullPath) && import_fs.default.statSync(fullPath).isFile()) {
188
+ return fullPath;
189
+ }
190
+ }
191
+ const parentDir = import_path.default.dirname(currentDir);
192
+ if (parentDir === currentDir) {
193
+ return null;
194
+ }
195
+ currentDir = parentDir;
196
+ }
197
+ };
198
+ var resolvePluginModuleSpecifier = (moduleName, cwd = getTradejsProjectCwd()) => {
199
+ const normalized = String(moduleName ?? "").trim();
200
+ if (!normalized) {
201
+ return "";
202
+ }
203
+ if (normalized.startsWith("file://")) {
204
+ try {
205
+ return (0, import_url.fileURLToPath)(normalized);
206
+ } catch {
207
+ return normalized;
208
+ }
209
+ }
210
+ if (import_path.default.isAbsolute(normalized)) {
211
+ return normalized;
212
+ }
213
+ if (isRelativeModulePath(normalized)) {
214
+ return import_path.default.resolve(cwd, normalized);
215
+ }
216
+ return normalized;
217
+ };
218
+ var loadTradejsConfig = async (cwd = getTradejsProjectCwd()) => {
219
+ const cached = cachedByCwd.get(cwd);
220
+ if (cached) {
221
+ return cached;
222
+ }
223
+ const configFilePath = findConfigFilePath(cwd);
224
+ if (!configFilePath) {
225
+ cachedByCwd.set(cwd, {});
226
+ return {};
227
+ }
228
+ try {
229
+ const moduleExports = await importConfigFile(configFilePath);
230
+ const config = resolveExportedConfig(moduleExports);
231
+ cachedByCwd.set(cwd, config);
232
+ if (!announcedConfigFile.has(configFilePath)) {
233
+ announcedConfigFile.add(configFilePath);
234
+ import_logger.logger.log("info", "Loaded TradeJS config: %s", configFilePath);
235
+ }
236
+ return config;
237
+ } catch (error) {
238
+ import_logger.logger.log(
239
+ "warn",
240
+ "Failed to load TradeJS config from %s: %s",
241
+ configFilePath,
242
+ String(error)
243
+ );
244
+ cachedByCwd.set(cwd, {});
245
+ return {};
246
+ }
247
+ };
248
+
249
+ // src/connectorsRegistry.ts
250
+ var connectorCreators = /* @__PURE__ */ new Map();
251
+ var providerToConnectorName = /* @__PURE__ */ new Map();
252
+ var pluginsLoadPromise = null;
253
+ var BUILTIN_CONNECTOR_NAMES = {
254
+ ByBit: "ByBit",
255
+ Binance: "Binance",
256
+ Coinbase: "Coinbase",
257
+ Test: "Test"
258
+ };
259
+ var normalizeProvider = (value) => String(value ?? "").trim().toLowerCase();
260
+ var toUniqueModules = (modules = []) => [
261
+ ...new Set(modules.map((moduleName) => moduleName.trim()).filter(Boolean))
262
+ ];
263
+ var findConnectorNameInsensitive = (name) => {
264
+ const normalized = name.trim().toLowerCase();
265
+ if (!normalized) {
266
+ return null;
267
+ }
268
+ for (const existingName of connectorCreators.keys()) {
269
+ if (existingName.toLowerCase() === normalized) {
270
+ return existingName;
271
+ }
272
+ }
273
+ return null;
274
+ };
275
+ var normalizeProviders = (providers, connectorName) => {
276
+ const list = Array.isArray(providers) ? providers.map((item) => normalizeProvider(item)).filter(Boolean) : [];
277
+ const deduped = [...new Set(list)];
278
+ if (deduped.length) {
279
+ return deduped;
280
+ }
281
+ return [normalizeProvider(connectorName)];
282
+ };
283
+ var registerProvider = (provider, connectorName, source) => {
284
+ const existing = providerToConnectorName.get(provider);
285
+ if (existing && existing !== connectorName) {
286
+ import_logger2.logger.warn(
287
+ 'Skip duplicate connector provider "%s" from %s: already mapped to %s',
288
+ provider,
289
+ source,
290
+ existing
291
+ );
292
+ return;
293
+ }
294
+ providerToConnectorName.set(provider, connectorName);
295
+ };
296
+ var registerEntry = (entry, source) => {
297
+ const connectorName = String(entry?.name ?? "").trim();
298
+ if (!connectorName) {
299
+ import_logger2.logger.warn("Skip connector entry without name from %s", source);
300
+ return;
301
+ }
302
+ if (typeof entry.creator !== "function") {
303
+ import_logger2.logger.warn(
304
+ 'Skip connector entry "%s" from %s: creator must be a function',
305
+ connectorName,
306
+ source
307
+ );
308
+ return;
309
+ }
310
+ const existingByName = findConnectorNameInsensitive(connectorName);
311
+ if (existingByName) {
312
+ import_logger2.logger.warn(
313
+ 'Skip duplicate connector "%s" from %s: already registered as %s',
314
+ connectorName,
315
+ source,
316
+ existingByName
317
+ );
318
+ return;
319
+ }
320
+ connectorCreators.set(connectorName, entry.creator);
321
+ const providers = normalizeProviders(entry.providers, connectorName);
322
+ for (const provider of providers) {
323
+ registerProvider(provider, connectorName, source);
324
+ }
325
+ };
326
+ var registerEntries = (entries, source) => {
327
+ for (const entry of entries) {
328
+ registerEntry(entry, source);
329
+ }
330
+ };
331
+ var extractConnectorPluginDefinition = (moduleExport) => {
332
+ if (!moduleExport || typeof moduleExport !== "object") {
333
+ return null;
334
+ }
335
+ const candidate = moduleExport;
336
+ if (Array.isArray(candidate.connectorEntries)) {
337
+ return {
338
+ connectorEntries: candidate.connectorEntries
339
+ };
340
+ }
341
+ const defaultExport = candidate.default;
342
+ if (defaultExport && Array.isArray(defaultExport.connectorEntries)) {
343
+ return {
344
+ connectorEntries: defaultExport.connectorEntries
345
+ };
346
+ }
347
+ return null;
348
+ };
349
+ var importConnectorPluginModule = async (moduleName) => {
350
+ if (typeof importTradejsModule === "function") {
351
+ return importTradejsModule(moduleName);
352
+ }
353
+ return import(
354
+ /* webpackIgnore: true */
355
+ moduleName
356
+ );
357
+ };
358
+ var ensureConnectorPluginsLoaded = async () => {
359
+ if (pluginsLoadPromise) {
360
+ return pluginsLoadPromise;
361
+ }
362
+ pluginsLoadPromise = (async () => {
363
+ const config = await loadTradejsConfig();
364
+ const connectorModules = toUniqueModules(config.connectors);
365
+ if (!connectorModules.length) {
366
+ return;
367
+ }
368
+ for (const moduleName of connectorModules) {
369
+ try {
370
+ const resolvedModuleName = resolvePluginModuleSpecifier(moduleName);
371
+ const moduleExport = await importConnectorPluginModule(resolvedModuleName);
372
+ const pluginDefinition = extractConnectorPluginDefinition(moduleExport);
373
+ if (!pluginDefinition) {
374
+ import_logger2.logger.warn(
375
+ 'Skip connector plugin "%s": export { connectorEntries } is missing',
376
+ moduleName
377
+ );
378
+ continue;
379
+ }
380
+ registerEntries(pluginDefinition.connectorEntries, moduleName);
381
+ } catch (error) {
382
+ import_logger2.logger.warn(
383
+ 'Failed to load connector plugin "%s": %s',
384
+ moduleName,
385
+ String(error)
386
+ );
387
+ }
388
+ }
389
+ })();
390
+ return pluginsLoadPromise;
391
+ };
392
+ var getConnectorCreatorByName = async (connectorName) => {
393
+ await ensureConnectorPluginsLoaded();
394
+ const raw = String(connectorName ?? "").trim();
395
+ if (!raw) {
396
+ return void 0;
397
+ }
398
+ const direct = connectorCreators.get(raw);
399
+ if (direct) {
400
+ return direct;
401
+ }
402
+ const existing = findConnectorNameInsensitive(raw);
403
+ if (!existing) {
404
+ return void 0;
405
+ }
406
+ return connectorCreators.get(existing);
407
+ };
408
+ var getConnectorNameByProvider = async (provider) => {
409
+ await ensureConnectorPluginsLoaded();
410
+ const normalized = normalizeProvider(provider);
411
+ if (!normalized) {
412
+ return void 0;
413
+ }
414
+ return providerToConnectorName.get(normalized);
415
+ };
416
+ var getConnectorCreatorByProvider = async (provider) => {
417
+ const connectorName = await getConnectorNameByProvider(provider);
418
+ if (!connectorName) {
419
+ return void 0;
420
+ }
421
+ return connectorCreators.get(connectorName);
422
+ };
423
+ var resolveConnectorName = async (providerOrName) => {
424
+ const raw = String(providerOrName ?? "").trim();
425
+ if (!raw) {
426
+ return void 0;
427
+ }
428
+ const byProvider = await getConnectorNameByProvider(raw);
429
+ if (byProvider) {
430
+ return byProvider;
431
+ }
432
+ const byName = await getConnectorCreatorByName(raw);
433
+ if (!byName) {
434
+ return void 0;
435
+ }
436
+ return findConnectorNameInsensitive(raw) ?? void 0;
437
+ };
438
+ var getAvailableConnectorNames = async () => {
439
+ await ensureConnectorPluginsLoaded();
440
+ return [...connectorCreators.keys()].sort((a, b) => a.localeCompare(b));
441
+ };
442
+ var getAvailableConnectorProviders = async () => {
443
+ await ensureConnectorPluginsLoaded();
444
+ return [...providerToConnectorName.keys()].sort((a, b) => a.localeCompare(b));
445
+ };
446
+ var registerConnectorEntries = (entries) => {
447
+ registerEntries(entries, "runtime");
448
+ };
449
+ var resetConnectorRegistryCache = () => {
450
+ connectorCreators.clear();
451
+ providerToConnectorName.clear();
452
+ pluginsLoadPromise = null;
453
+ };
454
+ var DEFAULT_CONNECTOR_NAME = BUILTIN_CONNECTOR_NAMES.ByBit;
455
+ // Annotate the CommonJS export names for ESM import in node:
456
+ 0 && (module.exports = {
457
+ BUILTIN_CONNECTOR_NAMES,
458
+ DEFAULT_CONNECTOR_NAME,
459
+ ensureConnectorPluginsLoaded,
460
+ getAvailableConnectorNames,
461
+ getAvailableConnectorProviders,
462
+ getConnectorCreatorByName,
463
+ getConnectorCreatorByProvider,
464
+ getConnectorNameByProvider,
465
+ registerConnectorEntries,
466
+ resetConnectorRegistryCache,
467
+ resolveConnectorName
468
+ });
@@ -0,0 +1,28 @@
1
+ import {
2
+ BUILTIN_CONNECTOR_NAMES,
3
+ DEFAULT_CONNECTOR_NAME,
4
+ ensureConnectorPluginsLoaded,
5
+ getAvailableConnectorNames,
6
+ getAvailableConnectorProviders,
7
+ getConnectorCreatorByName,
8
+ getConnectorCreatorByProvider,
9
+ getConnectorNameByProvider,
10
+ registerConnectorEntries,
11
+ resetConnectorRegistryCache,
12
+ resolveConnectorName
13
+ } from "./chunk-E2QNOA5M.mjs";
14
+ import "./chunk-DE7ADBIR.mjs";
15
+ import "./chunk-6DZX6EAA.mjs";
16
+ export {
17
+ BUILTIN_CONNECTOR_NAMES,
18
+ DEFAULT_CONNECTOR_NAME,
19
+ ensureConnectorPluginsLoaded,
20
+ getAvailableConnectorNames,
21
+ getAvailableConnectorProviders,
22
+ getConnectorCreatorByName,
23
+ getConnectorCreatorByProvider,
24
+ getConnectorNameByProvider,
25
+ registerConnectorEntries,
26
+ resetConnectorRegistryCache,
27
+ resolveConnectorName
28
+ };
@@ -0,0 +1,6 @@
1
+ declare const KLINE_CONCURRENCY_LIMIT: number;
2
+ declare const TG_CONCURRENCY_LIMIT = 3;
3
+ declare const AI_CONCURRENCY_LIMIT = 3;
4
+ declare const SCREENSHOT_CONCURRENCY_LIMIT: number;
5
+
6
+ export { AI_CONCURRENCY_LIMIT, KLINE_CONCURRENCY_LIMIT, SCREENSHOT_CONCURRENCY_LIMIT, TG_CONCURRENCY_LIMIT };
@@ -0,0 +1,6 @@
1
+ declare const KLINE_CONCURRENCY_LIMIT: number;
2
+ declare const TG_CONCURRENCY_LIMIT = 3;
3
+ declare const AI_CONCURRENCY_LIMIT = 3;
4
+ declare const SCREENSHOT_CONCURRENCY_LIMIT: number;
5
+
6
+ export { AI_CONCURRENCY_LIMIT, KLINE_CONCURRENCY_LIMIT, SCREENSHOT_CONCURRENCY_LIMIT, TG_CONCURRENCY_LIMIT };
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/constants.ts
21
+ var constants_exports = {};
22
+ __export(constants_exports, {
23
+ AI_CONCURRENCY_LIMIT: () => AI_CONCURRENCY_LIMIT,
24
+ KLINE_CONCURRENCY_LIMIT: () => KLINE_CONCURRENCY_LIMIT,
25
+ SCREENSHOT_CONCURRENCY_LIMIT: () => SCREENSHOT_CONCURRENCY_LIMIT,
26
+ TG_CONCURRENCY_LIMIT: () => TG_CONCURRENCY_LIMIT
27
+ });
28
+ module.exports = __toCommonJS(constants_exports);
29
+ var { NODE_ENV } = process.env;
30
+ var KLINE_CONCURRENCY_LIMIT = NODE_ENV === "production" ? 5 : 10;
31
+ var TG_CONCURRENCY_LIMIT = 3;
32
+ var AI_CONCURRENCY_LIMIT = 3;
33
+ var SCREENSHOT_CONCURRENCY_LIMIT = NODE_ENV === "production" ? 1 : 2;
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ AI_CONCURRENCY_LIMIT,
37
+ KLINE_CONCURRENCY_LIMIT,
38
+ SCREENSHOT_CONCURRENCY_LIMIT,
39
+ TG_CONCURRENCY_LIMIT
40
+ });
@@ -0,0 +1,13 @@
1
+ import {
2
+ AI_CONCURRENCY_LIMIT,
3
+ KLINE_CONCURRENCY_LIMIT,
4
+ SCREENSHOT_CONCURRENCY_LIMIT,
5
+ TG_CONCURRENCY_LIMIT
6
+ } from "./chunk-4ZPGZWO7.mjs";
7
+ import "./chunk-6DZX6EAA.mjs";
8
+ export {
9
+ AI_CONCURRENCY_LIMIT,
10
+ KLINE_CONCURRENCY_LIMIT,
11
+ SCREENSHOT_CONCURRENCY_LIMIT,
12
+ TG_CONCURRENCY_LIMIT
13
+ };
@@ -0,0 +1,8 @@
1
+ import { RunPineScriptParams, PineContextLike } from '@tradejs/core/pine';
2
+ export * from '@tradejs/core/pine';
3
+
4
+ declare const loadPineScript: (filePath: string, fallback?: string) => string;
5
+ declare const createLoadPineScript: (baseDir: string) => ((fileNameOrPath: string, fallback?: string) => string);
6
+ declare const runPineScript: ({ candles, script, symbol, timeframe, inputs, limit, }: RunPineScriptParams) => Promise<PineContextLike>;
7
+
8
+ export { createLoadPineScript, loadPineScript, runPineScript };
package/dist/pine.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { RunPineScriptParams, PineContextLike } from '@tradejs/core/pine';
2
+ export * from '@tradejs/core/pine';
3
+
4
+ declare const loadPineScript: (filePath: string, fallback?: string) => string;
5
+ declare const createLoadPineScript: (baseDir: string) => ((fileNameOrPath: string, fallback?: string) => string);
6
+ declare const runPineScript: ({ candles, script, symbol, timeframe, inputs, limit, }: RunPineScriptParams) => Promise<PineContextLike>;
7
+
8
+ export { createLoadPineScript, loadPineScript, runPineScript };