@gbozee/ultimate 0.0.2-167 → 0.0.2-169
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/dist/frontend-index.d.ts +23 -0
- package/dist/frontend-index.js +33 -14
- package/dist/index.cjs +212 -211
- package/dist/index.d.ts +66 -1
- package/dist/index.js +216 -219
- package/dist/mcp-client.cjs +25 -50
- package/dist/mcp-client.js +25 -50
- package/dist/mcp-server.cjs +214 -217
- package/dist/mcp-server.js +218 -225
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -580,8 +580,7 @@ function cbcDecrypt(enc, cek, ciphertext, iv, tag, aad) {
|
|
|
580
580
|
let macCheckPassed;
|
|
581
581
|
try {
|
|
582
582
|
macCheckPassed = timing_safe_equal_default(tag, expectedTag);
|
|
583
|
-
} catch {
|
|
584
|
-
}
|
|
583
|
+
} catch {}
|
|
585
584
|
if (!macCheckPassed) {
|
|
586
585
|
throw new JWEDecryptionFailed;
|
|
587
586
|
}
|
|
@@ -589,8 +588,7 @@ function cbcDecrypt(enc, cek, ciphertext, iv, tag, aad) {
|
|
|
589
588
|
try {
|
|
590
589
|
const decipher = import_node_crypto6.createDecipheriv(algorithm, encKey, iv);
|
|
591
590
|
plaintext = concat(decipher.update(ciphertext), decipher.final());
|
|
592
|
-
} catch {
|
|
593
|
-
}
|
|
591
|
+
} catch {}
|
|
594
592
|
if (!plaintext) {
|
|
595
593
|
throw new JWEDecryptionFailed;
|
|
596
594
|
}
|
|
@@ -769,8 +767,7 @@ function isPublicJWK(key) {
|
|
|
769
767
|
function isSecretJWK(key) {
|
|
770
768
|
return isJWK(key) && key.kty === "oct" && typeof key.k === "string";
|
|
771
769
|
}
|
|
772
|
-
var init_is_jwk = () => {
|
|
773
|
-
};
|
|
770
|
+
var init_is_jwk = () => {};
|
|
774
771
|
|
|
775
772
|
// node_modules/jose/dist/node/esm/runtime/get_named_curve.js
|
|
776
773
|
var import_node_crypto8, weakMap, namedCurveToJOSE = (namedCurve) => {
|
|
@@ -952,8 +949,7 @@ var import_node_crypto11, check_key_length_default = (key, alg) => {
|
|
|
952
949
|
} else {
|
|
953
950
|
modulusLength = Buffer.from(key.n, "base64url").byteLength << 3;
|
|
954
951
|
}
|
|
955
|
-
} catch {
|
|
956
|
-
}
|
|
952
|
+
} catch {}
|
|
957
953
|
if (typeof modulusLength !== "number" || modulusLength < 2048) {
|
|
958
954
|
throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`);
|
|
959
955
|
}
|
|
@@ -1714,8 +1710,7 @@ async function generalDecrypt(jwe, key, options) {
|
|
|
1714
1710
|
tag: jwe.tag,
|
|
1715
1711
|
unprotected: jwe.unprotected
|
|
1716
1712
|
}, key, options);
|
|
1717
|
-
} catch {
|
|
1718
|
-
}
|
|
1713
|
+
} catch {}
|
|
1719
1714
|
}
|
|
1720
1715
|
throw new JWEDecryptionFailed;
|
|
1721
1716
|
}
|
|
@@ -2601,8 +2596,7 @@ async function generalVerify(jws, key, options) {
|
|
|
2601
2596
|
protected: signature.protected,
|
|
2602
2597
|
signature: signature.signature
|
|
2603
2598
|
}, key, options);
|
|
2604
|
-
} catch {
|
|
2605
|
-
}
|
|
2599
|
+
} catch {}
|
|
2606
2600
|
}
|
|
2607
2601
|
throw new JWSSignatureVerificationFailed;
|
|
2608
2602
|
}
|
|
@@ -2685,8 +2679,7 @@ var normalizeTyp = (value) => value.toLowerCase().replace(/^application\//, ""),
|
|
|
2685
2679
|
let payload;
|
|
2686
2680
|
try {
|
|
2687
2681
|
payload = JSON.parse(decoder.decode(encodedPayload));
|
|
2688
|
-
} catch {
|
|
2689
|
-
}
|
|
2682
|
+
} catch {}
|
|
2690
2683
|
if (!isObject(payload)) {
|
|
2691
2684
|
throw new JWTInvalid("JWT Claims Set must be a top-level JSON object");
|
|
2692
2685
|
}
|
|
@@ -3371,8 +3364,7 @@ class LocalJWKSet {
|
|
|
3371
3364
|
for (const jwk2 of candidates) {
|
|
3372
3365
|
try {
|
|
3373
3366
|
yield await importWithAlgCache(_cached, jwk2, alg);
|
|
3374
|
-
} catch {
|
|
3375
|
-
}
|
|
3367
|
+
} catch {}
|
|
3376
3368
|
}
|
|
3377
3369
|
};
|
|
3378
3370
|
throw error;
|
|
@@ -3919,8 +3911,7 @@ var require_util = __commonJS((exports2) => {
|
|
|
3919
3911
|
var util4;
|
|
3920
3912
|
(function(util5) {
|
|
3921
3913
|
util5.assertEqual = (val) => val;
|
|
3922
|
-
function assertIs(_arg) {
|
|
3923
|
-
}
|
|
3914
|
+
function assertIs(_arg) {}
|
|
3924
3915
|
util5.assertIs = assertIs;
|
|
3925
3916
|
function assertNever(_x) {
|
|
3926
3917
|
throw new Error;
|
|
@@ -6336,8 +6327,7 @@ var require_types = __commonJS((exports2) => {
|
|
|
6336
6327
|
});
|
|
6337
6328
|
status.dirty();
|
|
6338
6329
|
}
|
|
6339
|
-
} else if (unknownKeys === "strip") {
|
|
6340
|
-
} else {
|
|
6330
|
+
} else if (unknownKeys === "strip") {} else {
|
|
6341
6331
|
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
|
6342
6332
|
}
|
|
6343
6333
|
} else {
|
|
@@ -8489,8 +8479,7 @@ var require_logLevelLogger = __commonJS((exports2) => {
|
|
|
8489
8479
|
if (typeof theFunc === "function" && maxLevel >= theLevel) {
|
|
8490
8480
|
return theFunc.bind(logger);
|
|
8491
8481
|
}
|
|
8492
|
-
return function() {
|
|
8493
|
-
};
|
|
8482
|
+
return function() {};
|
|
8494
8483
|
}
|
|
8495
8484
|
return {
|
|
8496
8485
|
error: _filterFunc("error", types_1.DiagLogLevel.ERROR),
|
|
@@ -8715,8 +8704,7 @@ var require_NoopMeter = __commonJS((exports2) => {
|
|
|
8715
8704
|
exports2.createNoopMeter = exports2.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = exports2.NOOP_OBSERVABLE_GAUGE_METRIC = exports2.NOOP_OBSERVABLE_COUNTER_METRIC = exports2.NOOP_UP_DOWN_COUNTER_METRIC = exports2.NOOP_HISTOGRAM_METRIC = exports2.NOOP_GAUGE_METRIC = exports2.NOOP_COUNTER_METRIC = exports2.NOOP_METER = exports2.NoopObservableUpDownCounterMetric = exports2.NoopObservableGaugeMetric = exports2.NoopObservableCounterMetric = exports2.NoopObservableMetric = exports2.NoopHistogramMetric = exports2.NoopGaugeMetric = exports2.NoopUpDownCounterMetric = exports2.NoopCounterMetric = exports2.NoopMetric = exports2.NoopMeter = undefined;
|
|
8716
8705
|
|
|
8717
8706
|
class NoopMeter {
|
|
8718
|
-
constructor() {
|
|
8719
|
-
}
|
|
8707
|
+
constructor() {}
|
|
8720
8708
|
createGauge(_name, _options) {
|
|
8721
8709
|
return exports2.NOOP_GAUGE_METRIC;
|
|
8722
8710
|
}
|
|
@@ -8738,10 +8726,8 @@ var require_NoopMeter = __commonJS((exports2) => {
|
|
|
8738
8726
|
createObservableUpDownCounter(_name, _options) {
|
|
8739
8727
|
return exports2.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;
|
|
8740
8728
|
}
|
|
8741
|
-
addBatchObservableCallback(_callback, _observables) {
|
|
8742
|
-
}
|
|
8743
|
-
removeBatchObservableCallback(_callback) {
|
|
8744
|
-
}
|
|
8729
|
+
addBatchObservableCallback(_callback, _observables) {}
|
|
8730
|
+
removeBatchObservableCallback(_callback) {}
|
|
8745
8731
|
}
|
|
8746
8732
|
exports2.NoopMeter = NoopMeter;
|
|
8747
8733
|
|
|
@@ -8750,34 +8736,28 @@ var require_NoopMeter = __commonJS((exports2) => {
|
|
|
8750
8736
|
exports2.NoopMetric = NoopMetric;
|
|
8751
8737
|
|
|
8752
8738
|
class NoopCounterMetric extends NoopMetric {
|
|
8753
|
-
add(_value, _attributes) {
|
|
8754
|
-
}
|
|
8739
|
+
add(_value, _attributes) {}
|
|
8755
8740
|
}
|
|
8756
8741
|
exports2.NoopCounterMetric = NoopCounterMetric;
|
|
8757
8742
|
|
|
8758
8743
|
class NoopUpDownCounterMetric extends NoopMetric {
|
|
8759
|
-
add(_value, _attributes) {
|
|
8760
|
-
}
|
|
8744
|
+
add(_value, _attributes) {}
|
|
8761
8745
|
}
|
|
8762
8746
|
exports2.NoopUpDownCounterMetric = NoopUpDownCounterMetric;
|
|
8763
8747
|
|
|
8764
8748
|
class NoopGaugeMetric extends NoopMetric {
|
|
8765
|
-
record(_value, _attributes) {
|
|
8766
|
-
}
|
|
8749
|
+
record(_value, _attributes) {}
|
|
8767
8750
|
}
|
|
8768
8751
|
exports2.NoopGaugeMetric = NoopGaugeMetric;
|
|
8769
8752
|
|
|
8770
8753
|
class NoopHistogramMetric extends NoopMetric {
|
|
8771
|
-
record(_value, _attributes) {
|
|
8772
|
-
}
|
|
8754
|
+
record(_value, _attributes) {}
|
|
8773
8755
|
}
|
|
8774
8756
|
exports2.NoopHistogramMetric = NoopHistogramMetric;
|
|
8775
8757
|
|
|
8776
8758
|
class NoopObservableMetric {
|
|
8777
|
-
addCallback(_callback) {
|
|
8778
|
-
}
|
|
8779
|
-
removeCallback(_callback) {
|
|
8780
|
-
}
|
|
8759
|
+
addCallback(_callback) {}
|
|
8760
|
+
removeCallback(_callback) {}
|
|
8781
8761
|
}
|
|
8782
8762
|
exports2.NoopObservableMetric = NoopObservableMetric;
|
|
8783
8763
|
|
|
@@ -8882,8 +8862,7 @@ var require_context2 = __commonJS((exports2) => {
|
|
|
8882
8862
|
var NOOP_CONTEXT_MANAGER = new NoopContextManager_1.NoopContextManager;
|
|
8883
8863
|
|
|
8884
8864
|
class ContextAPI {
|
|
8885
|
-
constructor() {
|
|
8886
|
-
}
|
|
8865
|
+
constructor() {}
|
|
8887
8866
|
static getInstance() {
|
|
8888
8867
|
if (!this._instance) {
|
|
8889
8868
|
this._instance = new ContextAPI;
|
|
@@ -8972,13 +8951,11 @@ var require_NonRecordingSpan = __commonJS((exports2) => {
|
|
|
8972
8951
|
updateName(_name) {
|
|
8973
8952
|
return this;
|
|
8974
8953
|
}
|
|
8975
|
-
end(_endTime) {
|
|
8976
|
-
}
|
|
8954
|
+
end(_endTime) {}
|
|
8977
8955
|
isRecording() {
|
|
8978
8956
|
return false;
|
|
8979
8957
|
}
|
|
8980
|
-
recordException(_exception, _time) {
|
|
8981
|
-
}
|
|
8958
|
+
recordException(_exception, _time) {}
|
|
8982
8959
|
}
|
|
8983
8960
|
exports2.NonRecordingSpan = NonRecordingSpan;
|
|
8984
8961
|
});
|
|
@@ -9280,8 +9257,7 @@ var require_tracestate_impl = __commonJS((exports2) => {
|
|
|
9280
9257
|
const value = listMember.slice(i + 1, part.length);
|
|
9281
9258
|
if ((0, tracestate_validators_1.validateKey)(key) && (0, tracestate_validators_1.validateValue)(value)) {
|
|
9282
9259
|
agg.set(key, value);
|
|
9283
|
-
} else {
|
|
9284
|
-
}
|
|
9260
|
+
} else {}
|
|
9285
9261
|
}
|
|
9286
9262
|
return agg;
|
|
9287
9263
|
}, new Map);
|
|
@@ -9353,8 +9329,7 @@ var require_metrics = __commonJS((exports2) => {
|
|
|
9353
9329
|
var API_NAME2 = "metrics";
|
|
9354
9330
|
|
|
9355
9331
|
class MetricsAPI {
|
|
9356
|
-
constructor() {
|
|
9357
|
-
}
|
|
9332
|
+
constructor() {}
|
|
9358
9333
|
static getInstance() {
|
|
9359
9334
|
if (!this._instance) {
|
|
9360
9335
|
this._instance = new MetricsAPI;
|
|
@@ -9391,8 +9366,7 @@ var require_NoopTextMapPropagator = __commonJS((exports2) => {
|
|
|
9391
9366
|
exports2.NoopTextMapPropagator = undefined;
|
|
9392
9367
|
|
|
9393
9368
|
class NoopTextMapPropagator {
|
|
9394
|
-
inject(_context, _carrier) {
|
|
9395
|
-
}
|
|
9369
|
+
inject(_context, _carrier) {}
|
|
9396
9370
|
extract(context, _carrier) {
|
|
9397
9371
|
return context;
|
|
9398
9372
|
}
|
|
@@ -9705,8 +9679,7 @@ class Registry {
|
|
|
9705
9679
|
return this.kv.getByKey(identifier);
|
|
9706
9680
|
}
|
|
9707
9681
|
}
|
|
9708
|
-
var init_registry = () => {
|
|
9709
|
-
};
|
|
9682
|
+
var init_registry = () => {};
|
|
9710
9683
|
|
|
9711
9684
|
// node_modules/superjson/dist/class-registry.js
|
|
9712
9685
|
var ClassRegistry;
|
|
@@ -9791,8 +9764,7 @@ class CustomTransformerRegistry {
|
|
|
9791
9764
|
return this.transfomers[name2];
|
|
9792
9765
|
}
|
|
9793
9766
|
}
|
|
9794
|
-
var init_custom_transformer_registry = () => {
|
|
9795
|
-
};
|
|
9767
|
+
var init_custom_transformer_registry = () => {};
|
|
9796
9768
|
|
|
9797
9769
|
// node_modules/superjson/dist/is.js
|
|
9798
9770
|
var getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1), isUndefined = (payload) => typeof payload === "undefined", isNull = (payload) => payload === null, isPlainObject = (payload) => {
|
|
@@ -10137,8 +10109,7 @@ var getNthKey = (value, n) => {
|
|
|
10137
10109
|
}
|
|
10138
10110
|
return object;
|
|
10139
10111
|
};
|
|
10140
|
-
var init_accessDeep = () => {
|
|
10141
|
-
};
|
|
10112
|
+
var init_accessDeep = () => {};
|
|
10142
10113
|
|
|
10143
10114
|
// node_modules/superjson/dist/plainer.js
|
|
10144
10115
|
function traverse(tree, walker, origin = []) {
|
|
@@ -10727,8 +10698,7 @@ var require_NoopLogger = __commonJS((exports2) => {
|
|
|
10727
10698
|
exports2.NOOP_LOGGER = exports2.NoopLogger = undefined;
|
|
10728
10699
|
|
|
10729
10700
|
class NoopLogger {
|
|
10730
|
-
emit(_logRecord) {
|
|
10731
|
-
}
|
|
10701
|
+
emit(_logRecord) {}
|
|
10732
10702
|
}
|
|
10733
10703
|
exports2.NoopLogger = NoopLogger;
|
|
10734
10704
|
exports2.NOOP_LOGGER = new NoopLogger;
|
|
@@ -10822,8 +10792,7 @@ var require_logs = __commonJS((exports2) => {
|
|
|
10822
10792
|
var NoopLoggerProvider_1 = require_NoopLoggerProvider();
|
|
10823
10793
|
|
|
10824
10794
|
class LogsAPI {
|
|
10825
|
-
constructor() {
|
|
10826
|
-
}
|
|
10795
|
+
constructor() {}
|
|
10827
10796
|
static getInstance() {
|
|
10828
10797
|
if (!this._instance) {
|
|
10829
10798
|
this._instance = new LogsAPI;
|
|
@@ -11291,8 +11260,7 @@ var require_browser = __commonJS((exports2, module2) => {
|
|
|
11291
11260
|
});
|
|
11292
11261
|
args.splice(lastC, 0, c);
|
|
11293
11262
|
}
|
|
11294
|
-
exports2.log = console.debug || console.log || (() => {
|
|
11295
|
-
});
|
|
11263
|
+
exports2.log = console.debug || console.log || (() => {});
|
|
11296
11264
|
function save(namespaces) {
|
|
11297
11265
|
try {
|
|
11298
11266
|
if (namespaces) {
|
|
@@ -11300,15 +11268,13 @@ var require_browser = __commonJS((exports2, module2) => {
|
|
|
11300
11268
|
} else {
|
|
11301
11269
|
exports2.storage.removeItem("debug");
|
|
11302
11270
|
}
|
|
11303
|
-
} catch (error) {
|
|
11304
|
-
}
|
|
11271
|
+
} catch (error) {}
|
|
11305
11272
|
}
|
|
11306
11273
|
function load() {
|
|
11307
11274
|
let r;
|
|
11308
11275
|
try {
|
|
11309
11276
|
r = exports2.storage.getItem("debug");
|
|
11310
|
-
} catch (error) {
|
|
11311
|
-
}
|
|
11277
|
+
} catch (error) {}
|
|
11312
11278
|
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
11313
11279
|
r = process.env.DEBUG;
|
|
11314
11280
|
}
|
|
@@ -11317,8 +11283,7 @@ var require_browser = __commonJS((exports2, module2) => {
|
|
|
11317
11283
|
function localstorage() {
|
|
11318
11284
|
try {
|
|
11319
11285
|
return localStorage;
|
|
11320
|
-
} catch (error) {
|
|
11321
|
-
}
|
|
11286
|
+
} catch (error) {}
|
|
11322
11287
|
}
|
|
11323
11288
|
module2.exports = require_common()(exports2);
|
|
11324
11289
|
var { formatters } = module2.exports;
|
|
@@ -11450,8 +11415,7 @@ var require_node3 = __commonJS((exports2, module2) => {
|
|
|
11450
11415
|
exports2.save = save;
|
|
11451
11416
|
exports2.load = load;
|
|
11452
11417
|
exports2.useColors = useColors;
|
|
11453
|
-
exports2.destroy = util4.deprecate(() => {
|
|
11454
|
-
}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
11418
|
+
exports2.destroy = util4.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
11455
11419
|
exports2.colors = [6, 2, 3, 4, 5, 1];
|
|
11456
11420
|
try {
|
|
11457
11421
|
const supportsColor = require_supports_color();
|
|
@@ -11535,8 +11499,7 @@ var require_node3 = __commonJS((exports2, module2) => {
|
|
|
11535
11499
|
221
|
|
11536
11500
|
];
|
|
11537
11501
|
}
|
|
11538
|
-
} catch (error) {
|
|
11539
|
-
}
|
|
11502
|
+
} catch (error) {}
|
|
11540
11503
|
exports2.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
11541
11504
|
return /^debug_/i.test(key);
|
|
11542
11505
|
}).reduce((obj, key) => {
|
|
@@ -13785,8 +13748,7 @@ var require_jsbn = __commonJS((exports2, module2) => {
|
|
|
13785
13748
|
++this[w];
|
|
13786
13749
|
}
|
|
13787
13750
|
}
|
|
13788
|
-
function NullExp() {
|
|
13789
|
-
}
|
|
13751
|
+
function NullExp() {}
|
|
13790
13752
|
function nNop(x) {
|
|
13791
13753
|
return x;
|
|
13792
13754
|
}
|
|
@@ -14211,8 +14173,7 @@ var require_jsbn = __commonJS((exports2, module2) => {
|
|
|
14211
14173
|
for (i2 = 0;i2 < ba.length; ++i2)
|
|
14212
14174
|
ba[i2] = rng_get_byte();
|
|
14213
14175
|
}
|
|
14214
|
-
function SecureRandom() {
|
|
14215
|
-
}
|
|
14176
|
+
function SecureRandom() {}
|
|
14216
14177
|
SecureRandom.prototype.nextBytes = rng_get_bytes;
|
|
14217
14178
|
function Arcfour() {
|
|
14218
14179
|
this.i = 0;
|
|
@@ -16435,8 +16396,7 @@ var require_delayed_stream = __commonJS((exports2, module2) => {
|
|
|
16435
16396
|
delayedStream._handleEmit(arguments);
|
|
16436
16397
|
return realEmit.apply(source, arguments);
|
|
16437
16398
|
};
|
|
16438
|
-
source.on("error", function() {
|
|
16439
|
-
});
|
|
16399
|
+
source.on("error", function() {});
|
|
16440
16400
|
if (delayedStream.pauseStream) {
|
|
16441
16401
|
source.pause();
|
|
16442
16402
|
}
|
|
@@ -25740,8 +25700,7 @@ var require_implementation = __commonJS((exports2, module2) => {
|
|
|
25740
25700
|
}
|
|
25741
25701
|
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
25742
25702
|
if (target.prototype) {
|
|
25743
|
-
var Empty = function Empty() {
|
|
25744
|
-
};
|
|
25703
|
+
var Empty = function Empty() {};
|
|
25745
25704
|
Empty.prototype = target.prototype;
|
|
25746
25705
|
bound.prototype = new Empty;
|
|
25747
25706
|
Empty.prototype = null;
|
|
@@ -25861,8 +25820,7 @@ var require_get_intrinsic = __commonJS((exports2, module2) => {
|
|
|
25861
25820
|
var getEvalledConstructor = function(expressionSyntax) {
|
|
25862
25821
|
try {
|
|
25863
25822
|
return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
|
|
25864
|
-
} catch (e2) {
|
|
25865
|
-
}
|
|
25823
|
+
} catch (e2) {}
|
|
25866
25824
|
};
|
|
25867
25825
|
var $gOPD = require_gopd();
|
|
25868
25826
|
var $defineProperty = require_es_define_property();
|
|
@@ -26601,11 +26559,9 @@ var require_debug = __commonJS((exports2, module2) => {
|
|
|
26601
26559
|
if (!debug) {
|
|
26602
26560
|
try {
|
|
26603
26561
|
debug = require_src4()("follow-redirects");
|
|
26604
|
-
} catch (error) {
|
|
26605
|
-
}
|
|
26562
|
+
} catch (error) {}
|
|
26606
26563
|
if (typeof debug !== "function") {
|
|
26607
|
-
debug = function() {
|
|
26608
|
-
};
|
|
26564
|
+
debug = function() {};
|
|
26609
26565
|
}
|
|
26610
26566
|
}
|
|
26611
26567
|
debug.apply(null, arguments);
|
|
@@ -26980,8 +26936,7 @@ var require_follow_redirects = __commonJS((exports2, module2) => {
|
|
|
26980
26936
|
});
|
|
26981
26937
|
return exports3;
|
|
26982
26938
|
}
|
|
26983
|
-
function noop2() {
|
|
26984
|
-
}
|
|
26939
|
+
function noop2() {}
|
|
26985
26940
|
function parseUrl(input) {
|
|
26986
26941
|
var parsed;
|
|
26987
26942
|
if (useNativeURL) {
|
|
@@ -27364,8 +27319,7 @@ var require_axios = __commonJS((exports2, module2) => {
|
|
|
27364
27319
|
isArray3(arrayOrString) ? define2(arrayOrString) : define2(String(arrayOrString).split(delimiter));
|
|
27365
27320
|
return obj;
|
|
27366
27321
|
};
|
|
27367
|
-
var noop2 = () => {
|
|
27368
|
-
};
|
|
27322
|
+
var noop2 = () => {};
|
|
27369
27323
|
var toFiniteNumber = (value, defaultValue) => {
|
|
27370
27324
|
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
27371
27325
|
};
|
|
@@ -28818,8 +28772,7 @@ var require_axios = __commonJS((exports2, module2) => {
|
|
|
28818
28772
|
try {
|
|
28819
28773
|
const knownLength = await util__default["default"].promisify(data.getLength).call(data);
|
|
28820
28774
|
Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
|
|
28821
|
-
} catch (e2) {
|
|
28822
|
-
}
|
|
28775
|
+
} catch (e2) {}
|
|
28823
28776
|
}
|
|
28824
28777
|
} else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
|
|
28825
28778
|
data.size && headers.setContentType(data.type || "application/octet-stream");
|
|
@@ -29093,13 +29046,11 @@ var require_axios = __commonJS((exports2, module2) => {
|
|
|
29093
29046
|
this.write(name2, "", Date.now() - 86400000);
|
|
29094
29047
|
}
|
|
29095
29048
|
} : {
|
|
29096
|
-
write() {
|
|
29097
|
-
},
|
|
29049
|
+
write() {},
|
|
29098
29050
|
read() {
|
|
29099
29051
|
return null;
|
|
29100
29052
|
},
|
|
29101
|
-
remove() {
|
|
29102
|
-
}
|
|
29053
|
+
remove() {}
|
|
29103
29054
|
};
|
|
29104
29055
|
var headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
29105
29056
|
function mergeConfig(config1, config2) {
|
|
@@ -29593,8 +29544,7 @@ var require_axios = __commonJS((exports2, module2) => {
|
|
|
29593
29544
|
if (fn) {
|
|
29594
29545
|
try {
|
|
29595
29546
|
Object.defineProperty(fn, "name", { value });
|
|
29596
|
-
} catch (e2) {
|
|
29597
|
-
}
|
|
29547
|
+
} catch (e2) {}
|
|
29598
29548
|
Object.defineProperty(fn, "adapterName", { value });
|
|
29599
29549
|
}
|
|
29600
29550
|
});
|
|
@@ -29744,8 +29694,7 @@ var require_axios = __commonJS((exports2, module2) => {
|
|
|
29744
29694
|
err.stack += `
|
|
29745
29695
|
` + stack;
|
|
29746
29696
|
}
|
|
29747
|
-
} catch (e2) {
|
|
29748
|
-
}
|
|
29697
|
+
} catch (e2) {}
|
|
29749
29698
|
}
|
|
29750
29699
|
throw err;
|
|
29751
29700
|
}
|
|
@@ -31818,8 +31767,7 @@ var require_logger = __commonJS((exports2) => {
|
|
|
31818
31767
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
31819
31768
|
exports2.DefaultLogger = undefined;
|
|
31820
31769
|
exports2.DefaultLogger = {
|
|
31821
|
-
silly: (...params) => {
|
|
31822
|
-
},
|
|
31770
|
+
silly: (...params) => {},
|
|
31823
31771
|
debug: (...params) => {
|
|
31824
31772
|
console.log(new Date, params);
|
|
31825
31773
|
},
|
|
@@ -34562,8 +34510,7 @@ var require_constants4 = __commonJS((exports2, module2) => {
|
|
|
34562
34510
|
kListener: Symbol("kListener"),
|
|
34563
34511
|
kStatusCode: Symbol("status-code"),
|
|
34564
34512
|
kWebSocket: Symbol("websocket"),
|
|
34565
|
-
NOOP: () => {
|
|
34566
|
-
}
|
|
34513
|
+
NOOP: () => {}
|
|
34567
34514
|
};
|
|
34568
34515
|
});
|
|
34569
34516
|
|
|
@@ -34641,8 +34588,7 @@ var require_buffer_util = __commonJS((exports2, module2) => {
|
|
|
34641
34588
|
else
|
|
34642
34589
|
bufferUtil.unmask(buffer, mask);
|
|
34643
34590
|
};
|
|
34644
|
-
} catch (e2) {
|
|
34645
|
-
}
|
|
34591
|
+
} catch (e2) {}
|
|
34646
34592
|
}
|
|
34647
34593
|
});
|
|
34648
34594
|
|
|
@@ -35121,8 +35067,7 @@ var require_validation = __commonJS((exports2, module2) => {
|
|
|
35121
35067
|
module2.exports.isValidUTF8 = function(buf) {
|
|
35122
35068
|
return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
|
|
35123
35069
|
};
|
|
35124
|
-
} catch (e2) {
|
|
35125
|
-
}
|
|
35070
|
+
} catch (e2) {}
|
|
35126
35071
|
}
|
|
35127
35072
|
});
|
|
35128
35073
|
|
|
@@ -37552,8 +37497,7 @@ var require_websocket_client = __commonJS((exports2) => {
|
|
|
37552
37497
|
this.options = Object.assign({ pongTimeout: 7500, pingInterval: 1e4, reconnectTimeout: 500 }, options);
|
|
37553
37498
|
this.listenKeyStateStore = {};
|
|
37554
37499
|
this.wsUrlKeyMap = {};
|
|
37555
|
-
this.on("error", () => {
|
|
37556
|
-
});
|
|
37500
|
+
this.on("error", () => {});
|
|
37557
37501
|
}
|
|
37558
37502
|
getRestClientOptions() {
|
|
37559
37503
|
return Object.assign(Object.assign(Object.assign({}, this.options), this.options.restOptions), { api_key: this.options.api_key, api_secret: this.options.api_secret });
|
|
@@ -38771,8 +38715,7 @@ var require_axios2 = __commonJS((exports2, module2) => {
|
|
|
38771
38715
|
isArray3(arrayOrString) ? define2(arrayOrString) : define2(String(arrayOrString).split(delimiter));
|
|
38772
38716
|
return obj;
|
|
38773
38717
|
};
|
|
38774
|
-
var noop2 = () => {
|
|
38775
|
-
};
|
|
38718
|
+
var noop2 = () => {};
|
|
38776
38719
|
var toFiniteNumber = (value2, defaultValue) => {
|
|
38777
38720
|
return value2 != null && Number.isFinite(value2 = +value2) ? value2 : defaultValue;
|
|
38778
38721
|
};
|
|
@@ -40225,8 +40168,7 @@ var require_axios2 = __commonJS((exports2, module2) => {
|
|
|
40225
40168
|
try {
|
|
40226
40169
|
const knownLength = await util__default["default"].promisify(data.getLength).call(data);
|
|
40227
40170
|
Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
|
|
40228
|
-
} catch (e2) {
|
|
40229
|
-
}
|
|
40171
|
+
} catch (e2) {}
|
|
40230
40172
|
}
|
|
40231
40173
|
} else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
|
|
40232
40174
|
data.size && headers.setContentType(data.type || "application/octet-stream");
|
|
@@ -40500,13 +40442,11 @@ var require_axios2 = __commonJS((exports2, module2) => {
|
|
|
40500
40442
|
this.write(name2, "", Date.now() - 86400000);
|
|
40501
40443
|
}
|
|
40502
40444
|
} : {
|
|
40503
|
-
write() {
|
|
40504
|
-
},
|
|
40445
|
+
write() {},
|
|
40505
40446
|
read() {
|
|
40506
40447
|
return null;
|
|
40507
40448
|
},
|
|
40508
|
-
remove() {
|
|
40509
|
-
}
|
|
40449
|
+
remove() {}
|
|
40510
40450
|
};
|
|
40511
40451
|
var headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
40512
40452
|
function mergeConfig(config1, config2) {
|
|
@@ -41000,8 +40940,7 @@ var require_axios2 = __commonJS((exports2, module2) => {
|
|
|
41000
40940
|
if (fn) {
|
|
41001
40941
|
try {
|
|
41002
40942
|
Object.defineProperty(fn, "name", { value: value2 });
|
|
41003
|
-
} catch (e2) {
|
|
41004
|
-
}
|
|
40943
|
+
} catch (e2) {}
|
|
41005
40944
|
Object.defineProperty(fn, "adapterName", { value: value2 });
|
|
41006
40945
|
}
|
|
41007
40946
|
});
|
|
@@ -41151,8 +41090,7 @@ var require_axios2 = __commonJS((exports2, module2) => {
|
|
|
41151
41090
|
err.stack += `
|
|
41152
41091
|
` + stack;
|
|
41153
41092
|
}
|
|
41154
|
-
} catch (e2) {
|
|
41155
|
-
}
|
|
41093
|
+
} catch (e2) {}
|
|
41156
41094
|
}
|
|
41157
41095
|
throw err;
|
|
41158
41096
|
}
|
|
@@ -42021,8 +41959,7 @@ var require_logger2 = __commonJS((exports2) => {
|
|
|
42021
41959
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
42022
41960
|
exports2.DefaultLogger = undefined;
|
|
42023
41961
|
exports2.DefaultLogger = {
|
|
42024
|
-
trace: (..._params) => {
|
|
42025
|
-
},
|
|
41962
|
+
trace: (..._params) => {},
|
|
42026
41963
|
info: (...params) => {
|
|
42027
41964
|
console.info(params);
|
|
42028
41965
|
},
|
|
@@ -44068,8 +44005,7 @@ var require_BaseWSClient = __commonJS((exports2) => {
|
|
|
44068
44005
|
if (wsState === null || wsState === undefined ? undefined : wsState.activePongTimer) {
|
|
44069
44006
|
clearTimeout(wsState.activePongTimer);
|
|
44070
44007
|
wsState.activePongTimer = undefined;
|
|
44071
|
-
} else {
|
|
44072
|
-
}
|
|
44008
|
+
} else {}
|
|
44073
44009
|
}
|
|
44074
44010
|
clearReconnectTimer(wsKey) {
|
|
44075
44011
|
const wsState = this.wsStore.get(wsKey);
|
|
@@ -44951,6 +44887,7 @@ __export(exports_src, {
|
|
|
44951
44887
|
generateOptimumAppConfig: () => generateOptimumAppConfig,
|
|
44952
44888
|
generateOppositeTradeConfig: () => generateOppositeTradeConfig,
|
|
44953
44889
|
generateGapTp: () => generateGapTp,
|
|
44890
|
+
generateDangerousConfig: () => generateDangerousConfig,
|
|
44954
44891
|
exchange_account: () => exports_exchange_account,
|
|
44955
44892
|
determine_break_even_price: () => determine_break_even_price,
|
|
44956
44893
|
determine_average_entry_and_size: () => determine_average_entry_and_size,
|
|
@@ -44988,8 +44925,7 @@ __export(exports_app, {
|
|
|
44988
44925
|
var util;
|
|
44989
44926
|
(function(util2) {
|
|
44990
44927
|
util2.assertEqual = (val) => val;
|
|
44991
|
-
function assertIs(_arg) {
|
|
44992
|
-
}
|
|
44928
|
+
function assertIs(_arg) {}
|
|
44993
44929
|
util2.assertIs = assertIs;
|
|
44994
44930
|
function assertNever(_x) {
|
|
44995
44931
|
throw new Error;
|
|
@@ -49850,8 +49786,7 @@ var API_NAME = "task-context";
|
|
|
49850
49786
|
|
|
49851
49787
|
class TaskContextAPI {
|
|
49852
49788
|
static _instance;
|
|
49853
|
-
constructor() {
|
|
49854
|
-
}
|
|
49789
|
+
constructor() {}
|
|
49855
49790
|
static getInstance() {
|
|
49856
49791
|
if (!this._instance) {
|
|
49857
49792
|
this._instance = new TaskContextAPI;
|
|
@@ -50271,8 +50206,7 @@ class ParseError extends Error {
|
|
|
50271
50206
|
super(message2), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;
|
|
50272
50207
|
}
|
|
50273
50208
|
}
|
|
50274
|
-
function noop(_arg) {
|
|
50275
|
-
}
|
|
50209
|
+
function noop(_arg) {}
|
|
50276
50210
|
function createParser(callbacks) {
|
|
50277
50211
|
if (typeof callbacks == "function")
|
|
50278
50212
|
throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");
|
|
@@ -50475,8 +50409,7 @@ async function _doZodFetchWithRetries(schema, url, requestInit, options, attempt
|
|
|
50475
50409
|
if (error instanceof ApiError) {
|
|
50476
50410
|
throw error;
|
|
50477
50411
|
}
|
|
50478
|
-
if (error instanceof import_zod_validation_error.ValidationError) {
|
|
50479
|
-
}
|
|
50412
|
+
if (error instanceof import_zod_validation_error.ValidationError) {}
|
|
50480
50413
|
if (options?.retry) {
|
|
50481
50414
|
const retry = { ...defaultRetryOptions2, ...options.retry };
|
|
50482
50415
|
const delay = calculateNextRetryDelay(retry, attempt);
|
|
@@ -50950,8 +50883,7 @@ class ApiClientMissingError extends Error {
|
|
|
50950
50883
|
|
|
50951
50884
|
class APIClientManagerAPI {
|
|
50952
50885
|
static _instance;
|
|
50953
|
-
constructor() {
|
|
50954
|
-
}
|
|
50886
|
+
constructor() {}
|
|
50955
50887
|
static getInstance() {
|
|
50956
50888
|
if (!this._instance) {
|
|
50957
50889
|
this._instance = new APIClientManagerAPI;
|
|
@@ -51506,8 +51438,7 @@ var PrefetchQueue = class {
|
|
|
51506
51438
|
if (__privateGet(this, _queueTailUrl) && !__privateGet(this, _prefetchQueue).has(__privateGet(this, _queueTailUrl))) {
|
|
51507
51439
|
__privateMethod(this, _PrefetchQueue_instances, prefetch_fn).call(this, __privateGet(this, _queueTailUrl), args[1]);
|
|
51508
51440
|
}
|
|
51509
|
-
}).catch(() => {
|
|
51510
|
-
});
|
|
51441
|
+
}).catch(() => {});
|
|
51511
51442
|
return request;
|
|
51512
51443
|
}
|
|
51513
51444
|
};
|
|
@@ -51538,10 +51469,8 @@ prefetch_fn = function(...args) {
|
|
|
51538
51469
|
}
|
|
51539
51470
|
__privateSet(this, _queueTailUrl, nextUrl);
|
|
51540
51471
|
return __privateMethod(this, _PrefetchQueue_instances, prefetch_fn).call(this, nextUrl, args[1]);
|
|
51541
|
-
}).catch(() => {
|
|
51542
|
-
|
|
51543
|
-
} catch (_) {
|
|
51544
|
-
}
|
|
51472
|
+
}).catch(() => {});
|
|
51473
|
+
} catch (_) {}
|
|
51545
51474
|
};
|
|
51546
51475
|
function getNextChunkUrl(url, res) {
|
|
51547
51476
|
const shapeHandle = res.headers.get(SHAPE_HANDLE_HEADER);
|
|
@@ -51644,8 +51573,7 @@ var ShapeStream = class {
|
|
|
51644
51573
|
get lastOffset() {
|
|
51645
51574
|
return __privateGet(this, _lastOffset);
|
|
51646
51575
|
}
|
|
51647
|
-
subscribe(callback, onError = () => {
|
|
51648
|
-
}) {
|
|
51576
|
+
subscribe(callback, onError = () => {}) {
|
|
51649
51577
|
const subscriptionId = Math.random();
|
|
51650
51578
|
__privateGet(this, _subscribers).set(subscriptionId, [callback, onError]);
|
|
51651
51579
|
return () => {
|
|
@@ -52839,8 +52767,7 @@ class SimpleClock {
|
|
|
52839
52767
|
const nowStruct = now.toStruct();
|
|
52840
52768
|
return [nowStruct.seconds, nowStruct.nanos];
|
|
52841
52769
|
}
|
|
52842
|
-
reset() {
|
|
52843
|
-
}
|
|
52770
|
+
reset() {}
|
|
52844
52771
|
}
|
|
52845
52772
|
|
|
52846
52773
|
// node_modules/@trigger.dev/core/dist/esm/v3/clock/index.js
|
|
@@ -52849,8 +52776,7 @@ var SIMPLE_CLOCK = new SimpleClock;
|
|
|
52849
52776
|
|
|
52850
52777
|
class ClockAPI {
|
|
52851
52778
|
static _instance;
|
|
52852
|
-
constructor() {
|
|
52853
|
-
}
|
|
52779
|
+
constructor() {}
|
|
52854
52780
|
static getInstance() {
|
|
52855
52781
|
if (!this._instance) {
|
|
52856
52782
|
this._instance = new ClockAPI;
|
|
@@ -52876,8 +52802,7 @@ var clock = ClockAPI.getInstance();
|
|
|
52876
52802
|
|
|
52877
52803
|
// node_modules/@trigger.dev/core/dist/esm/v3/usage/noopUsageManager.js
|
|
52878
52804
|
class NoopUsageManager {
|
|
52879
|
-
disable() {
|
|
52880
|
-
}
|
|
52805
|
+
disable() {}
|
|
52881
52806
|
start() {
|
|
52882
52807
|
return {
|
|
52883
52808
|
sample: () => ({ cpuTime: 0, wallTime: 0 })
|
|
@@ -52900,8 +52825,7 @@ var NOOP_USAGE_MANAGER = new NoopUsageManager;
|
|
|
52900
52825
|
|
|
52901
52826
|
class UsageAPI {
|
|
52902
52827
|
static _instance;
|
|
52903
|
-
constructor() {
|
|
52904
|
-
}
|
|
52828
|
+
constructor() {}
|
|
52905
52829
|
static getInstance() {
|
|
52906
52830
|
if (!this._instance) {
|
|
52907
52831
|
this._instance = new UsageAPI;
|
|
@@ -52961,8 +52885,7 @@ class NoopRunMetadataManager {
|
|
|
52961
52885
|
refresh(requestOptions) {
|
|
52962
52886
|
throw new Error("Method not implemented.");
|
|
52963
52887
|
}
|
|
52964
|
-
enterWithMetadata(metadata) {
|
|
52965
|
-
}
|
|
52888
|
+
enterWithMetadata(metadata) {}
|
|
52966
52889
|
current() {
|
|
52967
52890
|
throw new Error("Method not implemented.");
|
|
52968
52891
|
}
|
|
@@ -53018,8 +52941,7 @@ var NOOP_MANAGER = new NoopRunMetadataManager;
|
|
|
53018
52941
|
|
|
53019
52942
|
class RunMetadataAPI {
|
|
53020
52943
|
static _instance;
|
|
53021
|
-
constructor() {
|
|
53022
|
-
}
|
|
52944
|
+
constructor() {}
|
|
53023
52945
|
static getInstance() {
|
|
53024
52946
|
if (!this._instance) {
|
|
53025
52947
|
this._instance = new RunMetadataAPI;
|
|
@@ -53104,8 +53026,7 @@ var NOOP_TIMEOUT_MANAGER = new NoopTimeoutManager;
|
|
|
53104
53026
|
|
|
53105
53027
|
class TimeoutAPI {
|
|
53106
53028
|
static _instance;
|
|
53107
|
-
constructor() {
|
|
53108
|
-
}
|
|
53029
|
+
constructor() {}
|
|
53109
53030
|
static getInstance() {
|
|
53110
53031
|
if (!this._instance) {
|
|
53111
53032
|
this._instance = new TimeoutAPI;
|
|
@@ -53511,8 +53432,7 @@ function getTokenPayload(e2) {
|
|
|
53511
53432
|
return "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2);
|
|
53512
53433
|
}).join(""));
|
|
53513
53434
|
return JSON.parse(t2) || {};
|
|
53514
|
-
} catch (e3) {
|
|
53515
|
-
}
|
|
53435
|
+
} catch (e3) {}
|
|
53516
53436
|
return {};
|
|
53517
53437
|
}
|
|
53518
53438
|
function isTokenExpired(e2, t2 = 0) {
|
|
@@ -53566,8 +53486,7 @@ class BaseAuthStore {
|
|
|
53566
53486
|
let n = {};
|
|
53567
53487
|
try {
|
|
53568
53488
|
n = JSON.parse(s2), (typeof n === null || typeof n != "object" || Array.isArray(n)) && (n = {});
|
|
53569
|
-
} catch (e3) {
|
|
53570
|
-
}
|
|
53489
|
+
} catch (e3) {}
|
|
53571
53490
|
this.save(n.token || "", n.record || n.model || null);
|
|
53572
53491
|
}
|
|
53573
53492
|
exportToCookie(e2, t2 = i) {
|
|
@@ -53714,8 +53633,7 @@ class RealtimeService extends BaseService {
|
|
|
53714
53633
|
let i3;
|
|
53715
53634
|
try {
|
|
53716
53635
|
i3 = JSON.parse(s3?.data);
|
|
53717
|
-
} catch {
|
|
53718
|
-
}
|
|
53636
|
+
} catch {}
|
|
53719
53637
|
t2(i3 || {});
|
|
53720
53638
|
};
|
|
53721
53639
|
return this.subscriptions[i2] || (this.subscriptions[i2] = []), this.subscriptions[i2].push(listener), this.isConnected ? this.subscriptions[i2].length === 1 ? await this.submitSubscriptions() : this.eventSource?.addEventListener(i2, listener) : await this.connect(), async () => this.unsubscribeByTopicAndListener(e2, listener);
|
|
@@ -54428,8 +54346,7 @@ class Client {
|
|
|
54428
54346
|
let s3 = {};
|
|
54429
54347
|
try {
|
|
54430
54348
|
s3 = await e3.json();
|
|
54431
|
-
} catch (e4) {
|
|
54432
|
-
}
|
|
54349
|
+
} catch (e4) {}
|
|
54433
54350
|
if (this.afterSend && (s3 = await this.afterSend(e3, s3, t2)), e3.status >= 400)
|
|
54434
54351
|
throw new ClientResponseError({ url: e3.url, status: e3.status, data: s3 });
|
|
54435
54352
|
return s3;
|
|
@@ -55963,8 +55880,7 @@ class Signal {
|
|
|
55963
55880
|
support: kind === "long" ? _stop_loss : this.support
|
|
55964
55881
|
};
|
|
55965
55882
|
const instance = new Signal(derivedConfig);
|
|
55966
|
-
if (kind === "short") {
|
|
55967
|
-
}
|
|
55883
|
+
if (kind === "short") {}
|
|
55968
55884
|
let result = instance.get_bulk_trade_zones({ current_price, kind });
|
|
55969
55885
|
return result;
|
|
55970
55886
|
return result?.filter((x) => {
|
|
@@ -56182,8 +56098,7 @@ class Signal {
|
|
|
56182
56098
|
kind = "long",
|
|
56183
56099
|
raw
|
|
56184
56100
|
}) {
|
|
56185
|
-
if (raw) {
|
|
56186
|
-
}
|
|
56101
|
+
if (raw) {}
|
|
56187
56102
|
const margin_range = this.get_margin_range(current_price, kind);
|
|
56188
56103
|
let margin_zones = this.get_margin_zones({ current_price });
|
|
56189
56104
|
let remaining_zones = margin_zones.filter((x) => JSON.stringify(x) != JSON.stringify(margin_range));
|
|
@@ -56410,8 +56325,7 @@ class Signal {
|
|
|
56410
56325
|
return true;
|
|
56411
56326
|
});
|
|
56412
56327
|
let total_orders = limit_trades.concat(market_trades);
|
|
56413
|
-
if (kind === "short") {
|
|
56414
|
-
}
|
|
56328
|
+
if (kind === "short") {}
|
|
56415
56329
|
if (this.minimum_size && total_orders.length > 0) {
|
|
56416
56330
|
let payload = total_orders;
|
|
56417
56331
|
let greater_than_min_size = total_orders.filter((o) => o ? o.quantity >= this.minimum_size : true);
|
|
@@ -56497,8 +56411,7 @@ class Signal {
|
|
|
56497
56411
|
});
|
|
56498
56412
|
const multiplier = start - index;
|
|
56499
56413
|
const incurred_fees = fees.reduce((a, b) => a + b, 0) + previous_risks.reduce((a, b) => a + b, 0);
|
|
56500
|
-
if (index === 0) {
|
|
56501
|
-
}
|
|
56414
|
+
if (index === 0) {}
|
|
56502
56415
|
let quantity = determine_position_size({
|
|
56503
56416
|
entry,
|
|
56504
56417
|
stop,
|
|
@@ -56884,8 +56797,7 @@ function buildConfig(app_config, {
|
|
|
56884
56797
|
return [];
|
|
56885
56798
|
}
|
|
56886
56799
|
const condition = (kind === "long" ? entry > app_config.support : entry >= app_config.support) && stop >= app_config.support * 0.999;
|
|
56887
|
-
if (kind === "short") {
|
|
56888
|
-
}
|
|
56800
|
+
if (kind === "short") {}
|
|
56889
56801
|
console.log({ entry, stop, condition, working_risk, config: config2 });
|
|
56890
56802
|
const result = entry === stop ? [] : condition ? instance.build_entry({
|
|
56891
56803
|
current_price: entry,
|
|
@@ -57922,6 +57834,31 @@ function constructAppConfig(payload) {
|
|
|
57922
57834
|
const appConfig = buildAppConfig(global_config, options);
|
|
57923
57835
|
return appConfig;
|
|
57924
57836
|
}
|
|
57837
|
+
function generateDangerousConfig(payload) {
|
|
57838
|
+
const { account, global_config, config: config2 } = payload;
|
|
57839
|
+
const app_config = constructAppConfig({
|
|
57840
|
+
account,
|
|
57841
|
+
global_config,
|
|
57842
|
+
kelly_config: {}
|
|
57843
|
+
});
|
|
57844
|
+
const { optimal_risk, optimal_stop } = getOptimumStopAndRisk(app_config, {
|
|
57845
|
+
max_size: config2.quantity,
|
|
57846
|
+
target_stop: config2.stop
|
|
57847
|
+
});
|
|
57848
|
+
const optimumRiskReward = computeRiskReward({
|
|
57849
|
+
app_config,
|
|
57850
|
+
entry: config2.entry,
|
|
57851
|
+
stop: optimal_stop,
|
|
57852
|
+
risk_per_trade: optimal_risk,
|
|
57853
|
+
target_loss: optimal_risk
|
|
57854
|
+
});
|
|
57855
|
+
return {
|
|
57856
|
+
entry: config2.entry,
|
|
57857
|
+
risk: optimal_risk,
|
|
57858
|
+
stop: optimal_stop,
|
|
57859
|
+
risk_reward: optimumRiskReward
|
|
57860
|
+
};
|
|
57861
|
+
}
|
|
57925
57862
|
// src/helpers/strategy.ts
|
|
57926
57863
|
class Strategy {
|
|
57927
57864
|
position;
|
|
@@ -58993,8 +58930,7 @@ async function createLimitPurchaseOrdersParallel(client, symbol, priceFormat, qu
|
|
|
58993
58930
|
const splitOrders = (inputOrders) => {
|
|
58994
58931
|
const result = [];
|
|
58995
58932
|
for (const o of inputOrders) {
|
|
58996
|
-
if (o.take_profit) {
|
|
58997
|
-
}
|
|
58933
|
+
if (o.take_profit) {}
|
|
58998
58934
|
if (o.stop && !o.side) {
|
|
58999
58935
|
result.push({
|
|
59000
58936
|
price: o.price,
|
|
@@ -59889,8 +59825,7 @@ async function createLimitPurchaseOrders(client, symbol, priceFormat, quantityFo
|
|
|
59889
59825
|
const splitOrders = (inputOrders) => {
|
|
59890
59826
|
const result = [];
|
|
59891
59827
|
for (const o of inputOrders) {
|
|
59892
|
-
if (o.take_profit) {
|
|
59893
|
-
}
|
|
59828
|
+
if (o.take_profit) {}
|
|
59894
59829
|
if (o.stop && !o.side) {
|
|
59895
59830
|
result.push({
|
|
59896
59831
|
price: o.price,
|
|
@@ -60442,10 +60377,8 @@ class BybitExchange extends BaseExchange {
|
|
|
60442
60377
|
sellLeverage: payload.leverage.toString()
|
|
60443
60378
|
});
|
|
60444
60379
|
}
|
|
60445
|
-
async generateConfig(payload) {
|
|
60446
|
-
}
|
|
60447
|
-
async checkDelistedMovers(payload) {
|
|
60448
|
-
}
|
|
60380
|
+
async generateConfig(payload) {}
|
|
60381
|
+
async checkDelistedMovers(payload) {}
|
|
60449
60382
|
async getAllOpenOrders() {
|
|
60450
60383
|
const result = await getAllOpenOrders2({ client: this.client });
|
|
60451
60384
|
return result;
|
|
@@ -60456,13 +60389,11 @@ class BybitExchange extends BaseExchange {
|
|
|
60456
60389
|
async getDelistedSpotSymbols() {
|
|
60457
60390
|
return [];
|
|
60458
60391
|
}
|
|
60459
|
-
async crossAccountTransfer(payload) {
|
|
60460
|
-
}
|
|
60392
|
+
async crossAccountTransfer(payload) {}
|
|
60461
60393
|
getOpenOrders(payload) {
|
|
60462
60394
|
return getOpenOrders2(this.client, payload.symbol);
|
|
60463
60395
|
}
|
|
60464
|
-
async placeBadStopEntry(payload) {
|
|
60465
|
-
}
|
|
60396
|
+
async placeBadStopEntry(payload) {}
|
|
60466
60397
|
}
|
|
60467
60398
|
|
|
60468
60399
|
// src/helpers/accounts.ts
|
|
@@ -60569,14 +60500,24 @@ function build_reduce_config(payload) {
|
|
|
60569
60500
|
} = payload;
|
|
60570
60501
|
const long_position = _positions.find((x) => x.kind === "long");
|
|
60571
60502
|
const short_position = _positions.find((x) => x.kind === "short");
|
|
60503
|
+
let long_target_pnl = long_position?.target_pnl || 0;
|
|
60504
|
+
let short_target_pnl = short_position?.target_pnl || 0;
|
|
60505
|
+
if (long_config.profit_percent && long_position?.entry) {
|
|
60506
|
+
const sell_price = (1 + long_config.profit_percent / 100) * long_position.entry;
|
|
60507
|
+
long_target_pnl = Math.abs(sell_price - long_position.entry) * long_position.quantity;
|
|
60508
|
+
}
|
|
60509
|
+
if (short_config.profit_percent && short_position?.entry) {
|
|
60510
|
+
const buy_price = (1 - short_config.profit_percent / 100) * short_position.entry;
|
|
60511
|
+
short_target_pnl = Math.abs(short_position.entry - buy_price) * short_position.quantity;
|
|
60512
|
+
}
|
|
60572
60513
|
return {
|
|
60573
60514
|
trigger_short: true,
|
|
60574
60515
|
trigger_long: true,
|
|
60575
60516
|
symbol,
|
|
60576
60517
|
short_minimum_pnl,
|
|
60577
60518
|
long_minimum_pnl,
|
|
60578
|
-
short_profit:
|
|
60579
|
-
long_profit:
|
|
60519
|
+
short_profit: short_target_pnl,
|
|
60520
|
+
long_profit: long_target_pnl,
|
|
60580
60521
|
owner: account.owner,
|
|
60581
60522
|
exchange: account.exchange,
|
|
60582
60523
|
not_reduce,
|
|
@@ -60893,6 +60834,10 @@ class ExchangePosition {
|
|
|
60893
60834
|
if (this.instance.expand.proxy) {
|
|
60894
60835
|
const result = this.instance.expand.proxy;
|
|
60895
60836
|
const { type, ip_address } = result;
|
|
60837
|
+
console.log("exchange", {
|
|
60838
|
+
owner: this.account.owner,
|
|
60839
|
+
exchange: this.account.exchange
|
|
60840
|
+
});
|
|
60896
60841
|
console.log("position", type, ip_address);
|
|
60897
60842
|
if (type === "http") {
|
|
60898
60843
|
return new import_https_proxy_agent2.HttpsProxyAgent(`http://${ip_address}`);
|
|
@@ -60931,7 +60876,7 @@ class ExchangePosition {
|
|
|
60931
60876
|
if (payload?.params) {
|
|
60932
60877
|
const db_position = this.instance;
|
|
60933
60878
|
if (db_position) {
|
|
60934
|
-
const config2 = db_position.expand?.
|
|
60879
|
+
const config2 = db_position.expand?.b_config;
|
|
60935
60880
|
const params = {
|
|
60936
60881
|
entry: payload.params.entry !== undefined ? payload.params.entry : config2?.entry,
|
|
60937
60882
|
stop: payload.params.stop !== undefined ? payload.params.stop : config2?.stop,
|
|
@@ -61312,7 +61257,6 @@ class ExchangePosition {
|
|
|
61312
61257
|
place
|
|
61313
61258
|
});
|
|
61314
61259
|
}
|
|
61315
|
-
const rr = await this.refresh(true);
|
|
61316
61260
|
await this.updateConfigPnl();
|
|
61317
61261
|
if (tp) {
|
|
61318
61262
|
await this.exchange_account.placeProfitAndStop({
|
|
@@ -61322,7 +61266,6 @@ class ExchangePosition {
|
|
|
61322
61266
|
});
|
|
61323
61267
|
}
|
|
61324
61268
|
return [];
|
|
61325
|
-
return rr.existingOrders;
|
|
61326
61269
|
}
|
|
61327
61270
|
async placeStopLimit(payload) {
|
|
61328
61271
|
const { place, stop, quantity: _quantity } = payload;
|
|
@@ -61796,14 +61739,29 @@ class ExchangePosition {
|
|
|
61796
61739
|
});
|
|
61797
61740
|
}
|
|
61798
61741
|
const last_order = focus_position.instance.last_order;
|
|
61799
|
-
|
|
61800
|
-
if (this.
|
|
61801
|
-
|
|
61802
|
-
|
|
61803
|
-
|
|
61804
|
-
|
|
61742
|
+
let take_profit;
|
|
61743
|
+
if (this.instance.tp?.price) {
|
|
61744
|
+
take_profit = to_f(this.instance.tp?.price, this.symbol_config.price_places);
|
|
61745
|
+
if (this.kind === "short" && last_order && take_profit) {
|
|
61746
|
+
const reduce_ratio = take_profit < last_order ? 1 : 0;
|
|
61747
|
+
await this.getConfig({
|
|
61748
|
+
params: {
|
|
61749
|
+
reduce_ratio
|
|
61750
|
+
}
|
|
61751
|
+
});
|
|
61752
|
+
}
|
|
61753
|
+
if (this.instance.quantity > 0) {
|
|
61754
|
+
if (focus_position.kind === "long" && focus_position.instance.stop_loss && take_profit > focus_position.appConfig.stop && focus_position.instance.stop_loss?.price) {
|
|
61755
|
+
await focus_position.cancelExchangeOrder({
|
|
61756
|
+
type: "stop"
|
|
61757
|
+
});
|
|
61805
61758
|
}
|
|
61806
|
-
|
|
61759
|
+
if (focus_position.kind === "short" && focus_position.instance.stop_loss && take_profit < focus_position.appConfig.stop && focus_position.instance.stop_loss?.price) {
|
|
61760
|
+
await focus_position.cancelExchangeOrder({
|
|
61761
|
+
type: "stop"
|
|
61762
|
+
});
|
|
61763
|
+
}
|
|
61764
|
+
}
|
|
61807
61765
|
}
|
|
61808
61766
|
return { profit_percent, take_profit, last_order };
|
|
61809
61767
|
}
|
|
@@ -61831,6 +61789,21 @@ class ExchangePosition {
|
|
|
61831
61789
|
}
|
|
61832
61790
|
return result;
|
|
61833
61791
|
}
|
|
61792
|
+
placeDangerousTrade(payload) {
|
|
61793
|
+
const { ...rest } = payload;
|
|
61794
|
+
const expected_quantity = rest.quantity;
|
|
61795
|
+
const entry = rest.entry;
|
|
61796
|
+
const stop = rest.stop;
|
|
61797
|
+
return generateDangerousConfig({
|
|
61798
|
+
account: this.instance,
|
|
61799
|
+
global_config: this.symbol_config,
|
|
61800
|
+
config: {
|
|
61801
|
+
entry,
|
|
61802
|
+
stop,
|
|
61803
|
+
quantity: expected_quantity
|
|
61804
|
+
}
|
|
61805
|
+
});
|
|
61806
|
+
}
|
|
61834
61807
|
}
|
|
61835
61808
|
function convert_to_exchange_order(order) {
|
|
61836
61809
|
return {
|
|
@@ -61896,8 +61869,7 @@ class ExchangeAccount {
|
|
|
61896
61869
|
async initializePositions(payload) {
|
|
61897
61870
|
const raw_positions = await this.syncAccount({
|
|
61898
61871
|
update: payload.update,
|
|
61899
|
-
symbol: payload.symbol
|
|
61900
|
-
live_refresh: payload.update
|
|
61872
|
+
symbol: payload.symbol
|
|
61901
61873
|
});
|
|
61902
61874
|
const positions = await this.syncAccount({
|
|
61903
61875
|
symbol: payload.symbol,
|
|
@@ -61909,6 +61881,7 @@ class ExchangeAccount {
|
|
|
61909
61881
|
const active_account = await this.getActiveAccount({
|
|
61910
61882
|
symbol: payload.symbol
|
|
61911
61883
|
});
|
|
61884
|
+
console.log("active_account", payload);
|
|
61912
61885
|
const long_position = positions.find((x) => x.kind === "long");
|
|
61913
61886
|
const short_position = positions.find((x) => x.kind === "short");
|
|
61914
61887
|
this.long_position = new ExchangePosition({
|
|
@@ -61984,6 +61957,9 @@ class ExchangeAccount {
|
|
|
61984
61957
|
});
|
|
61985
61958
|
if (options.kind) {
|
|
61986
61959
|
let position2 = db_positions2.find((x) => x.kind === options.kind);
|
|
61960
|
+
if (position2.symbol !== symbol) {
|
|
61961
|
+
throw new Error("Symbol mismatch");
|
|
61962
|
+
}
|
|
61987
61963
|
return position2;
|
|
61988
61964
|
}
|
|
61989
61965
|
return db_positions2;
|
|
@@ -61994,7 +61970,11 @@ class ExchangeAccount {
|
|
|
61994
61970
|
leverage: options.leverage
|
|
61995
61971
|
});
|
|
61996
61972
|
if (options.kind) {
|
|
61997
|
-
|
|
61973
|
+
const result = db_positions.find((x) => x.kind === options.kind);
|
|
61974
|
+
if (result.symbol !== symbol) {
|
|
61975
|
+
throw new Error("Symbol mismatch");
|
|
61976
|
+
}
|
|
61977
|
+
return result;
|
|
61998
61978
|
}
|
|
61999
61979
|
return db_positions;
|
|
62000
61980
|
}
|
|
@@ -62049,14 +62029,18 @@ class ExchangeAccount {
|
|
|
62049
62029
|
}
|
|
62050
62030
|
async getFocusPosition(payload) {
|
|
62051
62031
|
const { symbol, kind, update = false } = payload;
|
|
62032
|
+
console.log("payload", payload);
|
|
62052
62033
|
let focus_position = kind === "long" ? this.long_position : this.short_position;
|
|
62053
|
-
if (!focus_position) {
|
|
62034
|
+
if (!focus_position || focus_position.symbol !== symbol) {
|
|
62054
62035
|
focus_position = await this.initializePositions({
|
|
62055
62036
|
symbol,
|
|
62056
62037
|
kind,
|
|
62057
62038
|
update
|
|
62058
62039
|
});
|
|
62059
62040
|
}
|
|
62041
|
+
if (focus_position.symbol !== symbol) {
|
|
62042
|
+
throw new Error("Symbol mismatch");
|
|
62043
|
+
}
|
|
62060
62044
|
return focus_position;
|
|
62061
62045
|
}
|
|
62062
62046
|
async cancelOrders(payload) {
|
|
@@ -62175,7 +62159,10 @@ class ExchangeAccount {
|
|
|
62175
62159
|
return await focus_position.getOrCreatePositionConfig(payload);
|
|
62176
62160
|
}
|
|
62177
62161
|
async getPositionConfig(payload) {
|
|
62178
|
-
const focus_position = await this.getFocusPosition(
|
|
62162
|
+
const focus_position = await this.getFocusPosition({
|
|
62163
|
+
...payload,
|
|
62164
|
+
update: !Boolean(payload.params)
|
|
62165
|
+
});
|
|
62179
62166
|
return await focus_position.getConfig({
|
|
62180
62167
|
params: payload.params
|
|
62181
62168
|
});
|
|
@@ -62210,6 +62197,7 @@ class ExchangeAccount {
|
|
|
62210
62197
|
long_config,
|
|
62211
62198
|
short_config
|
|
62212
62199
|
});
|
|
62200
|
+
console.log("config", config2);
|
|
62213
62201
|
if (!long_config || !short_config) {
|
|
62214
62202
|
return null;
|
|
62215
62203
|
}
|
|
@@ -63252,10 +63240,19 @@ class ExchangeAccount {
|
|
|
63252
63240
|
const focus_position = await this.getFocusPosition(payload);
|
|
63253
63241
|
return await focus_position.placeStopLimit(payload);
|
|
63254
63242
|
}
|
|
63243
|
+
async placeDangerousTrade(payload) {
|
|
63244
|
+
const { symbol, config: config2, kind } = payload;
|
|
63245
|
+
const focus_position = await this.getFocusPosition({
|
|
63246
|
+
symbol,
|
|
63247
|
+
kind
|
|
63248
|
+
});
|
|
63249
|
+
return focus_position.placeDangerousTrade(config2);
|
|
63250
|
+
}
|
|
63255
63251
|
async placeTrade(payload) {
|
|
63256
63252
|
const focus_position = await this.getFocusPosition({
|
|
63257
63253
|
symbol: payload.symbol,
|
|
63258
|
-
kind: payload.kind
|
|
63254
|
+
kind: payload.kind,
|
|
63255
|
+
update: true
|
|
63259
63256
|
});
|
|
63260
63257
|
return await focus_position.placeTrade(payload);
|
|
63261
63258
|
}
|
|
@@ -63314,8 +63311,13 @@ class ExchangeAccount {
|
|
|
63314
63311
|
const opposite_config = focus_position.getOppositeConfig({
|
|
63315
63312
|
ratio: reward_factor
|
|
63316
63313
|
});
|
|
63314
|
+
console.log("opposite_config", opposite_config);
|
|
63317
63315
|
const reverse_config = await reversePosition.getConfig();
|
|
63318
|
-
|
|
63316
|
+
let condition = (reverse_config.entry !== opposite_config.entry || reverse_config.stop !== opposite_config.stop || reverse_config.risk !== opposite_config.risk || reverse_config.risk_reward !== opposite_config.risk_reward) && focus_position.getInstance().quantity > 0;
|
|
63317
|
+
if (reversePosition.getInstance().quantity === 0 && focus_position.getInstance().quantity > 0) {
|
|
63318
|
+
condition = true;
|
|
63319
|
+
}
|
|
63320
|
+
if (condition) {
|
|
63319
63321
|
console.log("Updating reverse config for ", symbol, kind, "with opposite config", opposite_config);
|
|
63320
63322
|
await reversePosition.getConfig({
|
|
63321
63323
|
params: {
|
|
@@ -63483,8 +63485,7 @@ class ExchangeAccount {
|
|
|
63483
63485
|
full_ratio
|
|
63484
63486
|
});
|
|
63485
63487
|
}
|
|
63486
|
-
async placeCompoundShortTrade(payload) {
|
|
63487
|
-
}
|
|
63488
|
+
async placeCompoundShortTrade(payload) {}
|
|
63488
63489
|
async placeCompoundLongTrade(payload) {
|
|
63489
63490
|
const { symbol, params, place = false } = payload;
|
|
63490
63491
|
if (place) {
|