@gbozee/ultimate 0.0.2-119 → 0.0.2-121

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.
@@ -229,8 +229,7 @@ var init_errors = __esm(() => {
229
229
 
230
230
  // node_modules/jose/dist/node/esm/runtime/random.js
231
231
  import { randomFillSync } from "node:crypto";
232
- var init_random = () => {
233
- };
232
+ var init_random = () => {};
234
233
 
235
234
  // node_modules/jose/dist/node/esm/lib/iv.js
236
235
  function bitLength(alg) {
@@ -271,8 +270,7 @@ var init_check_iv_length = __esm(() => {
271
270
  // node_modules/jose/dist/node/esm/runtime/is_key_object.js
272
271
  import * as util3 from "node:util";
273
272
  var is_key_object_default = (obj) => util3.types.isKeyObject(obj);
274
- var init_is_key_object = () => {
275
- };
273
+ var init_is_key_object = () => {};
276
274
 
277
275
  // node_modules/jose/dist/node/esm/runtime/check_cek_length.js
278
276
  var checkCekLength = (enc, cek) => {
@@ -534,8 +532,7 @@ var ciphers, ciphers_default = (algorithm) => {
534
532
  ciphers ||= new Set(getCiphers());
535
533
  return ciphers.has(algorithm);
536
534
  };
537
- var init_ciphers = () => {
538
- };
535
+ var init_ciphers = () => {};
539
536
 
540
537
  // node_modules/jose/dist/node/esm/runtime/is_key_like.js
541
538
  var is_key_like_default = (key) => is_key_object_default(key) || isCryptoKey(key), types3;
@@ -566,8 +563,7 @@ function cbcDecrypt(enc, cek, ciphertext, iv, tag, aad) {
566
563
  let macCheckPassed;
567
564
  try {
568
565
  macCheckPassed = timing_safe_equal_default(tag, expectedTag);
569
- } catch {
570
- }
566
+ } catch {}
571
567
  if (!macCheckPassed) {
572
568
  throw new JWEDecryptionFailed;
573
569
  }
@@ -575,8 +571,7 @@ function cbcDecrypt(enc, cek, ciphertext, iv, tag, aad) {
575
571
  try {
576
572
  const decipher = createDecipheriv(algorithm, encKey, iv);
577
573
  plaintext = concat(decipher.update(ciphertext), decipher.final());
578
- } catch {
579
- }
574
+ } catch {}
580
575
  if (!plaintext) {
581
576
  throw new JWEDecryptionFailed;
582
577
  }
@@ -754,8 +749,7 @@ function isPublicJWK(key) {
754
749
  function isSecretJWK(key) {
755
750
  return isJWK(key) && key.kty === "oct" && typeof key.k === "string";
756
751
  }
757
- var init_is_jwk = () => {
758
- };
752
+ var init_is_jwk = () => {};
759
753
 
760
754
  // node_modules/jose/dist/node/esm/runtime/get_named_curve.js
761
755
  import { KeyObject as KeyObject3 } from "node:crypto";
@@ -938,14 +932,12 @@ var check_key_length_default = (key, alg) => {
938
932
  } else {
939
933
  modulusLength = Buffer.from(key.n, "base64url").byteLength << 3;
940
934
  }
941
- } catch {
942
- }
935
+ } catch {}
943
936
  if (typeof modulusLength !== "number" || modulusLength < 2048) {
944
937
  throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`);
945
938
  }
946
939
  };
947
- var init_check_key_length = () => {
948
- };
940
+ var init_check_key_length = () => {};
949
941
 
950
942
  // node_modules/jose/dist/node/esm/runtime/rsaes.js
951
943
  import { KeyObject as KeyObject7, publicEncrypt, constants, privateDecrypt } from "node:crypto";
@@ -1699,8 +1691,7 @@ async function generalDecrypt(jwe, key, options) {
1699
1691
  tag: jwe.tag,
1700
1692
  unprotected: jwe.unprotected
1701
1693
  }, key, options);
1702
- } catch {
1703
- }
1694
+ } catch {}
1704
1695
  }
1705
1696
  throw new JWEDecryptionFailed;
1706
1697
  }
@@ -2585,8 +2576,7 @@ async function generalVerify(jws, key, options) {
2585
2576
  protected: signature.protected,
2586
2577
  signature: signature.signature
2587
2578
  }, key, options);
2588
- } catch {
2589
- }
2579
+ } catch {}
2590
2580
  }
2591
2581
  throw new JWSSignatureVerificationFailed;
2592
2582
  }
@@ -2669,8 +2659,7 @@ var normalizeTyp = (value) => value.toLowerCase().replace(/^application\//, ""),
2669
2659
  let payload;
2670
2660
  try {
2671
2661
  payload = JSON.parse(decoder.decode(encodedPayload));
2672
- } catch {
2673
- }
2662
+ } catch {}
2674
2663
  if (!isObject(payload)) {
2675
2664
  throw new JWTInvalid("JWT Claims Set must be a top-level JSON object");
2676
2665
  }
@@ -3355,8 +3344,7 @@ class LocalJWKSet {
3355
3344
  for (const jwk2 of candidates) {
3356
3345
  try {
3357
3346
  yield await importWithAlgCache(_cached, jwk2, alg);
3358
- } catch {
3359
- }
3347
+ } catch {}
3360
3348
  }
3361
3349
  };
3362
3350
  throw error;
@@ -3903,8 +3891,7 @@ var require_util = __commonJS((exports) => {
3903
3891
  var util5;
3904
3892
  (function(util6) {
3905
3893
  util6.assertEqual = (val) => val;
3906
- function assertIs(_arg) {
3907
- }
3894
+ function assertIs(_arg) {}
3908
3895
  util6.assertIs = assertIs;
3909
3896
  function assertNever(_x) {
3910
3897
  throw new Error;
@@ -6320,8 +6307,7 @@ var require_types = __commonJS((exports) => {
6320
6307
  });
6321
6308
  status.dirty();
6322
6309
  }
6323
- } else if (unknownKeys === "strip") {
6324
- } else {
6310
+ } else if (unknownKeys === "strip") {} else {
6325
6311
  throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
6326
6312
  }
6327
6313
  } else {
@@ -8473,8 +8459,7 @@ var require_logLevelLogger = __commonJS((exports) => {
8473
8459
  if (typeof theFunc === "function" && maxLevel >= theLevel) {
8474
8460
  return theFunc.bind(logger);
8475
8461
  }
8476
- return function() {
8477
- };
8462
+ return function() {};
8478
8463
  }
8479
8464
  return {
8480
8465
  error: _filterFunc("error", types_1.DiagLogLevel.ERROR),
@@ -8699,8 +8684,7 @@ var require_NoopMeter = __commonJS((exports) => {
8699
8684
  exports.createNoopMeter = exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = exports.NOOP_OBSERVABLE_GAUGE_METRIC = exports.NOOP_OBSERVABLE_COUNTER_METRIC = exports.NOOP_UP_DOWN_COUNTER_METRIC = exports.NOOP_HISTOGRAM_METRIC = exports.NOOP_GAUGE_METRIC = exports.NOOP_COUNTER_METRIC = exports.NOOP_METER = exports.NoopObservableUpDownCounterMetric = exports.NoopObservableGaugeMetric = exports.NoopObservableCounterMetric = exports.NoopObservableMetric = exports.NoopHistogramMetric = exports.NoopGaugeMetric = exports.NoopUpDownCounterMetric = exports.NoopCounterMetric = exports.NoopMetric = exports.NoopMeter = undefined;
8700
8685
 
8701
8686
  class NoopMeter {
8702
- constructor() {
8703
- }
8687
+ constructor() {}
8704
8688
  createGauge(_name, _options) {
8705
8689
  return exports.NOOP_GAUGE_METRIC;
8706
8690
  }
@@ -8722,10 +8706,8 @@ var require_NoopMeter = __commonJS((exports) => {
8722
8706
  createObservableUpDownCounter(_name, _options) {
8723
8707
  return exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;
8724
8708
  }
8725
- addBatchObservableCallback(_callback, _observables) {
8726
- }
8727
- removeBatchObservableCallback(_callback) {
8728
- }
8709
+ addBatchObservableCallback(_callback, _observables) {}
8710
+ removeBatchObservableCallback(_callback) {}
8729
8711
  }
8730
8712
  exports.NoopMeter = NoopMeter;
8731
8713
 
@@ -8734,34 +8716,28 @@ var require_NoopMeter = __commonJS((exports) => {
8734
8716
  exports.NoopMetric = NoopMetric;
8735
8717
 
8736
8718
  class NoopCounterMetric extends NoopMetric {
8737
- add(_value, _attributes) {
8738
- }
8719
+ add(_value, _attributes) {}
8739
8720
  }
8740
8721
  exports.NoopCounterMetric = NoopCounterMetric;
8741
8722
 
8742
8723
  class NoopUpDownCounterMetric extends NoopMetric {
8743
- add(_value, _attributes) {
8744
- }
8724
+ add(_value, _attributes) {}
8745
8725
  }
8746
8726
  exports.NoopUpDownCounterMetric = NoopUpDownCounterMetric;
8747
8727
 
8748
8728
  class NoopGaugeMetric extends NoopMetric {
8749
- record(_value, _attributes) {
8750
- }
8729
+ record(_value, _attributes) {}
8751
8730
  }
8752
8731
  exports.NoopGaugeMetric = NoopGaugeMetric;
8753
8732
 
8754
8733
  class NoopHistogramMetric extends NoopMetric {
8755
- record(_value, _attributes) {
8756
- }
8734
+ record(_value, _attributes) {}
8757
8735
  }
8758
8736
  exports.NoopHistogramMetric = NoopHistogramMetric;
8759
8737
 
8760
8738
  class NoopObservableMetric {
8761
- addCallback(_callback) {
8762
- }
8763
- removeCallback(_callback) {
8764
- }
8739
+ addCallback(_callback) {}
8740
+ removeCallback(_callback) {}
8765
8741
  }
8766
8742
  exports.NoopObservableMetric = NoopObservableMetric;
8767
8743
 
@@ -8866,8 +8842,7 @@ var require_context2 = __commonJS((exports) => {
8866
8842
  var NOOP_CONTEXT_MANAGER = new NoopContextManager_1.NoopContextManager;
8867
8843
 
8868
8844
  class ContextAPI {
8869
- constructor() {
8870
- }
8845
+ constructor() {}
8871
8846
  static getInstance() {
8872
8847
  if (!this._instance) {
8873
8848
  this._instance = new ContextAPI;
@@ -8956,13 +8931,11 @@ var require_NonRecordingSpan = __commonJS((exports) => {
8956
8931
  updateName(_name) {
8957
8932
  return this;
8958
8933
  }
8959
- end(_endTime) {
8960
- }
8934
+ end(_endTime) {}
8961
8935
  isRecording() {
8962
8936
  return false;
8963
8937
  }
8964
- recordException(_exception, _time) {
8965
- }
8938
+ recordException(_exception, _time) {}
8966
8939
  }
8967
8940
  exports.NonRecordingSpan = NonRecordingSpan;
8968
8941
  });
@@ -9264,8 +9237,7 @@ var require_tracestate_impl = __commonJS((exports) => {
9264
9237
  const value = listMember.slice(i + 1, part.length);
9265
9238
  if ((0, tracestate_validators_1.validateKey)(key) && (0, tracestate_validators_1.validateValue)(value)) {
9266
9239
  agg.set(key, value);
9267
- } else {
9268
- }
9240
+ } else {}
9269
9241
  }
9270
9242
  return agg;
9271
9243
  }, new Map);
@@ -9337,8 +9309,7 @@ var require_metrics = __commonJS((exports) => {
9337
9309
  var API_NAME2 = "metrics";
9338
9310
 
9339
9311
  class MetricsAPI {
9340
- constructor() {
9341
- }
9312
+ constructor() {}
9342
9313
  static getInstance() {
9343
9314
  if (!this._instance) {
9344
9315
  this._instance = new MetricsAPI;
@@ -9375,8 +9346,7 @@ var require_NoopTextMapPropagator = __commonJS((exports) => {
9375
9346
  exports.NoopTextMapPropagator = undefined;
9376
9347
 
9377
9348
  class NoopTextMapPropagator {
9378
- inject(_context, _carrier) {
9379
- }
9349
+ inject(_context, _carrier) {}
9380
9350
  extract(context, _carrier) {
9381
9351
  return context;
9382
9352
  }
@@ -9689,8 +9659,7 @@ class Registry {
9689
9659
  return this.kv.getByKey(identifier);
9690
9660
  }
9691
9661
  }
9692
- var init_registry = () => {
9693
- };
9662
+ var init_registry = () => {};
9694
9663
 
9695
9664
  // node_modules/superjson/dist/class-registry.js
9696
9665
  var ClassRegistry;
@@ -9775,8 +9744,7 @@ class CustomTransformerRegistry {
9775
9744
  return this.transfomers[name2];
9776
9745
  }
9777
9746
  }
9778
- var init_custom_transformer_registry = () => {
9779
- };
9747
+ var init_custom_transformer_registry = () => {};
9780
9748
 
9781
9749
  // node_modules/superjson/dist/is.js
9782
9750
  var getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1), isUndefined = (payload) => typeof payload === "undefined", isNull = (payload) => payload === null, isPlainObject = (payload) => {
@@ -10121,8 +10089,7 @@ var getNthKey = (value, n) => {
10121
10089
  }
10122
10090
  return object2;
10123
10091
  };
10124
- var init_accessDeep = () => {
10125
- };
10092
+ var init_accessDeep = () => {};
10126
10093
 
10127
10094
  // node_modules/superjson/dist/plainer.js
10128
10095
  function traverse(tree, walker, origin = []) {
@@ -10711,8 +10678,7 @@ var require_NoopLogger = __commonJS((exports) => {
10711
10678
  exports.NOOP_LOGGER = exports.NoopLogger = undefined;
10712
10679
 
10713
10680
  class NoopLogger {
10714
- emit(_logRecord) {
10715
- }
10681
+ emit(_logRecord) {}
10716
10682
  }
10717
10683
  exports.NoopLogger = NoopLogger;
10718
10684
  exports.NOOP_LOGGER = new NoopLogger;
@@ -10806,8 +10772,7 @@ var require_logs = __commonJS((exports) => {
10806
10772
  var NoopLoggerProvider_1 = require_NoopLoggerProvider();
10807
10773
 
10808
10774
  class LogsAPI {
10809
- constructor() {
10810
- }
10775
+ constructor() {}
10811
10776
  static getInstance() {
10812
10777
  if (!this._instance) {
10813
10778
  this._instance = new LogsAPI;
@@ -11275,8 +11240,7 @@ var require_browser = __commonJS((exports, module) => {
11275
11240
  });
11276
11241
  args.splice(lastC, 0, c);
11277
11242
  }
11278
- exports.log = console.debug || console.log || (() => {
11279
- });
11243
+ exports.log = console.debug || console.log || (() => {});
11280
11244
  function save(namespaces) {
11281
11245
  try {
11282
11246
  if (namespaces) {
@@ -11284,15 +11248,13 @@ var require_browser = __commonJS((exports, module) => {
11284
11248
  } else {
11285
11249
  exports.storage.removeItem("debug");
11286
11250
  }
11287
- } catch (error) {
11288
- }
11251
+ } catch (error) {}
11289
11252
  }
11290
11253
  function load() {
11291
11254
  let r;
11292
11255
  try {
11293
11256
  r = exports.storage.getItem("debug");
11294
- } catch (error) {
11295
- }
11257
+ } catch (error) {}
11296
11258
  if (!r && typeof process !== "undefined" && "env" in process) {
11297
11259
  r = process.env.DEBUG;
11298
11260
  }
@@ -11301,8 +11263,7 @@ var require_browser = __commonJS((exports, module) => {
11301
11263
  function localstorage() {
11302
11264
  try {
11303
11265
  return localStorage;
11304
- } catch (error) {
11305
- }
11266
+ } catch (error) {}
11306
11267
  }
11307
11268
  module.exports = require_common()(exports);
11308
11269
  var { formatters } = module.exports;
@@ -11434,8 +11395,7 @@ var require_node3 = __commonJS((exports, module) => {
11434
11395
  exports.save = save;
11435
11396
  exports.load = load;
11436
11397
  exports.useColors = useColors;
11437
- exports.destroy = util5.deprecate(() => {
11438
- }, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
11398
+ exports.destroy = util5.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
11439
11399
  exports.colors = [6, 2, 3, 4, 5, 1];
11440
11400
  try {
11441
11401
  const supportsColor = require_supports_color();
@@ -11519,8 +11479,7 @@ var require_node3 = __commonJS((exports, module) => {
11519
11479
  221
11520
11480
  ];
11521
11481
  }
11522
- } catch (error) {
11523
- }
11482
+ } catch (error) {}
11524
11483
  exports.inspectOpts = Object.keys(process.env).filter((key) => {
11525
11484
  return /^debug_/i.test(key);
11526
11485
  }).reduce((obj, key) => {
@@ -13769,8 +13728,7 @@ var require_jsbn = __commonJS((exports, module) => {
13769
13728
  ++this[w];
13770
13729
  }
13771
13730
  }
13772
- function NullExp() {
13773
- }
13731
+ function NullExp() {}
13774
13732
  function nNop(x) {
13775
13733
  return x;
13776
13734
  }
@@ -14195,8 +14153,7 @@ var require_jsbn = __commonJS((exports, module) => {
14195
14153
  for (i2 = 0;i2 < ba.length; ++i2)
14196
14154
  ba[i2] = rng_get_byte();
14197
14155
  }
14198
- function SecureRandom() {
14199
- }
14156
+ function SecureRandom() {}
14200
14157
  SecureRandom.prototype.nextBytes = rng_get_bytes;
14201
14158
  function Arcfour() {
14202
14159
  this.i = 0;
@@ -16419,8 +16376,7 @@ var require_delayed_stream = __commonJS((exports, module) => {
16419
16376
  delayedStream._handleEmit(arguments);
16420
16377
  return realEmit.apply(source, arguments);
16421
16378
  };
16422
- source.on("error", function() {
16423
- });
16379
+ source.on("error", function() {});
16424
16380
  if (delayedStream.pauseStream) {
16425
16381
  source.pause();
16426
16382
  }
@@ -25724,8 +25680,7 @@ var require_implementation = __commonJS((exports, module) => {
25724
25680
  }
25725
25681
  bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
25726
25682
  if (target.prototype) {
25727
- var Empty = function Empty() {
25728
- };
25683
+ var Empty = function Empty() {};
25729
25684
  Empty.prototype = target.prototype;
25730
25685
  bound.prototype = new Empty;
25731
25686
  Empty.prototype = null;
@@ -25845,8 +25800,7 @@ var require_get_intrinsic = __commonJS((exports, module) => {
25845
25800
  var getEvalledConstructor = function(expressionSyntax) {
25846
25801
  try {
25847
25802
  return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
25848
- } catch (e2) {
25849
- }
25803
+ } catch (e2) {}
25850
25804
  };
25851
25805
  var $gOPD = require_gopd();
25852
25806
  var $defineProperty = require_es_define_property();
@@ -26585,11 +26539,9 @@ var require_debug = __commonJS((exports, module) => {
26585
26539
  if (!debug) {
26586
26540
  try {
26587
26541
  debug = require_src4()("follow-redirects");
26588
- } catch (error) {
26589
- }
26542
+ } catch (error) {}
26590
26543
  if (typeof debug !== "function") {
26591
- debug = function() {
26592
- };
26544
+ debug = function() {};
26593
26545
  }
26594
26546
  }
26595
26547
  debug.apply(null, arguments);
@@ -26964,8 +26916,7 @@ var require_follow_redirects = __commonJS((exports, module) => {
26964
26916
  });
26965
26917
  return exports2;
26966
26918
  }
26967
- function noop2() {
26968
- }
26919
+ function noop2() {}
26969
26920
  function parseUrl(input) {
26970
26921
  var parsed;
26971
26922
  if (useNativeURL) {
@@ -27348,8 +27299,7 @@ var require_axios = __commonJS((exports, module) => {
27348
27299
  isArray3(arrayOrString) ? define2(arrayOrString) : define2(String(arrayOrString).split(delimiter));
27349
27300
  return obj;
27350
27301
  };
27351
- var noop2 = () => {
27352
- };
27302
+ var noop2 = () => {};
27353
27303
  var toFiniteNumber = (value2, defaultValue) => {
27354
27304
  return value2 != null && Number.isFinite(value2 = +value2) ? value2 : defaultValue;
27355
27305
  };
@@ -28802,8 +28752,7 @@ var require_axios = __commonJS((exports, module) => {
28802
28752
  try {
28803
28753
  const knownLength = await util__default["default"].promisify(data.getLength).call(data);
28804
28754
  Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
28805
- } catch (e2) {
28806
- }
28755
+ } catch (e2) {}
28807
28756
  }
28808
28757
  } else if (utils$1.isBlob(data) || utils$1.isFile(data)) {
28809
28758
  data.size && headers.setContentType(data.type || "application/octet-stream");
@@ -29077,13 +29026,11 @@ var require_axios = __commonJS((exports, module) => {
29077
29026
  this.write(name2, "", Date.now() - 86400000);
29078
29027
  }
29079
29028
  } : {
29080
- write() {
29081
- },
29029
+ write() {},
29082
29030
  read() {
29083
29031
  return null;
29084
29032
  },
29085
- remove() {
29086
- }
29033
+ remove() {}
29087
29034
  };
29088
29035
  var headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
29089
29036
  function mergeConfig(config1, config2) {
@@ -29577,8 +29524,7 @@ var require_axios = __commonJS((exports, module) => {
29577
29524
  if (fn) {
29578
29525
  try {
29579
29526
  Object.defineProperty(fn, "name", { value: value2 });
29580
- } catch (e2) {
29581
- }
29527
+ } catch (e2) {}
29582
29528
  Object.defineProperty(fn, "adapterName", { value: value2 });
29583
29529
  }
29584
29530
  });
@@ -29728,8 +29674,7 @@ var require_axios = __commonJS((exports, module) => {
29728
29674
  err.stack += `
29729
29675
  ` + stack;
29730
29676
  }
29731
- } catch (e2) {
29732
- }
29677
+ } catch (e2) {}
29733
29678
  }
29734
29679
  throw err;
29735
29680
  }
@@ -31802,8 +31747,7 @@ var require_logger = __commonJS((exports) => {
31802
31747
  Object.defineProperty(exports, "__esModule", { value: true });
31803
31748
  exports.DefaultLogger = undefined;
31804
31749
  exports.DefaultLogger = {
31805
- silly: (...params) => {
31806
- },
31750
+ silly: (...params) => {},
31807
31751
  debug: (...params) => {
31808
31752
  console.log(new Date, params);
31809
31753
  },
@@ -34546,8 +34490,7 @@ var require_constants4 = __commonJS((exports, module) => {
34546
34490
  kListener: Symbol("kListener"),
34547
34491
  kStatusCode: Symbol("status-code"),
34548
34492
  kWebSocket: Symbol("websocket"),
34549
- NOOP: () => {
34550
- }
34493
+ NOOP: () => {}
34551
34494
  };
34552
34495
  });
34553
34496
 
@@ -34625,8 +34568,7 @@ var require_buffer_util = __commonJS((exports, module) => {
34625
34568
  else
34626
34569
  bufferUtil.unmask(buffer, mask);
34627
34570
  };
34628
- } catch (e2) {
34629
- }
34571
+ } catch (e2) {}
34630
34572
  }
34631
34573
  });
34632
34574
 
@@ -35105,8 +35047,7 @@ var require_validation = __commonJS((exports, module) => {
35105
35047
  module.exports.isValidUTF8 = function(buf) {
35106
35048
  return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf);
35107
35049
  };
35108
- } catch (e2) {
35109
- }
35050
+ } catch (e2) {}
35110
35051
  }
35111
35052
  });
35112
35053
 
@@ -37531,8 +37472,7 @@ var require_websocket_client = __commonJS((exports) => {
37531
37472
  this.options = Object.assign({ pongTimeout: 7500, pingInterval: 1e4, reconnectTimeout: 500 }, options);
37532
37473
  this.listenKeyStateStore = {};
37533
37474
  this.wsUrlKeyMap = {};
37534
- this.on("error", () => {
37535
- });
37475
+ this.on("error", () => {});
37536
37476
  }
37537
37477
  getRestClientOptions() {
37538
37478
  return Object.assign(Object.assign(Object.assign({}, this.options), this.options.restOptions), { api_key: this.options.api_key, api_secret: this.options.api_secret });
@@ -38409,6 +38349,63 @@ var require_lib2 = __commonJS((exports) => {
38409
38349
  __exportStar(require_websocket_client(), exports);
38410
38350
  });
38411
38351
 
38352
+ // node_modules/p-try/index.js
38353
+ var require_p_try = __commonJS((exports, module) => {
38354
+ var pTry = (fn, ...arguments_) => new Promise((resolve) => {
38355
+ resolve(fn(...arguments_));
38356
+ });
38357
+ module.exports = pTry;
38358
+ module.exports.default = pTry;
38359
+ });
38360
+
38361
+ // node_modules/p-limit/index.js
38362
+ var require_p_limit = __commonJS((exports, module) => {
38363
+ var pTry = require_p_try();
38364
+ var pLimit = (concurrency) => {
38365
+ if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
38366
+ return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));
38367
+ }
38368
+ const queue2 = [];
38369
+ let activeCount = 0;
38370
+ const next = () => {
38371
+ activeCount--;
38372
+ if (queue2.length > 0) {
38373
+ queue2.shift()();
38374
+ }
38375
+ };
38376
+ const run = (fn, resolve, ...args) => {
38377
+ activeCount++;
38378
+ const result = pTry(fn, ...args);
38379
+ resolve(result);
38380
+ result.then(next, next);
38381
+ };
38382
+ const enqueue = (fn, resolve, ...args) => {
38383
+ if (activeCount < concurrency) {
38384
+ run(fn, resolve, ...args);
38385
+ } else {
38386
+ queue2.push(run.bind(null, fn, resolve, ...args));
38387
+ }
38388
+ };
38389
+ const generator = (fn, ...args) => new Promise((resolve) => enqueue(fn, resolve, ...args));
38390
+ Object.defineProperties(generator, {
38391
+ activeCount: {
38392
+ get: () => activeCount
38393
+ },
38394
+ pendingCount: {
38395
+ get: () => queue2.length
38396
+ },
38397
+ clearQueue: {
38398
+ value: () => {
38399
+ queue2.length = 0;
38400
+ }
38401
+ }
38402
+ });
38403
+ return generator;
38404
+ };
38405
+ module.exports = pLimit;
38406
+ module.exports.default = pLimit;
38407
+ });
38408
+
38412
38409
  // node_modules/bybit-api/lib/util/requestUtils.js
38413
38410
  var require_requestUtils2 = __commonJS((exports) => {
38414
38411
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -38949,8 +38946,7 @@ var require_logger2 = __commonJS((exports) => {
38949
38946
  Object.defineProperty(exports, "__esModule", { value: true });
38950
38947
  exports.DefaultLogger = undefined;
38951
38948
  exports.DefaultLogger = {
38952
- trace: (..._params) => {
38953
- },
38949
+ trace: (..._params) => {},
38954
38950
  info: (...params) => {
38955
38951
  console.info(params);
38956
38952
  },
@@ -40996,8 +40992,7 @@ var require_BaseWSClient = __commonJS((exports) => {
40996
40992
  if (wsState === null || wsState === undefined ? undefined : wsState.activePongTimer) {
40997
40993
  clearTimeout(wsState.activePongTimer);
40998
40994
  wsState.activePongTimer = undefined;
40999
- } else {
41000
- }
40995
+ } else {}
41001
40996
  }
41002
40997
  clearReconnectTimer(wsKey) {
41003
40998
  const wsState = this.wsStore.get(wsKey);
@@ -41868,8 +41863,7 @@ var require_lib3 = __commonJS((exports) => {
41868
41863
  var util;
41869
41864
  (function(util2) {
41870
41865
  util2.assertEqual = (val) => val;
41871
- function assertIs(_arg) {
41872
- }
41866
+ function assertIs(_arg) {}
41873
41867
  util2.assertIs = assertIs;
41874
41868
  function assertNever(_x) {
41875
41869
  throw new Error;
@@ -47224,8 +47218,7 @@ function parseStringDef(def, refs) {
47224
47218
  case "trim":
47225
47219
  break;
47226
47220
  default:
47227
- ((_) => {
47228
- })(check);
47221
+ ((_) => {})(check);
47229
47222
  }
47230
47223
  }
47231
47224
  }
@@ -48615,8 +48608,7 @@ class StdioServerTransport {
48615
48608
  var util2;
48616
48609
  (function(util3) {
48617
48610
  util3.assertEqual = (val) => val;
48618
- function assertIs(_arg) {
48619
- }
48611
+ function assertIs(_arg) {}
48620
48612
  util3.assertIs = assertIs;
48621
48613
  function assertNever(_x) {
48622
48614
  throw new Error;
@@ -53477,8 +53469,7 @@ var API_NAME = "task-context";
53477
53469
 
53478
53470
  class TaskContextAPI {
53479
53471
  static _instance;
53480
- constructor() {
53481
- }
53472
+ constructor() {}
53482
53473
  static getInstance() {
53483
53474
  if (!this._instance) {
53484
53475
  this._instance = new TaskContextAPI;
@@ -53898,8 +53889,7 @@ class ParseError extends Error {
53898
53889
  super(message2), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;
53899
53890
  }
53900
53891
  }
53901
- function noop(_arg) {
53902
- }
53892
+ function noop(_arg) {}
53903
53893
  function createParser(callbacks) {
53904
53894
  if (typeof callbacks == "function")
53905
53895
  throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");
@@ -54102,8 +54092,7 @@ async function _doZodFetchWithRetries(schema, url, requestInit, options, attempt
54102
54092
  if (error instanceof ApiError) {
54103
54093
  throw error;
54104
54094
  }
54105
- if (error instanceof import_zod_validation_error.ValidationError) {
54106
- }
54095
+ if (error instanceof import_zod_validation_error.ValidationError) {}
54107
54096
  if (options?.retry) {
54108
54097
  const retry = { ...defaultRetryOptions2, ...options.retry };
54109
54098
  const delay = calculateNextRetryDelay(retry, attempt);
@@ -54577,8 +54566,7 @@ class ApiClientMissingError extends Error {
54577
54566
 
54578
54567
  class APIClientManagerAPI {
54579
54568
  static _instance;
54580
- constructor() {
54581
- }
54569
+ constructor() {}
54582
54570
  static getInstance() {
54583
54571
  if (!this._instance) {
54584
54572
  this._instance = new APIClientManagerAPI;
@@ -55133,8 +55121,7 @@ var PrefetchQueue = class {
55133
55121
  if (__privateGet(this, _queueTailUrl) && !__privateGet(this, _prefetchQueue).has(__privateGet(this, _queueTailUrl))) {
55134
55122
  __privateMethod(this, _PrefetchQueue_instances, prefetch_fn).call(this, __privateGet(this, _queueTailUrl), args[1]);
55135
55123
  }
55136
- }).catch(() => {
55137
- });
55124
+ }).catch(() => {});
55138
55125
  return request;
55139
55126
  }
55140
55127
  };
@@ -55165,10 +55152,8 @@ prefetch_fn = function(...args) {
55165
55152
  }
55166
55153
  __privateSet(this, _queueTailUrl, nextUrl);
55167
55154
  return __privateMethod(this, _PrefetchQueue_instances, prefetch_fn).call(this, nextUrl, args[1]);
55168
- }).catch(() => {
55169
- });
55170
- } catch (_) {
55171
- }
55155
+ }).catch(() => {});
55156
+ } catch (_) {}
55172
55157
  };
55173
55158
  function getNextChunkUrl(url, res) {
55174
55159
  const shapeHandle = res.headers.get(SHAPE_HANDLE_HEADER);
@@ -55271,8 +55256,7 @@ var ShapeStream = class {
55271
55256
  get lastOffset() {
55272
55257
  return __privateGet(this, _lastOffset);
55273
55258
  }
55274
- subscribe(callback, onError = () => {
55275
- }) {
55259
+ subscribe(callback, onError = () => {}) {
55276
55260
  const subscriptionId = Math.random();
55277
55261
  __privateGet(this, _subscribers).set(subscriptionId, [callback, onError]);
55278
55262
  return () => {
@@ -56466,8 +56450,7 @@ class SimpleClock {
56466
56450
  const nowStruct = now.toStruct();
56467
56451
  return [nowStruct.seconds, nowStruct.nanos];
56468
56452
  }
56469
- reset() {
56470
- }
56453
+ reset() {}
56471
56454
  }
56472
56455
 
56473
56456
  // node_modules/@trigger.dev/core/dist/esm/v3/clock/index.js
@@ -56476,8 +56459,7 @@ var SIMPLE_CLOCK = new SimpleClock;
56476
56459
 
56477
56460
  class ClockAPI {
56478
56461
  static _instance;
56479
- constructor() {
56480
- }
56462
+ constructor() {}
56481
56463
  static getInstance() {
56482
56464
  if (!this._instance) {
56483
56465
  this._instance = new ClockAPI;
@@ -56503,8 +56485,7 @@ var clock = ClockAPI.getInstance();
56503
56485
 
56504
56486
  // node_modules/@trigger.dev/core/dist/esm/v3/usage/noopUsageManager.js
56505
56487
  class NoopUsageManager {
56506
- disable() {
56507
- }
56488
+ disable() {}
56508
56489
  start() {
56509
56490
  return {
56510
56491
  sample: () => ({ cpuTime: 0, wallTime: 0 })
@@ -56527,8 +56508,7 @@ var NOOP_USAGE_MANAGER = new NoopUsageManager;
56527
56508
 
56528
56509
  class UsageAPI {
56529
56510
  static _instance;
56530
- constructor() {
56531
- }
56511
+ constructor() {}
56532
56512
  static getInstance() {
56533
56513
  if (!this._instance) {
56534
56514
  this._instance = new UsageAPI;
@@ -56588,8 +56568,7 @@ class NoopRunMetadataManager {
56588
56568
  refresh(requestOptions) {
56589
56569
  throw new Error("Method not implemented.");
56590
56570
  }
56591
- enterWithMetadata(metadata) {
56592
- }
56571
+ enterWithMetadata(metadata) {}
56593
56572
  current() {
56594
56573
  throw new Error("Method not implemented.");
56595
56574
  }
@@ -56645,8 +56624,7 @@ var NOOP_MANAGER = new NoopRunMetadataManager;
56645
56624
 
56646
56625
  class RunMetadataAPI {
56647
56626
  static _instance;
56648
- constructor() {
56649
- }
56627
+ constructor() {}
56650
56628
  static getInstance() {
56651
56629
  if (!this._instance) {
56652
56630
  this._instance = new RunMetadataAPI;
@@ -56731,8 +56709,7 @@ var NOOP_TIMEOUT_MANAGER = new NoopTimeoutManager;
56731
56709
 
56732
56710
  class TimeoutAPI {
56733
56711
  static _instance;
56734
- constructor() {
56735
- }
56712
+ constructor() {}
56736
56713
  static getInstance() {
56737
56714
  if (!this._instance) {
56738
56715
  this._instance = new TimeoutAPI;
@@ -57136,8 +57113,7 @@ function getTokenPayload(e2) {
57136
57113
  return "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2);
57137
57114
  }).join(""));
57138
57115
  return JSON.parse(t2) || {};
57139
- } catch (e3) {
57140
- }
57116
+ } catch (e3) {}
57141
57117
  return {};
57142
57118
  }
57143
57119
  function isTokenExpired(e2, t2 = 0) {
@@ -57191,8 +57167,7 @@ class BaseAuthStore {
57191
57167
  let n = {};
57192
57168
  try {
57193
57169
  n = JSON.parse(s2), (typeof n === null || typeof n != "object" || Array.isArray(n)) && (n = {});
57194
- } catch (e3) {
57195
- }
57170
+ } catch (e3) {}
57196
57171
  this.save(n.token || "", n.record || n.model || null);
57197
57172
  }
57198
57173
  exportToCookie(e2, t2 = i) {
@@ -57339,8 +57314,7 @@ class RealtimeService extends BaseService {
57339
57314
  let i3;
57340
57315
  try {
57341
57316
  i3 = JSON.parse(s3?.data);
57342
- } catch {
57343
- }
57317
+ } catch {}
57344
57318
  t2(i3 || {});
57345
57319
  };
57346
57320
  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);
@@ -58053,8 +58027,7 @@ class Client {
58053
58027
  let s3 = {};
58054
58028
  try {
58055
58029
  s3 = await e3.json();
58056
- } catch (e4) {
58057
- }
58030
+ } catch (e4) {}
58058
58031
  if (this.afterSend && (s3 = await this.afterSend(e3, s3, t2)), e3.status >= 400)
58059
58032
  throw new ClientResponseError({ url: e3.url, status: e3.status, data: s3 });
58060
58033
  return s3;
@@ -58240,6 +58213,26 @@ class AppDatabase {
58240
58213
  });
58241
58214
  }
58242
58215
  }
58216
+ async changeUserPassword(payload) {
58217
+ const { password } = payload;
58218
+ const credentials = await this.getUserCredentials();
58219
+ if (credentials) {
58220
+ const encryptedCredentials = encryptObject(credentials, password);
58221
+ if (this.salt && this.email) {
58222
+ const user = await this.getUserByEmail();
58223
+ const encryptedPassword = encryptObject(password, this.salt);
58224
+ await this.pb.collection("users").update(user.id, {
58225
+ settings: {
58226
+ ...user.settings,
58227
+ password: encryptedPassword,
58228
+ credentials: encryptedCredentials
58229
+ }
58230
+ });
58231
+ return true;
58232
+ }
58233
+ }
58234
+ return false;
58235
+ }
58243
58236
  async addNewCredential(params) {
58244
58237
  const { password, payload } = params;
58245
58238
  let credentials = await this.getCredentials({ password });
@@ -59524,8 +59517,7 @@ class Signal {
59524
59517
  support: kind === "long" ? _stop_loss : this.support
59525
59518
  };
59526
59519
  const instance = new Signal(derivedConfig);
59527
- if (kind === "short") {
59528
- }
59520
+ if (kind === "short") {}
59529
59521
  let result = instance.get_bulk_trade_zones({ current_price, kind });
59530
59522
  return result;
59531
59523
  return result?.filter((x) => {
@@ -59743,8 +59735,7 @@ class Signal {
59743
59735
  kind = "long",
59744
59736
  raw
59745
59737
  }) {
59746
- if (raw) {
59747
- }
59738
+ if (raw) {}
59748
59739
  const margin_range = this.get_margin_range(current_price, kind);
59749
59740
  let margin_zones = this.get_margin_zones({ current_price });
59750
59741
  let remaining_zones = margin_zones.filter((x) => JSON.stringify(x) != JSON.stringify(margin_range));
@@ -59955,8 +59946,7 @@ class Signal {
59955
59946
  return true;
59956
59947
  });
59957
59948
  let total_orders = limit_trades.concat(market_trades);
59958
- if (kind === "short") {
59959
- }
59949
+ if (kind === "short") {}
59960
59950
  if (this.minimum_size && total_orders.length > 0) {
59961
59951
  let payload = total_orders;
59962
59952
  let greater_than_min_size = total_orders.filter((o) => o ? o.quantity >= this.minimum_size : true);
@@ -60042,8 +60032,7 @@ class Signal {
60042
60032
  });
60043
60033
  const multiplier = start - index;
60044
60034
  const incurred_fees = fees.reduce((a, b) => a + b, 0) + previous_risks.reduce((a, b) => a + b, 0);
60045
- if (index === 0) {
60046
- }
60035
+ if (index === 0) {}
60047
60036
  let quantity = determine_position_size2({
60048
60037
  entry,
60049
60038
  stop,
@@ -60141,8 +60130,7 @@ function buildConfig(app_config, {
60141
60130
  return [];
60142
60131
  }
60143
60132
  const condition = (kind === "long" ? entry > app_config.support : entry >= app_config.support) && stop >= app_config.support * 0.999;
60144
- if (kind === "short") {
60145
- }
60133
+ if (kind === "short") {}
60146
60134
  const result = entry === stop ? [] : condition ? instance.build_entry({
60147
60135
  current_price: entry,
60148
60136
  stop_loss: stop,
@@ -61753,6 +61741,7 @@ class BaseExchange {
61753
61741
  }
61754
61742
 
61755
61743
  // src/exchanges/binance.ts
61744
+ var import_p_limit = __toESM(require_p_limit(), 1);
61756
61745
  var CONSTANTS = {
61757
61746
  SPOT_TO_FIAT: "MAIN_C2C",
61758
61747
  SPOT_TO_USDT_FUTURE: "MAIN_UMFUTURE",
@@ -61980,13 +61969,16 @@ async function initClient(credentials, options) {
61980
61969
  console.log(e2);
61981
61970
  }
61982
61971
  }
61983
- async function createLimitPurchaseOrders(client, symbol, priceFormat, quantityFormat, orders, currentPrice, workingType = "last", realClose = false) {
61972
+ var ORDERS_PER_MINUTE = 2000;
61973
+ var ORDERS_PER_SECOND = Math.floor(ORDERS_PER_MINUTE / 60);
61974
+ var BATCH_SIZE = 5;
61975
+ var CANCEL_BATCH_SIZE = 10;
61976
+ async function createLimitPurchaseOrdersParallel(client, symbol, priceFormat, quantityFormat, orders, currentPrice, workingType = "last", realClose = false) {
61984
61977
  const workingTypeValue = workingType === "mark" ? "MARK_PRICE" : "CONTRACT_PRICE";
61985
61978
  const splitOrders = (inputOrders) => {
61986
61979
  const result = [];
61987
61980
  for (const o of inputOrders) {
61988
- if (o.take_profit) {
61989
- }
61981
+ if (o.take_profit) {}
61990
61982
  if (o.stop && !o.side) {
61991
61983
  result.push({
61992
61984
  price: o.price,
@@ -62032,30 +62024,38 @@ async function createLimitPurchaseOrders(client, symbol, priceFormat, quantityFo
62032
62024
  const remaining = orders.filter((x) => x.stop !== true);
62033
62025
  const breakOrders = splitOrders(toSplit);
62034
62026
  const newOrders = [...breakOrders, ...remaining].map(createOrder);
62035
- let res = [];
62036
- for (let i2 = 0;i2 < newOrders.length; i2 += 5) {
62037
- const batch2 = newOrders.slice(i2, i2 + 5);
62038
- const _res = await client.submitMultipleOrders(batch2.map((k) => {
62039
- let payload = {
62040
- symbol: k.symbol,
62041
- side: k.side,
62042
- positionSide: k.positionSide,
62043
- type: k.type,
62044
- timeInForce: k.timeInForce,
62045
- quantity: k.quantity?.toString(),
62046
- price: k.price?.toString(),
62047
- workingType: k.workingType
62048
- };
62049
- if (k.stopPrice) {
62050
- payload.stopPrice = k.stopPrice.toString();
62051
- }
62052
- return payload;
62053
- }));
62054
- await new Promise((resolve) => setTimeout(resolve, 100));
62055
- console.log(_res);
62056
- res.push(_res);
62027
+ const batches = [];
62028
+ for (let i2 = 0;i2 < newOrders.length; i2 += BATCH_SIZE) {
62029
+ batches.push(newOrders.slice(i2, i2 + BATCH_SIZE));
62057
62030
  }
62058
- return res;
62031
+ const limit = import_p_limit.default(ORDERS_PER_SECOND);
62032
+ const results = await Promise.all(batches.map((batch2) => limit(async () => {
62033
+ try {
62034
+ const payload = batch2.map((k) => {
62035
+ let orderPayload = {
62036
+ symbol: k.symbol,
62037
+ side: k.side,
62038
+ positionSide: k.positionSide,
62039
+ type: k.type,
62040
+ timeInForce: k.timeInForce,
62041
+ quantity: k.quantity?.toString(),
62042
+ price: k.price?.toString(),
62043
+ workingType: k.workingType
62044
+ };
62045
+ if (k.stopPrice) {
62046
+ orderPayload.stopPrice = k.stopPrice.toString();
62047
+ }
62048
+ return orderPayload;
62049
+ });
62050
+ const result = await client.submitMultipleOrders(payload);
62051
+ console.log("Batch result:", result);
62052
+ return result;
62053
+ } catch (error) {
62054
+ console.error("Error processing batch:", error);
62055
+ throw error;
62056
+ }
62057
+ })));
62058
+ return results;
62059
62059
  }
62060
62060
  async function getPositionInfo(client, symbol) {
62061
62061
  const response = await client.getPositionsV3({
@@ -62081,6 +62081,11 @@ async function getPositionInfo(client, symbol) {
62081
62081
  return { long, short };
62082
62082
  }
62083
62083
  async function cancelOrders(payload) {
62084
+ return await cancelOrdersParallel({
62085
+ symbol: payload.symbol,
62086
+ orders: payload.orders,
62087
+ custom_client: payload.custom_client
62088
+ });
62084
62089
  const client = payload.custom_client;
62085
62090
  for (let i2 = 0;i2 < payload.orders.length; i2 += 10) {
62086
62091
  const batch2 = payload.orders.slice(i2, i2 + 10);
@@ -62119,7 +62124,7 @@ async function placeLimitOrders(client, payload) {
62119
62124
  quantity: x.quantity,
62120
62125
  kind: payload.kind
62121
62126
  }));
62122
- return await createLimitPurchaseOrders(client, symbol, price_places, decimal_places, orders);
62127
+ return await createLimitPurchaseOrdersParallel(client, symbol, price_places, decimal_places, orders);
62123
62128
  }
62124
62129
  }
62125
62130
  async function placeTpOrder(client, payload) {
@@ -62147,7 +62152,7 @@ async function placeTpOrder(client, payload) {
62147
62152
  price: payload.tp,
62148
62153
  quantity: _quantity
62149
62154
  };
62150
- const rr = await createLimitPurchaseOrders(client, symbol, price_places, decimal_places, [order]);
62155
+ const rr = await createLimitPurchaseOrdersParallel(client, symbol, price_places, decimal_places, [order]);
62151
62156
  if (payload.kind == "long") {
62152
62157
  console.log("rr", { rr, price_places, decimal_places });
62153
62158
  }
@@ -62193,7 +62198,7 @@ async function placeStopOrder(client, payload) {
62193
62198
  stop: payload.final_stop,
62194
62199
  is_market: !payload.is_limit
62195
62200
  };
62196
- return createLimitPurchaseOrders(client, symbol, price_places, decimal_places, [order]);
62201
+ return createLimitPurchaseOrdersParallel(client, symbol, price_places, decimal_places, [order]);
62197
62202
  }
62198
62203
  async function getOpenOrders(client, symbol, type) {
62199
62204
  const response = await client.getAllOpenOrders({
@@ -62553,7 +62558,7 @@ class BinanceExchange extends BaseExchange {
62553
62558
  return await cancelAllOrders(this.client, symbol, payload);
62554
62559
  }
62555
62560
  async _createLimitPurchaseOrders(payload) {
62556
- return await createLimitPurchaseOrders(this.client, payload.symbol, payload.price_places, payload.decimal_places, payload.orders);
62561
+ return await createLimitPurchaseOrdersParallel(this.client, payload.symbol, payload.price_places, payload.decimal_places, payload.orders);
62557
62562
  }
62558
62563
  async analyzeCharts(payload) {
62559
62564
  return await analyzeCharts({
@@ -62777,7 +62782,7 @@ async function forceClosePosition(client, symbol, options) {
62777
62782
  force_market: true
62778
62783
  };
62779
62784
  console.log(`Closing ${position2.kind} position for ${symbol}: ${position2.size} units`);
62780
- const orderResult = await createLimitPurchaseOrders(client, symbol, price_places, decimal_places, [order]);
62785
+ const orderResult = await createLimitPurchaseOrdersParallel(client, symbol, price_places, decimal_places, [order]);
62781
62786
  result.closedPositions.push({
62782
62787
  kind: position2.kind,
62783
62788
  quantity: position2.size,
@@ -62814,6 +62819,28 @@ async function forceClosePosition(client, symbol, options) {
62814
62819
  }
62815
62820
  return result;
62816
62821
  }
62822
+ async function cancelOrdersParallel(payload) {
62823
+ const client = payload.custom_client;
62824
+ const batches = [];
62825
+ for (let i2 = 0;i2 < payload.orders.length; i2 += CANCEL_BATCH_SIZE) {
62826
+ batches.push(payload.orders.slice(i2, i2 + CANCEL_BATCH_SIZE));
62827
+ }
62828
+ const limit = import_p_limit.default(ORDERS_PER_SECOND);
62829
+ const results = await Promise.all(batches.map((batch2) => limit(async () => {
62830
+ try {
62831
+ const result = await Promise.all(batch2.map((x) => client.cancelOrder({
62832
+ symbol: payload.symbol,
62833
+ orderId: x.orderId
62834
+ })));
62835
+ console.log("Cancel batch result:", result);
62836
+ return result;
62837
+ } catch (error) {
62838
+ console.error("Error processing cancel batch:", error);
62839
+ throw error;
62840
+ }
62841
+ })));
62842
+ return results;
62843
+ }
62817
62844
 
62818
62845
  // src/exchanges/bybit.ts
62819
62846
  var import_bybit_api = __toESM(require_lib3(), 1);
@@ -62839,13 +62866,12 @@ function titleCase(str) {
62839
62866
  return word.charAt(0).toUpperCase() + word.slice(1);
62840
62867
  }).join(" ");
62841
62868
  }
62842
- async function createLimitPurchaseOrders2(client, symbol, priceFormat, quantityFormat, orders, currentPrice, workingType = "last", realClose = false) {
62869
+ async function createLimitPurchaseOrders(client, symbol, priceFormat, quantityFormat, orders, currentPrice, workingType = "last", realClose = false) {
62843
62870
  const workingTypeValue = workingType === "mark" ? "MarkPrice" : "LastPrice";
62844
62871
  const splitOrders = (inputOrders) => {
62845
62872
  const result = [];
62846
62873
  for (const o of inputOrders) {
62847
- if (o.take_profit) {
62848
- }
62874
+ if (o.take_profit) {}
62849
62875
  if (o.stop && !o.side) {
62850
62876
  result.push({
62851
62877
  price: o.price,
@@ -62961,7 +62987,7 @@ async function placeLimitOrders2(client, payload) {
62961
62987
  quantity: x.quantity,
62962
62988
  kind: payload.kind
62963
62989
  }));
62964
- return await createLimitPurchaseOrders2(client, symbol, price_places, decimal_places, orders);
62990
+ return await createLimitPurchaseOrders(client, symbol, price_places, decimal_places, orders);
62965
62991
  }
62966
62992
  }
62967
62993
  async function placeTpOrder2(client, payload) {
@@ -62990,7 +63016,7 @@ async function placeTpOrder2(client, payload) {
62990
63016
  price: payload.tp,
62991
63017
  quantity: _quantity
62992
63018
  };
62993
- return createLimitPurchaseOrders2(client, symbol, price_places, decimal_places, [order]);
63019
+ return createLimitPurchaseOrders(client, symbol, price_places, decimal_places, [order]);
62994
63020
  }
62995
63021
  return { error: "No quantity" };
62996
63022
  }
@@ -63011,7 +63037,7 @@ async function placeStopOrder2(client, payload) {
63011
63037
  stop: payload.final_stop,
63012
63038
  is_market: !payload.is_limit
63013
63039
  };
63014
- return createLimitPurchaseOrders2(client, symbol, price_places, decimal_places, [order]);
63040
+ return createLimitPurchaseOrders(client, symbol, price_places, decimal_places, [order]);
63015
63041
  }
63016
63042
  async function getOpenOrders2(client, symbol, type) {
63017
63043
  const response = await client.getActiveOrders({
@@ -63340,7 +63366,7 @@ class BybitExchange extends BaseExchange {
63340
63366
  return await cancelAllOrders2(this.client, symbol, payload);
63341
63367
  }
63342
63368
  async _createLimitPurchaseOrders(payload) {
63343
- return await createLimitPurchaseOrders2(this.client, payload.symbol, payload.price_places, payload.decimal_places, payload.orders);
63369
+ return await createLimitPurchaseOrders(this.client, payload.symbol, payload.price_places, payload.decimal_places, payload.orders);
63344
63370
  }
63345
63371
  async getCurrentPrice(symbol) {
63346
63372
  return await getCurrentPrice2(this.client, symbol);
@@ -63387,10 +63413,8 @@ class BybitExchange extends BaseExchange {
63387
63413
  sellLeverage: payload.leverage.toString()
63388
63414
  });
63389
63415
  }
63390
- async generateConfig(payload) {
63391
- }
63392
- async checkDelistedMovers(payload) {
63393
- }
63416
+ async generateConfig(payload) {}
63417
+ async checkDelistedMovers(payload) {}
63394
63418
  async getAllOpenOrders() {
63395
63419
  const result = await getAllOpenOrders2({ client: this.client });
63396
63420
  return result;
@@ -63401,13 +63425,11 @@ class BybitExchange extends BaseExchange {
63401
63425
  async getDelistedSpotSymbols() {
63402
63426
  return [];
63403
63427
  }
63404
- async crossAccountTransfer(payload) {
63405
- }
63428
+ async crossAccountTransfer(payload) {}
63406
63429
  getOpenOrders(payload) {
63407
63430
  return getOpenOrders2(this.client, payload.symbol);
63408
63431
  }
63409
- async placeBadStopEntry(payload) {
63410
- }
63432
+ async placeBadStopEntry(payload) {}
63411
63433
  }
63412
63434
 
63413
63435
  // src/helpers/accounts.ts
@@ -64361,8 +64383,7 @@ class ExchangeAccount {
64361
64383
  cancelExchangeOrders: this.cancelExchangeOrders.bind(this)
64362
64384
  });
64363
64385
  }
64364
- if (all) {
64365
- } else {
64386
+ if (all) {} else {
64366
64387
  if (!price) {
64367
64388
  const position2 = await this.syncAccount({
64368
64389
  symbol,
@@ -67062,8 +67083,7 @@ async function fetchExchangeDetails(payload) {
67062
67083
  }
67063
67084
 
67064
67085
  // src/mcp-server.ts
67065
- console.log = (...args) => {
67066
- };
67086
+ console.log = (...args) => {};
67067
67087
  var server = new McpServer({
67068
67088
  name: "ultimate-trader",
67069
67089
  version: "0.0.1",