@gbozee/ultimate 0.0.2-121 → 0.0.2-123
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/frontend-index.js +1318 -0
- package/dist/frontend-index.js +14 -7
- package/dist/index.cjs +199 -96
- package/dist/index.d.ts +10 -5
- package/dist/index.js +207 -100
- package/dist/mcp-client.cjs +50 -25
- package/dist/mcp-client.js +50 -25
- package/dist/mcp-server.cjs +205 -99
- package/dist/mcp-server.js +213 -103
- package/dist/mcp.d.ts +5 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -580,7 +580,8 @@ 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 {
|
|
583
|
+
} catch {
|
|
584
|
+
}
|
|
584
585
|
if (!macCheckPassed) {
|
|
585
586
|
throw new JWEDecryptionFailed;
|
|
586
587
|
}
|
|
@@ -588,7 +589,8 @@ function cbcDecrypt(enc, cek, ciphertext, iv, tag, aad) {
|
|
|
588
589
|
try {
|
|
589
590
|
const decipher = import_node_crypto6.createDecipheriv(algorithm, encKey, iv);
|
|
590
591
|
plaintext = concat(decipher.update(ciphertext), decipher.final());
|
|
591
|
-
} catch {
|
|
592
|
+
} catch {
|
|
593
|
+
}
|
|
592
594
|
if (!plaintext) {
|
|
593
595
|
throw new JWEDecryptionFailed;
|
|
594
596
|
}
|
|
@@ -767,7 +769,8 @@ function isPublicJWK(key) {
|
|
|
767
769
|
function isSecretJWK(key) {
|
|
768
770
|
return isJWK(key) && key.kty === "oct" && typeof key.k === "string";
|
|
769
771
|
}
|
|
770
|
-
var init_is_jwk = () => {
|
|
772
|
+
var init_is_jwk = () => {
|
|
773
|
+
};
|
|
771
774
|
|
|
772
775
|
// node_modules/jose/dist/node/esm/runtime/get_named_curve.js
|
|
773
776
|
var import_node_crypto8, weakMap, namedCurveToJOSE = (namedCurve) => {
|
|
@@ -949,7 +952,8 @@ var import_node_crypto11, check_key_length_default = (key, alg) => {
|
|
|
949
952
|
} else {
|
|
950
953
|
modulusLength = Buffer.from(key.n, "base64url").byteLength << 3;
|
|
951
954
|
}
|
|
952
|
-
} catch {
|
|
955
|
+
} catch {
|
|
956
|
+
}
|
|
953
957
|
if (typeof modulusLength !== "number" || modulusLength < 2048) {
|
|
954
958
|
throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`);
|
|
955
959
|
}
|
|
@@ -1710,7 +1714,8 @@ async function generalDecrypt(jwe, key, options) {
|
|
|
1710
1714
|
tag: jwe.tag,
|
|
1711
1715
|
unprotected: jwe.unprotected
|
|
1712
1716
|
}, key, options);
|
|
1713
|
-
} catch {
|
|
1717
|
+
} catch {
|
|
1718
|
+
}
|
|
1714
1719
|
}
|
|
1715
1720
|
throw new JWEDecryptionFailed;
|
|
1716
1721
|
}
|
|
@@ -2596,7 +2601,8 @@ async function generalVerify(jws, key, options) {
|
|
|
2596
2601
|
protected: signature.protected,
|
|
2597
2602
|
signature: signature.signature
|
|
2598
2603
|
}, key, options);
|
|
2599
|
-
} catch {
|
|
2604
|
+
} catch {
|
|
2605
|
+
}
|
|
2600
2606
|
}
|
|
2601
2607
|
throw new JWSSignatureVerificationFailed;
|
|
2602
2608
|
}
|
|
@@ -2679,7 +2685,8 @@ var normalizeTyp = (value) => value.toLowerCase().replace(/^application\//, ""),
|
|
|
2679
2685
|
let payload;
|
|
2680
2686
|
try {
|
|
2681
2687
|
payload = JSON.parse(decoder.decode(encodedPayload));
|
|
2682
|
-
} catch {
|
|
2688
|
+
} catch {
|
|
2689
|
+
}
|
|
2683
2690
|
if (!isObject(payload)) {
|
|
2684
2691
|
throw new JWTInvalid("JWT Claims Set must be a top-level JSON object");
|
|
2685
2692
|
}
|
|
@@ -3364,7 +3371,8 @@ class LocalJWKSet {
|
|
|
3364
3371
|
for (const jwk2 of candidates) {
|
|
3365
3372
|
try {
|
|
3366
3373
|
yield await importWithAlgCache(_cached, jwk2, alg);
|
|
3367
|
-
} catch {
|
|
3374
|
+
} catch {
|
|
3375
|
+
}
|
|
3368
3376
|
}
|
|
3369
3377
|
};
|
|
3370
3378
|
throw error;
|
|
@@ -3911,7 +3919,8 @@ var require_util = __commonJS((exports2) => {
|
|
|
3911
3919
|
var util4;
|
|
3912
3920
|
(function(util5) {
|
|
3913
3921
|
util5.assertEqual = (val) => val;
|
|
3914
|
-
function assertIs(_arg) {
|
|
3922
|
+
function assertIs(_arg) {
|
|
3923
|
+
}
|
|
3915
3924
|
util5.assertIs = assertIs;
|
|
3916
3925
|
function assertNever(_x) {
|
|
3917
3926
|
throw new Error;
|
|
@@ -6327,7 +6336,8 @@ var require_types = __commonJS((exports2) => {
|
|
|
6327
6336
|
});
|
|
6328
6337
|
status.dirty();
|
|
6329
6338
|
}
|
|
6330
|
-
} else if (unknownKeys === "strip") {
|
|
6339
|
+
} else if (unknownKeys === "strip") {
|
|
6340
|
+
} else {
|
|
6331
6341
|
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
|
6332
6342
|
}
|
|
6333
6343
|
} else {
|
|
@@ -8479,7 +8489,8 @@ var require_logLevelLogger = __commonJS((exports2) => {
|
|
|
8479
8489
|
if (typeof theFunc === "function" && maxLevel >= theLevel) {
|
|
8480
8490
|
return theFunc.bind(logger);
|
|
8481
8491
|
}
|
|
8482
|
-
return function() {
|
|
8492
|
+
return function() {
|
|
8493
|
+
};
|
|
8483
8494
|
}
|
|
8484
8495
|
return {
|
|
8485
8496
|
error: _filterFunc("error", types_1.DiagLogLevel.ERROR),
|
|
@@ -8704,7 +8715,8 @@ var require_NoopMeter = __commonJS((exports2) => {
|
|
|
8704
8715
|
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;
|
|
8705
8716
|
|
|
8706
8717
|
class NoopMeter {
|
|
8707
|
-
constructor() {
|
|
8718
|
+
constructor() {
|
|
8719
|
+
}
|
|
8708
8720
|
createGauge(_name, _options) {
|
|
8709
8721
|
return exports2.NOOP_GAUGE_METRIC;
|
|
8710
8722
|
}
|
|
@@ -8726,8 +8738,10 @@ var require_NoopMeter = __commonJS((exports2) => {
|
|
|
8726
8738
|
createObservableUpDownCounter(_name, _options) {
|
|
8727
8739
|
return exports2.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;
|
|
8728
8740
|
}
|
|
8729
|
-
addBatchObservableCallback(_callback, _observables) {
|
|
8730
|
-
|
|
8741
|
+
addBatchObservableCallback(_callback, _observables) {
|
|
8742
|
+
}
|
|
8743
|
+
removeBatchObservableCallback(_callback) {
|
|
8744
|
+
}
|
|
8731
8745
|
}
|
|
8732
8746
|
exports2.NoopMeter = NoopMeter;
|
|
8733
8747
|
|
|
@@ -8736,28 +8750,34 @@ var require_NoopMeter = __commonJS((exports2) => {
|
|
|
8736
8750
|
exports2.NoopMetric = NoopMetric;
|
|
8737
8751
|
|
|
8738
8752
|
class NoopCounterMetric extends NoopMetric {
|
|
8739
|
-
add(_value, _attributes) {
|
|
8753
|
+
add(_value, _attributes) {
|
|
8754
|
+
}
|
|
8740
8755
|
}
|
|
8741
8756
|
exports2.NoopCounterMetric = NoopCounterMetric;
|
|
8742
8757
|
|
|
8743
8758
|
class NoopUpDownCounterMetric extends NoopMetric {
|
|
8744
|
-
add(_value, _attributes) {
|
|
8759
|
+
add(_value, _attributes) {
|
|
8760
|
+
}
|
|
8745
8761
|
}
|
|
8746
8762
|
exports2.NoopUpDownCounterMetric = NoopUpDownCounterMetric;
|
|
8747
8763
|
|
|
8748
8764
|
class NoopGaugeMetric extends NoopMetric {
|
|
8749
|
-
record(_value, _attributes) {
|
|
8765
|
+
record(_value, _attributes) {
|
|
8766
|
+
}
|
|
8750
8767
|
}
|
|
8751
8768
|
exports2.NoopGaugeMetric = NoopGaugeMetric;
|
|
8752
8769
|
|
|
8753
8770
|
class NoopHistogramMetric extends NoopMetric {
|
|
8754
|
-
record(_value, _attributes) {
|
|
8771
|
+
record(_value, _attributes) {
|
|
8772
|
+
}
|
|
8755
8773
|
}
|
|
8756
8774
|
exports2.NoopHistogramMetric = NoopHistogramMetric;
|
|
8757
8775
|
|
|
8758
8776
|
class NoopObservableMetric {
|
|
8759
|
-
addCallback(_callback) {
|
|
8760
|
-
|
|
8777
|
+
addCallback(_callback) {
|
|
8778
|
+
}
|
|
8779
|
+
removeCallback(_callback) {
|
|
8780
|
+
}
|
|
8761
8781
|
}
|
|
8762
8782
|
exports2.NoopObservableMetric = NoopObservableMetric;
|
|
8763
8783
|
|
|
@@ -8862,7 +8882,8 @@ var require_context2 = __commonJS((exports2) => {
|
|
|
8862
8882
|
var NOOP_CONTEXT_MANAGER = new NoopContextManager_1.NoopContextManager;
|
|
8863
8883
|
|
|
8864
8884
|
class ContextAPI {
|
|
8865
|
-
constructor() {
|
|
8885
|
+
constructor() {
|
|
8886
|
+
}
|
|
8866
8887
|
static getInstance() {
|
|
8867
8888
|
if (!this._instance) {
|
|
8868
8889
|
this._instance = new ContextAPI;
|
|
@@ -8951,11 +8972,13 @@ var require_NonRecordingSpan = __commonJS((exports2) => {
|
|
|
8951
8972
|
updateName(_name) {
|
|
8952
8973
|
return this;
|
|
8953
8974
|
}
|
|
8954
|
-
end(_endTime) {
|
|
8975
|
+
end(_endTime) {
|
|
8976
|
+
}
|
|
8955
8977
|
isRecording() {
|
|
8956
8978
|
return false;
|
|
8957
8979
|
}
|
|
8958
|
-
recordException(_exception, _time) {
|
|
8980
|
+
recordException(_exception, _time) {
|
|
8981
|
+
}
|
|
8959
8982
|
}
|
|
8960
8983
|
exports2.NonRecordingSpan = NonRecordingSpan;
|
|
8961
8984
|
});
|
|
@@ -9257,7 +9280,8 @@ var require_tracestate_impl = __commonJS((exports2) => {
|
|
|
9257
9280
|
const value = listMember.slice(i + 1, part.length);
|
|
9258
9281
|
if ((0, tracestate_validators_1.validateKey)(key) && (0, tracestate_validators_1.validateValue)(value)) {
|
|
9259
9282
|
agg.set(key, value);
|
|
9260
|
-
} else {
|
|
9283
|
+
} else {
|
|
9284
|
+
}
|
|
9261
9285
|
}
|
|
9262
9286
|
return agg;
|
|
9263
9287
|
}, new Map);
|
|
@@ -9329,7 +9353,8 @@ var require_metrics = __commonJS((exports2) => {
|
|
|
9329
9353
|
var API_NAME2 = "metrics";
|
|
9330
9354
|
|
|
9331
9355
|
class MetricsAPI {
|
|
9332
|
-
constructor() {
|
|
9356
|
+
constructor() {
|
|
9357
|
+
}
|
|
9333
9358
|
static getInstance() {
|
|
9334
9359
|
if (!this._instance) {
|
|
9335
9360
|
this._instance = new MetricsAPI;
|
|
@@ -9366,7 +9391,8 @@ var require_NoopTextMapPropagator = __commonJS((exports2) => {
|
|
|
9366
9391
|
exports2.NoopTextMapPropagator = undefined;
|
|
9367
9392
|
|
|
9368
9393
|
class NoopTextMapPropagator {
|
|
9369
|
-
inject(_context, _carrier) {
|
|
9394
|
+
inject(_context, _carrier) {
|
|
9395
|
+
}
|
|
9370
9396
|
extract(context, _carrier) {
|
|
9371
9397
|
return context;
|
|
9372
9398
|
}
|
|
@@ -9679,7 +9705,8 @@ class Registry {
|
|
|
9679
9705
|
return this.kv.getByKey(identifier);
|
|
9680
9706
|
}
|
|
9681
9707
|
}
|
|
9682
|
-
var init_registry = () => {
|
|
9708
|
+
var init_registry = () => {
|
|
9709
|
+
};
|
|
9683
9710
|
|
|
9684
9711
|
// node_modules/superjson/dist/class-registry.js
|
|
9685
9712
|
var ClassRegistry;
|
|
@@ -9764,7 +9791,8 @@ class CustomTransformerRegistry {
|
|
|
9764
9791
|
return this.transfomers[name2];
|
|
9765
9792
|
}
|
|
9766
9793
|
}
|
|
9767
|
-
var init_custom_transformer_registry = () => {
|
|
9794
|
+
var init_custom_transformer_registry = () => {
|
|
9795
|
+
};
|
|
9768
9796
|
|
|
9769
9797
|
// node_modules/superjson/dist/is.js
|
|
9770
9798
|
var getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1), isUndefined = (payload) => typeof payload === "undefined", isNull = (payload) => payload === null, isPlainObject = (payload) => {
|
|
@@ -10109,7 +10137,8 @@ var getNthKey = (value, n) => {
|
|
|
10109
10137
|
}
|
|
10110
10138
|
return object;
|
|
10111
10139
|
};
|
|
10112
|
-
var init_accessDeep = () => {
|
|
10140
|
+
var init_accessDeep = () => {
|
|
10141
|
+
};
|
|
10113
10142
|
|
|
10114
10143
|
// node_modules/superjson/dist/plainer.js
|
|
10115
10144
|
function traverse(tree, walker, origin = []) {
|
|
@@ -10698,7 +10727,8 @@ var require_NoopLogger = __commonJS((exports2) => {
|
|
|
10698
10727
|
exports2.NOOP_LOGGER = exports2.NoopLogger = undefined;
|
|
10699
10728
|
|
|
10700
10729
|
class NoopLogger {
|
|
10701
|
-
emit(_logRecord) {
|
|
10730
|
+
emit(_logRecord) {
|
|
10731
|
+
}
|
|
10702
10732
|
}
|
|
10703
10733
|
exports2.NoopLogger = NoopLogger;
|
|
10704
10734
|
exports2.NOOP_LOGGER = new NoopLogger;
|
|
@@ -10792,7 +10822,8 @@ var require_logs = __commonJS((exports2) => {
|
|
|
10792
10822
|
var NoopLoggerProvider_1 = require_NoopLoggerProvider();
|
|
10793
10823
|
|
|
10794
10824
|
class LogsAPI {
|
|
10795
|
-
constructor() {
|
|
10825
|
+
constructor() {
|
|
10826
|
+
}
|
|
10796
10827
|
static getInstance() {
|
|
10797
10828
|
if (!this._instance) {
|
|
10798
10829
|
this._instance = new LogsAPI;
|
|
@@ -11260,7 +11291,8 @@ var require_browser = __commonJS((exports2, module2) => {
|
|
|
11260
11291
|
});
|
|
11261
11292
|
args.splice(lastC, 0, c);
|
|
11262
11293
|
}
|
|
11263
|
-
exports2.log = console.debug || console.log || (() => {
|
|
11294
|
+
exports2.log = console.debug || console.log || (() => {
|
|
11295
|
+
});
|
|
11264
11296
|
function save(namespaces) {
|
|
11265
11297
|
try {
|
|
11266
11298
|
if (namespaces) {
|
|
@@ -11268,13 +11300,15 @@ var require_browser = __commonJS((exports2, module2) => {
|
|
|
11268
11300
|
} else {
|
|
11269
11301
|
exports2.storage.removeItem("debug");
|
|
11270
11302
|
}
|
|
11271
|
-
} catch (error) {
|
|
11303
|
+
} catch (error) {
|
|
11304
|
+
}
|
|
11272
11305
|
}
|
|
11273
11306
|
function load() {
|
|
11274
11307
|
let r;
|
|
11275
11308
|
try {
|
|
11276
11309
|
r = exports2.storage.getItem("debug");
|
|
11277
|
-
} catch (error) {
|
|
11310
|
+
} catch (error) {
|
|
11311
|
+
}
|
|
11278
11312
|
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
11279
11313
|
r = process.env.DEBUG;
|
|
11280
11314
|
}
|
|
@@ -11283,7 +11317,8 @@ var require_browser = __commonJS((exports2, module2) => {
|
|
|
11283
11317
|
function localstorage() {
|
|
11284
11318
|
try {
|
|
11285
11319
|
return localStorage;
|
|
11286
|
-
} catch (error) {
|
|
11320
|
+
} catch (error) {
|
|
11321
|
+
}
|
|
11287
11322
|
}
|
|
11288
11323
|
module2.exports = require_common()(exports2);
|
|
11289
11324
|
var { formatters } = module2.exports;
|
|
@@ -11415,7 +11450,8 @@ var require_node3 = __commonJS((exports2, module2) => {
|
|
|
11415
11450
|
exports2.save = save;
|
|
11416
11451
|
exports2.load = load;
|
|
11417
11452
|
exports2.useColors = useColors;
|
|
11418
|
-
exports2.destroy = util4.deprecate(() => {
|
|
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`.");
|
|
11419
11455
|
exports2.colors = [6, 2, 3, 4, 5, 1];
|
|
11420
11456
|
try {
|
|
11421
11457
|
const supportsColor = require_supports_color();
|
|
@@ -11499,7 +11535,8 @@ var require_node3 = __commonJS((exports2, module2) => {
|
|
|
11499
11535
|
221
|
|
11500
11536
|
];
|
|
11501
11537
|
}
|
|
11502
|
-
} catch (error) {
|
|
11538
|
+
} catch (error) {
|
|
11539
|
+
}
|
|
11503
11540
|
exports2.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
11504
11541
|
return /^debug_/i.test(key);
|
|
11505
11542
|
}).reduce((obj, key) => {
|
|
@@ -13748,7 +13785,8 @@ var require_jsbn = __commonJS((exports2, module2) => {
|
|
|
13748
13785
|
++this[w];
|
|
13749
13786
|
}
|
|
13750
13787
|
}
|
|
13751
|
-
function NullExp() {
|
|
13788
|
+
function NullExp() {
|
|
13789
|
+
}
|
|
13752
13790
|
function nNop(x) {
|
|
13753
13791
|
return x;
|
|
13754
13792
|
}
|
|
@@ -14173,7 +14211,8 @@ var require_jsbn = __commonJS((exports2, module2) => {
|
|
|
14173
14211
|
for (i2 = 0;i2 < ba.length; ++i2)
|
|
14174
14212
|
ba[i2] = rng_get_byte();
|
|
14175
14213
|
}
|
|
14176
|
-
function SecureRandom() {
|
|
14214
|
+
function SecureRandom() {
|
|
14215
|
+
}
|
|
14177
14216
|
SecureRandom.prototype.nextBytes = rng_get_bytes;
|
|
14178
14217
|
function Arcfour() {
|
|
14179
14218
|
this.i = 0;
|
|
@@ -16396,7 +16435,8 @@ var require_delayed_stream = __commonJS((exports2, module2) => {
|
|
|
16396
16435
|
delayedStream._handleEmit(arguments);
|
|
16397
16436
|
return realEmit.apply(source, arguments);
|
|
16398
16437
|
};
|
|
16399
|
-
source.on("error", function() {
|
|
16438
|
+
source.on("error", function() {
|
|
16439
|
+
});
|
|
16400
16440
|
if (delayedStream.pauseStream) {
|
|
16401
16441
|
source.pause();
|
|
16402
16442
|
}
|
|
@@ -25700,7 +25740,8 @@ var require_implementation = __commonJS((exports2, module2) => {
|
|
|
25700
25740
|
}
|
|
25701
25741
|
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
25702
25742
|
if (target.prototype) {
|
|
25703
|
-
var Empty = function Empty() {
|
|
25743
|
+
var Empty = function Empty() {
|
|
25744
|
+
};
|
|
25704
25745
|
Empty.prototype = target.prototype;
|
|
25705
25746
|
bound.prototype = new Empty;
|
|
25706
25747
|
Empty.prototype = null;
|
|
@@ -25820,7 +25861,8 @@ var require_get_intrinsic = __commonJS((exports2, module2) => {
|
|
|
25820
25861
|
var getEvalledConstructor = function(expressionSyntax) {
|
|
25821
25862
|
try {
|
|
25822
25863
|
return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
|
|
25823
|
-
} catch (e2) {
|
|
25864
|
+
} catch (e2) {
|
|
25865
|
+
}
|
|
25824
25866
|
};
|
|
25825
25867
|
var $gOPD = require_gopd();
|
|
25826
25868
|
var $defineProperty = require_es_define_property();
|
|
@@ -26559,9 +26601,11 @@ var require_debug = __commonJS((exports2, module2) => {
|
|
|
26559
26601
|
if (!debug) {
|
|
26560
26602
|
try {
|
|
26561
26603
|
debug = require_src4()("follow-redirects");
|
|
26562
|
-
} catch (error) {
|
|
26604
|
+
} catch (error) {
|
|
26605
|
+
}
|
|
26563
26606
|
if (typeof debug !== "function") {
|
|
26564
|
-
debug = function() {
|
|
26607
|
+
debug = function() {
|
|
26608
|
+
};
|
|
26565
26609
|
}
|
|
26566
26610
|
}
|
|
26567
26611
|
debug.apply(null, arguments);
|
|
@@ -26936,7 +26980,8 @@ var require_follow_redirects = __commonJS((exports2, module2) => {
|
|
|
26936
26980
|
});
|
|
26937
26981
|
return exports3;
|
|
26938
26982
|
}
|
|
26939
|
-
function noop2() {
|
|
26983
|
+
function noop2() {
|
|
26984
|
+
}
|
|
26940
26985
|
function parseUrl(input) {
|
|
26941
26986
|
var parsed;
|
|
26942
26987
|
if (useNativeURL) {
|
|
@@ -27319,7 +27364,8 @@ var require_axios = __commonJS((exports2, module2) => {
|
|
|
27319
27364
|
isArray3(arrayOrString) ? define2(arrayOrString) : define2(String(arrayOrString).split(delimiter));
|
|
27320
27365
|
return obj;
|
|
27321
27366
|
};
|
|
27322
|
-
var noop2 = () => {
|
|
27367
|
+
var noop2 = () => {
|
|
27368
|
+
};
|
|
27323
27369
|
var toFiniteNumber = (value2, defaultValue) => {
|
|
27324
27370
|
return value2 != null && Number.isFinite(value2 = +value2) ? value2 : defaultValue;
|
|
27325
27371
|
};
|
|
@@ -28772,7 +28818,8 @@ var require_axios = __commonJS((exports2, module2) => {
|
|
|
28772
28818
|
try {
|
|
28773
28819
|
const knownLength = await util__default["default"].promisify(data.getLength).call(data);
|
|
28774
28820
|
Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
|
|
28775
|
-
} catch (e2) {
|
|
28821
|
+
} catch (e2) {
|
|
28822
|
+
}
|
|
28776
28823
|
}
|
|
28777
28824
|
} else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
|
|
28778
28825
|
data.size && headers.setContentType(data.type || "application/octet-stream");
|
|
@@ -29046,11 +29093,13 @@ var require_axios = __commonJS((exports2, module2) => {
|
|
|
29046
29093
|
this.write(name2, "", Date.now() - 86400000);
|
|
29047
29094
|
}
|
|
29048
29095
|
} : {
|
|
29049
|
-
write() {
|
|
29096
|
+
write() {
|
|
29097
|
+
},
|
|
29050
29098
|
read() {
|
|
29051
29099
|
return null;
|
|
29052
29100
|
},
|
|
29053
|
-
remove() {
|
|
29101
|
+
remove() {
|
|
29102
|
+
}
|
|
29054
29103
|
};
|
|
29055
29104
|
var headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
29056
29105
|
function mergeConfig(config1, config2) {
|
|
@@ -29544,7 +29593,8 @@ var require_axios = __commonJS((exports2, module2) => {
|
|
|
29544
29593
|
if (fn) {
|
|
29545
29594
|
try {
|
|
29546
29595
|
Object.defineProperty(fn, "name", { value: value2 });
|
|
29547
|
-
} catch (e2) {
|
|
29596
|
+
} catch (e2) {
|
|
29597
|
+
}
|
|
29548
29598
|
Object.defineProperty(fn, "adapterName", { value: value2 });
|
|
29549
29599
|
}
|
|
29550
29600
|
});
|
|
@@ -29694,7 +29744,8 @@ var require_axios = __commonJS((exports2, module2) => {
|
|
|
29694
29744
|
err.stack += `
|
|
29695
29745
|
` + stack;
|
|
29696
29746
|
}
|
|
29697
|
-
} catch (e2) {
|
|
29747
|
+
} catch (e2) {
|
|
29748
|
+
}
|
|
29698
29749
|
}
|
|
29699
29750
|
throw err;
|
|
29700
29751
|
}
|
|
@@ -31767,7 +31818,8 @@ var require_logger = __commonJS((exports2) => {
|
|
|
31767
31818
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
31768
31819
|
exports2.DefaultLogger = undefined;
|
|
31769
31820
|
exports2.DefaultLogger = {
|
|
31770
|
-
silly: (...params) => {
|
|
31821
|
+
silly: (...params) => {
|
|
31822
|
+
},
|
|
31771
31823
|
debug: (...params) => {
|
|
31772
31824
|
console.log(new Date, params);
|
|
31773
31825
|
},
|
|
@@ -34510,7 +34562,8 @@ var require_constants4 = __commonJS((exports2, module2) => {
|
|
|
34510
34562
|
kListener: Symbol("kListener"),
|
|
34511
34563
|
kStatusCode: Symbol("status-code"),
|
|
34512
34564
|
kWebSocket: Symbol("websocket"),
|
|
34513
|
-
NOOP: () => {
|
|
34565
|
+
NOOP: () => {
|
|
34566
|
+
}
|
|
34514
34567
|
};
|
|
34515
34568
|
});
|
|
34516
34569
|
|
|
@@ -34588,7 +34641,8 @@ var require_buffer_util = __commonJS((exports2, module2) => {
|
|
|
34588
34641
|
else
|
|
34589
34642
|
bufferUtil.unmask(buffer, mask);
|
|
34590
34643
|
};
|
|
34591
|
-
} catch (e2) {
|
|
34644
|
+
} catch (e2) {
|
|
34645
|
+
}
|
|
34592
34646
|
}
|
|
34593
34647
|
});
|
|
34594
34648
|
|
|
@@ -35067,7 +35121,8 @@ var require_validation = __commonJS((exports2, module2) => {
|
|
|
35067
35121
|
module2.exports.isValidUTF8 = function(buf) {
|
|
35068
35122
|
return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
|
|
35069
35123
|
};
|
|
35070
|
-
} catch (e2) {
|
|
35124
|
+
} catch (e2) {
|
|
35125
|
+
}
|
|
35071
35126
|
}
|
|
35072
35127
|
});
|
|
35073
35128
|
|
|
@@ -37497,7 +37552,8 @@ var require_websocket_client = __commonJS((exports2) => {
|
|
|
37497
37552
|
this.options = Object.assign({ pongTimeout: 7500, pingInterval: 1e4, reconnectTimeout: 500 }, options);
|
|
37498
37553
|
this.listenKeyStateStore = {};
|
|
37499
37554
|
this.wsUrlKeyMap = {};
|
|
37500
|
-
this.on("error", () => {
|
|
37555
|
+
this.on("error", () => {
|
|
37556
|
+
});
|
|
37501
37557
|
}
|
|
37502
37558
|
getRestClientOptions() {
|
|
37503
37559
|
return Object.assign(Object.assign(Object.assign({}, this.options), this.options.restOptions), { api_key: this.options.api_key, api_secret: this.options.api_secret });
|
|
@@ -38971,7 +39027,8 @@ var require_logger2 = __commonJS((exports2) => {
|
|
|
38971
39027
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
38972
39028
|
exports2.DefaultLogger = undefined;
|
|
38973
39029
|
exports2.DefaultLogger = {
|
|
38974
|
-
trace: (..._params) => {
|
|
39030
|
+
trace: (..._params) => {
|
|
39031
|
+
},
|
|
38975
39032
|
info: (...params) => {
|
|
38976
39033
|
console.info(params);
|
|
38977
39034
|
},
|
|
@@ -41017,7 +41074,8 @@ var require_BaseWSClient = __commonJS((exports2) => {
|
|
|
41017
41074
|
if (wsState === null || wsState === undefined ? undefined : wsState.activePongTimer) {
|
|
41018
41075
|
clearTimeout(wsState.activePongTimer);
|
|
41019
41076
|
wsState.activePongTimer = undefined;
|
|
41020
|
-
} else {
|
|
41077
|
+
} else {
|
|
41078
|
+
}
|
|
41021
41079
|
}
|
|
41022
41080
|
clearReconnectTimer(wsKey) {
|
|
41023
41081
|
const wsState = this.wsStore.get(wsKey);
|
|
@@ -41931,7 +41989,8 @@ __export(exports_app, {
|
|
|
41931
41989
|
var util;
|
|
41932
41990
|
(function(util2) {
|
|
41933
41991
|
util2.assertEqual = (val) => val;
|
|
41934
|
-
function assertIs(_arg) {
|
|
41992
|
+
function assertIs(_arg) {
|
|
41993
|
+
}
|
|
41935
41994
|
util2.assertIs = assertIs;
|
|
41936
41995
|
function assertNever(_x) {
|
|
41937
41996
|
throw new Error;
|
|
@@ -46792,7 +46851,8 @@ var API_NAME = "task-context";
|
|
|
46792
46851
|
|
|
46793
46852
|
class TaskContextAPI {
|
|
46794
46853
|
static _instance;
|
|
46795
|
-
constructor() {
|
|
46854
|
+
constructor() {
|
|
46855
|
+
}
|
|
46796
46856
|
static getInstance() {
|
|
46797
46857
|
if (!this._instance) {
|
|
46798
46858
|
this._instance = new TaskContextAPI;
|
|
@@ -47212,7 +47272,8 @@ class ParseError extends Error {
|
|
|
47212
47272
|
super(message2), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;
|
|
47213
47273
|
}
|
|
47214
47274
|
}
|
|
47215
|
-
function noop(_arg) {
|
|
47275
|
+
function noop(_arg) {
|
|
47276
|
+
}
|
|
47216
47277
|
function createParser(callbacks) {
|
|
47217
47278
|
if (typeof callbacks == "function")
|
|
47218
47279
|
throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");
|
|
@@ -47415,7 +47476,8 @@ async function _doZodFetchWithRetries(schema, url, requestInit, options, attempt
|
|
|
47415
47476
|
if (error instanceof ApiError) {
|
|
47416
47477
|
throw error;
|
|
47417
47478
|
}
|
|
47418
|
-
if (error instanceof import_zod_validation_error.ValidationError) {
|
|
47479
|
+
if (error instanceof import_zod_validation_error.ValidationError) {
|
|
47480
|
+
}
|
|
47419
47481
|
if (options?.retry) {
|
|
47420
47482
|
const retry = { ...defaultRetryOptions2, ...options.retry };
|
|
47421
47483
|
const delay = calculateNextRetryDelay(retry, attempt);
|
|
@@ -47889,7 +47951,8 @@ class ApiClientMissingError extends Error {
|
|
|
47889
47951
|
|
|
47890
47952
|
class APIClientManagerAPI {
|
|
47891
47953
|
static _instance;
|
|
47892
|
-
constructor() {
|
|
47954
|
+
constructor() {
|
|
47955
|
+
}
|
|
47893
47956
|
static getInstance() {
|
|
47894
47957
|
if (!this._instance) {
|
|
47895
47958
|
this._instance = new APIClientManagerAPI;
|
|
@@ -48444,7 +48507,8 @@ var PrefetchQueue = class {
|
|
|
48444
48507
|
if (__privateGet(this, _queueTailUrl) && !__privateGet(this, _prefetchQueue).has(__privateGet(this, _queueTailUrl))) {
|
|
48445
48508
|
__privateMethod(this, _PrefetchQueue_instances, prefetch_fn).call(this, __privateGet(this, _queueTailUrl), args[1]);
|
|
48446
48509
|
}
|
|
48447
|
-
}).catch(() => {
|
|
48510
|
+
}).catch(() => {
|
|
48511
|
+
});
|
|
48448
48512
|
return request;
|
|
48449
48513
|
}
|
|
48450
48514
|
};
|
|
@@ -48475,8 +48539,10 @@ prefetch_fn = function(...args) {
|
|
|
48475
48539
|
}
|
|
48476
48540
|
__privateSet(this, _queueTailUrl, nextUrl);
|
|
48477
48541
|
return __privateMethod(this, _PrefetchQueue_instances, prefetch_fn).call(this, nextUrl, args[1]);
|
|
48478
|
-
}).catch(() => {
|
|
48479
|
-
|
|
48542
|
+
}).catch(() => {
|
|
48543
|
+
});
|
|
48544
|
+
} catch (_) {
|
|
48545
|
+
}
|
|
48480
48546
|
};
|
|
48481
48547
|
function getNextChunkUrl(url, res) {
|
|
48482
48548
|
const shapeHandle = res.headers.get(SHAPE_HANDLE_HEADER);
|
|
@@ -48579,7 +48645,8 @@ var ShapeStream = class {
|
|
|
48579
48645
|
get lastOffset() {
|
|
48580
48646
|
return __privateGet(this, _lastOffset);
|
|
48581
48647
|
}
|
|
48582
|
-
subscribe(callback, onError = () => {
|
|
48648
|
+
subscribe(callback, onError = () => {
|
|
48649
|
+
}) {
|
|
48583
48650
|
const subscriptionId = Math.random();
|
|
48584
48651
|
__privateGet(this, _subscribers).set(subscriptionId, [callback, onError]);
|
|
48585
48652
|
return () => {
|
|
@@ -49773,7 +49840,8 @@ class SimpleClock {
|
|
|
49773
49840
|
const nowStruct = now.toStruct();
|
|
49774
49841
|
return [nowStruct.seconds, nowStruct.nanos];
|
|
49775
49842
|
}
|
|
49776
|
-
reset() {
|
|
49843
|
+
reset() {
|
|
49844
|
+
}
|
|
49777
49845
|
}
|
|
49778
49846
|
|
|
49779
49847
|
// node_modules/@trigger.dev/core/dist/esm/v3/clock/index.js
|
|
@@ -49782,7 +49850,8 @@ var SIMPLE_CLOCK = new SimpleClock;
|
|
|
49782
49850
|
|
|
49783
49851
|
class ClockAPI {
|
|
49784
49852
|
static _instance;
|
|
49785
|
-
constructor() {
|
|
49853
|
+
constructor() {
|
|
49854
|
+
}
|
|
49786
49855
|
static getInstance() {
|
|
49787
49856
|
if (!this._instance) {
|
|
49788
49857
|
this._instance = new ClockAPI;
|
|
@@ -49808,7 +49877,8 @@ var clock = ClockAPI.getInstance();
|
|
|
49808
49877
|
|
|
49809
49878
|
// node_modules/@trigger.dev/core/dist/esm/v3/usage/noopUsageManager.js
|
|
49810
49879
|
class NoopUsageManager {
|
|
49811
|
-
disable() {
|
|
49880
|
+
disable() {
|
|
49881
|
+
}
|
|
49812
49882
|
start() {
|
|
49813
49883
|
return {
|
|
49814
49884
|
sample: () => ({ cpuTime: 0, wallTime: 0 })
|
|
@@ -49831,7 +49901,8 @@ var NOOP_USAGE_MANAGER = new NoopUsageManager;
|
|
|
49831
49901
|
|
|
49832
49902
|
class UsageAPI {
|
|
49833
49903
|
static _instance;
|
|
49834
|
-
constructor() {
|
|
49904
|
+
constructor() {
|
|
49905
|
+
}
|
|
49835
49906
|
static getInstance() {
|
|
49836
49907
|
if (!this._instance) {
|
|
49837
49908
|
this._instance = new UsageAPI;
|
|
@@ -49891,7 +49962,8 @@ class NoopRunMetadataManager {
|
|
|
49891
49962
|
refresh(requestOptions) {
|
|
49892
49963
|
throw new Error("Method not implemented.");
|
|
49893
49964
|
}
|
|
49894
|
-
enterWithMetadata(metadata) {
|
|
49965
|
+
enterWithMetadata(metadata) {
|
|
49966
|
+
}
|
|
49895
49967
|
current() {
|
|
49896
49968
|
throw new Error("Method not implemented.");
|
|
49897
49969
|
}
|
|
@@ -49947,7 +50019,8 @@ var NOOP_MANAGER = new NoopRunMetadataManager;
|
|
|
49947
50019
|
|
|
49948
50020
|
class RunMetadataAPI {
|
|
49949
50021
|
static _instance;
|
|
49950
|
-
constructor() {
|
|
50022
|
+
constructor() {
|
|
50023
|
+
}
|
|
49951
50024
|
static getInstance() {
|
|
49952
50025
|
if (!this._instance) {
|
|
49953
50026
|
this._instance = new RunMetadataAPI;
|
|
@@ -50032,7 +50105,8 @@ var NOOP_TIMEOUT_MANAGER = new NoopTimeoutManager;
|
|
|
50032
50105
|
|
|
50033
50106
|
class TimeoutAPI {
|
|
50034
50107
|
static _instance;
|
|
50035
|
-
constructor() {
|
|
50108
|
+
constructor() {
|
|
50109
|
+
}
|
|
50036
50110
|
static getInstance() {
|
|
50037
50111
|
if (!this._instance) {
|
|
50038
50112
|
this._instance = new TimeoutAPI;
|
|
@@ -50438,7 +50512,8 @@ function getTokenPayload(e2) {
|
|
|
50438
50512
|
return "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2);
|
|
50439
50513
|
}).join(""));
|
|
50440
50514
|
return JSON.parse(t2) || {};
|
|
50441
|
-
} catch (e3) {
|
|
50515
|
+
} catch (e3) {
|
|
50516
|
+
}
|
|
50442
50517
|
return {};
|
|
50443
50518
|
}
|
|
50444
50519
|
function isTokenExpired(e2, t2 = 0) {
|
|
@@ -50492,7 +50567,8 @@ class BaseAuthStore {
|
|
|
50492
50567
|
let n = {};
|
|
50493
50568
|
try {
|
|
50494
50569
|
n = JSON.parse(s2), (typeof n === null || typeof n != "object" || Array.isArray(n)) && (n = {});
|
|
50495
|
-
} catch (e3) {
|
|
50570
|
+
} catch (e3) {
|
|
50571
|
+
}
|
|
50496
50572
|
this.save(n.token || "", n.record || n.model || null);
|
|
50497
50573
|
}
|
|
50498
50574
|
exportToCookie(e2, t2 = i) {
|
|
@@ -50639,7 +50715,8 @@ class RealtimeService extends BaseService {
|
|
|
50639
50715
|
let i3;
|
|
50640
50716
|
try {
|
|
50641
50717
|
i3 = JSON.parse(s3?.data);
|
|
50642
|
-
} catch {
|
|
50718
|
+
} catch {
|
|
50719
|
+
}
|
|
50643
50720
|
t2(i3 || {});
|
|
50644
50721
|
};
|
|
50645
50722
|
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);
|
|
@@ -51352,7 +51429,8 @@ class Client {
|
|
|
51352
51429
|
let s3 = {};
|
|
51353
51430
|
try {
|
|
51354
51431
|
s3 = await e3.json();
|
|
51355
|
-
} catch (e4) {
|
|
51432
|
+
} catch (e4) {
|
|
51433
|
+
}
|
|
51356
51434
|
if (this.afterSend && (s3 = await this.afterSend(e3, s3, t2)), e3.status >= 400)
|
|
51357
51435
|
throw new ClientResponseError({ url: e3.url, status: e3.status, data: s3 });
|
|
51358
51436
|
return s3;
|
|
@@ -51893,7 +51971,7 @@ class AppDatabase {
|
|
|
51893
51971
|
}
|
|
51894
51972
|
}
|
|
51895
51973
|
async cancelLimitOrders(payload) {
|
|
51896
|
-
const { symbol, kind, account, cancelExchangeOrders } = payload;
|
|
51974
|
+
const { symbol, kind, account, cancelExchangeOrders, raw } = payload;
|
|
51897
51975
|
const side = kind === "long" ? "buy" : "sell";
|
|
51898
51976
|
const orders = await this.pb.collection("orders").getFullList({
|
|
51899
51977
|
filter: `symbol:lower="${symbol.toLowerCase()}" && account.owner:lower="${account.owner.toLowerCase()}" && account.exchange:lower="${account.exchange.toLowerCase()}" && kind="${kind}" && side:lower="${side}" && stop = 0`
|
|
@@ -51903,6 +51981,9 @@ class AppDatabase {
|
|
|
51903
51981
|
filter: `symbol:lower="${symbol.toLowerCase()}" && account.owner:lower="${account.owner.toLowerCase()}" && account.exchange:lower="${account.exchange.toLowerCase()}" && kind="${kind}" && side:lower="${stop_side}" && stop > 0`
|
|
51904
51982
|
});
|
|
51905
51983
|
const exchange_order_ids = orders.concat(existing_stop_orders).map((o) => account.exchange === "bybit" ? o.order_id : parseInt(o.order_id, 10));
|
|
51984
|
+
if (raw) {
|
|
51985
|
+
return exchange_order_ids;
|
|
51986
|
+
}
|
|
51906
51987
|
try {
|
|
51907
51988
|
console.log(`Attempting to cancel ${exchange_order_ids.length} orders on ${account.exchange} for ${account.owner}...`);
|
|
51908
51989
|
const cancel_result = await cancelExchangeOrders({
|
|
@@ -52849,7 +52930,8 @@ class Signal {
|
|
|
52849
52930
|
support: kind === "long" ? _stop_loss : this.support
|
|
52850
52931
|
};
|
|
52851
52932
|
const instance = new Signal(derivedConfig);
|
|
52852
|
-
if (kind === "short") {
|
|
52933
|
+
if (kind === "short") {
|
|
52934
|
+
}
|
|
52853
52935
|
let result = instance.get_bulk_trade_zones({ current_price, kind });
|
|
52854
52936
|
return result;
|
|
52855
52937
|
return result?.filter((x) => {
|
|
@@ -53067,7 +53149,8 @@ class Signal {
|
|
|
53067
53149
|
kind = "long",
|
|
53068
53150
|
raw
|
|
53069
53151
|
}) {
|
|
53070
|
-
if (raw) {
|
|
53152
|
+
if (raw) {
|
|
53153
|
+
}
|
|
53071
53154
|
const margin_range = this.get_margin_range(current_price, kind);
|
|
53072
53155
|
let margin_zones = this.get_margin_zones({ current_price });
|
|
53073
53156
|
let remaining_zones = margin_zones.filter((x) => JSON.stringify(x) != JSON.stringify(margin_range));
|
|
@@ -53278,7 +53361,8 @@ class Signal {
|
|
|
53278
53361
|
return true;
|
|
53279
53362
|
});
|
|
53280
53363
|
let total_orders = limit_trades.concat(market_trades);
|
|
53281
|
-
if (kind === "short") {
|
|
53364
|
+
if (kind === "short") {
|
|
53365
|
+
}
|
|
53282
53366
|
if (this.minimum_size && total_orders.length > 0) {
|
|
53283
53367
|
let payload = total_orders;
|
|
53284
53368
|
let greater_than_min_size = total_orders.filter((o) => o ? o.quantity >= this.minimum_size : true);
|
|
@@ -53364,7 +53448,8 @@ class Signal {
|
|
|
53364
53448
|
});
|
|
53365
53449
|
const multiplier = start - index;
|
|
53366
53450
|
const incurred_fees = fees.reduce((a, b) => a + b, 0) + previous_risks.reduce((a, b) => a + b, 0);
|
|
53367
|
-
if (index === 0) {
|
|
53451
|
+
if (index === 0) {
|
|
53452
|
+
}
|
|
53368
53453
|
let quantity = determine_position_size2({
|
|
53369
53454
|
entry,
|
|
53370
53455
|
stop,
|
|
@@ -53462,7 +53547,8 @@ function buildConfig(app_config, {
|
|
|
53462
53547
|
return [];
|
|
53463
53548
|
}
|
|
53464
53549
|
const condition = (kind === "long" ? entry > app_config.support : entry >= app_config.support) && stop >= app_config.support * 0.999;
|
|
53465
|
-
if (kind === "short") {
|
|
53550
|
+
if (kind === "short") {
|
|
53551
|
+
}
|
|
53466
53552
|
const result = entry === stop ? [] : condition ? instance.build_entry({
|
|
53467
53553
|
current_price: entry,
|
|
53468
53554
|
stop_loss: stop,
|
|
@@ -55329,7 +55415,8 @@ async function createLimitPurchaseOrdersParallel(client, symbol, priceFormat, qu
|
|
|
55329
55415
|
const splitOrders = (inputOrders) => {
|
|
55330
55416
|
const result = [];
|
|
55331
55417
|
for (const o of inputOrders) {
|
|
55332
|
-
if (o.take_profit) {
|
|
55418
|
+
if (o.take_profit) {
|
|
55419
|
+
}
|
|
55333
55420
|
if (o.stop && !o.side) {
|
|
55334
55421
|
result.push({
|
|
55335
55422
|
price: o.price,
|
|
@@ -56195,6 +56282,7 @@ async function cancelOrdersParallel(payload) {
|
|
|
56195
56282
|
|
|
56196
56283
|
// src/exchanges/bybit.ts
|
|
56197
56284
|
var import_bybit_api = __toESM(require_lib3());
|
|
56285
|
+
var import_p_limit2 = __toESM(require_p_limit());
|
|
56198
56286
|
async function initClient2(credentials, options) {
|
|
56199
56287
|
const { proxyAgent } = options;
|
|
56200
56288
|
try {
|
|
@@ -56222,7 +56310,8 @@ async function createLimitPurchaseOrders(client, symbol, priceFormat, quantityFo
|
|
|
56222
56310
|
const splitOrders = (inputOrders) => {
|
|
56223
56311
|
const result = [];
|
|
56224
56312
|
for (const o of inputOrders) {
|
|
56225
|
-
if (o.take_profit) {
|
|
56313
|
+
if (o.take_profit) {
|
|
56314
|
+
}
|
|
56226
56315
|
if (o.stop && !o.side) {
|
|
56227
56316
|
result.push({
|
|
56228
56317
|
price: o.price,
|
|
@@ -56300,14 +56389,22 @@ async function getPositionInfo2(client, symbol) {
|
|
|
56300
56389
|
const short = result.find((x) => x.side.toLowerCase() === "sell");
|
|
56301
56390
|
return { long, short };
|
|
56302
56391
|
}
|
|
56392
|
+
var ORDERS_PER_SECONDS = 10;
|
|
56393
|
+
var BATCH_SIZE2 = 10;
|
|
56303
56394
|
async function cancelOrders2(payload) {
|
|
56304
56395
|
const client = payload.custom_client;
|
|
56305
56396
|
const results = [];
|
|
56306
|
-
|
|
56307
|
-
|
|
56308
|
-
|
|
56397
|
+
const batches = [];
|
|
56398
|
+
for (let i2 = 0;i2 < payload.orders.length; i2 += BATCH_SIZE2) {
|
|
56399
|
+
batches.push(payload.orders.slice(i2, i2 + BATCH_SIZE2));
|
|
56400
|
+
}
|
|
56401
|
+
const limit = import_p_limit2.default(ORDERS_PER_SECONDS);
|
|
56402
|
+
for (let i2 = 0;i2 < batches.length; i2++) {
|
|
56403
|
+
const batch2 = batches[i2];
|
|
56404
|
+
let rr = await limit(async () => {
|
|
56405
|
+
return await client.batchCancelOrders("linear", batch2.map((x) => ({ orderId: x.orderId, symbol: payload.symbol })));
|
|
56406
|
+
});
|
|
56309
56407
|
results.push(rr);
|
|
56310
|
-
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
56311
56408
|
}
|
|
56312
56409
|
return results;
|
|
56313
56410
|
}
|
|
@@ -56764,8 +56861,10 @@ class BybitExchange extends BaseExchange {
|
|
|
56764
56861
|
sellLeverage: payload.leverage.toString()
|
|
56765
56862
|
});
|
|
56766
56863
|
}
|
|
56767
|
-
async generateConfig(payload) {
|
|
56768
|
-
|
|
56864
|
+
async generateConfig(payload) {
|
|
56865
|
+
}
|
|
56866
|
+
async checkDelistedMovers(payload) {
|
|
56867
|
+
}
|
|
56769
56868
|
async getAllOpenOrders() {
|
|
56770
56869
|
const result = await getAllOpenOrders2({ client: this.client });
|
|
56771
56870
|
return result;
|
|
@@ -56776,11 +56875,13 @@ class BybitExchange extends BaseExchange {
|
|
|
56776
56875
|
async getDelistedSpotSymbols() {
|
|
56777
56876
|
return [];
|
|
56778
56877
|
}
|
|
56779
|
-
async crossAccountTransfer(payload) {
|
|
56878
|
+
async crossAccountTransfer(payload) {
|
|
56879
|
+
}
|
|
56780
56880
|
getOpenOrders(payload) {
|
|
56781
56881
|
return getOpenOrders2(this.client, payload.symbol);
|
|
56782
56882
|
}
|
|
56783
|
-
async placeBadStopEntry(payload) {
|
|
56883
|
+
async placeBadStopEntry(payload) {
|
|
56884
|
+
}
|
|
56784
56885
|
}
|
|
56785
56886
|
|
|
56786
56887
|
// src/helpers/accounts.ts
|
|
@@ -57719,7 +57820,7 @@ class ExchangeAccount {
|
|
|
57719
57820
|
}
|
|
57720
57821
|
}
|
|
57721
57822
|
async cancelOrders(payload) {
|
|
57722
|
-
const { symbol, kind, price: _price, all, stop, limit } = payload;
|
|
57823
|
+
const { symbol, kind, price: _price, all, stop, limit, raw } = payload;
|
|
57723
57824
|
let price = _price || 0;
|
|
57724
57825
|
await this.syncAccount({
|
|
57725
57826
|
symbol,
|
|
@@ -57728,13 +57829,15 @@ class ExchangeAccount {
|
|
|
57728
57829
|
});
|
|
57729
57830
|
if (limit) {
|
|
57730
57831
|
return await this.app_db.cancelLimitOrders({
|
|
57832
|
+
raw,
|
|
57731
57833
|
symbol,
|
|
57732
57834
|
kind,
|
|
57733
57835
|
account: this.instance,
|
|
57734
57836
|
cancelExchangeOrders: this.cancelExchangeOrders.bind(this)
|
|
57735
57837
|
});
|
|
57736
57838
|
}
|
|
57737
|
-
if (all) {
|
|
57839
|
+
if (all) {
|
|
57840
|
+
} else {
|
|
57738
57841
|
if (!price) {
|
|
57739
57842
|
const position2 = await this.syncAccount({
|
|
57740
57843
|
symbol,
|