@gbozee/ultimate 0.0.2-141 → 0.0.2-144

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/index.cjs CHANGED
@@ -55083,7 +55083,7 @@ class Strategy {
55083
55083
  }
55084
55084
  }
55085
55085
 
55086
- // src/exchanges/binance.ts
55086
+ // src/exchanges/binance/index.ts
55087
55087
  var import_binance = __toESM(require_lib2());
55088
55088
  // src/types/index.ts
55089
55089
  class BaseExchange {
@@ -55256,16 +55256,18 @@ class BaseExchange {
55256
55256
  price_places = "%.1f",
55257
55257
  symbol
55258
55258
  } = payload;
55259
+ const order_payload = orders.map((order) => ({
55260
+ ...order,
55261
+ price: order.entry,
55262
+ kind,
55263
+ side: kind.toLowerCase() === "long" ? "buy" : "sell",
55264
+ stop: undefined
55265
+ }));
55259
55266
  return await this._createLimitPurchaseOrders({
55260
55267
  symbol,
55261
55268
  price_places,
55262
55269
  decimal_places,
55263
- orders: orders.map((order) => ({
55264
- ...order,
55265
- price: order.entry,
55266
- kind,
55267
- side: kind.toLowerCase() === "long" ? "buy" : "sell"
55268
- }))
55270
+ orders: order_payload
55269
55271
  });
55270
55272
  }
55271
55273
  async placeMarketOrder(payload) {
@@ -55413,7 +55415,7 @@ class BaseExchange {
55413
55415
  }
55414
55416
  }
55415
55417
 
55416
- // src/exchanges/binance.ts
55418
+ // src/exchanges/binance/index.ts
55417
55419
  var import_p_limit = __toESM(require_p_limit());
55418
55420
  var CONSTANTS = {
55419
55421
  SPOT_TO_FIAT: "MAIN_C2C",
@@ -56517,7 +56519,7 @@ async function cancelOrdersParallel(payload) {
56517
56519
  return results;
56518
56520
  }
56519
56521
 
56520
- // src/exchanges/bybit.ts
56522
+ // src/exchanges/bybit/index.ts
56521
56523
  var import_bybit_api = __toESM(require_lib3());
56522
56524
  var import_p_limit2 = __toESM(require_p_limit());
56523
56525
  async function initClient2(credentials, options) {
@@ -56863,7 +56865,8 @@ function buildPosition2(position2, orders, options) {
56863
56865
  stop_loss,
56864
56866
  take_profit,
56865
56867
  tp_quantity,
56866
- stop_quantity
56868
+ stop_quantity,
56869
+ liquidation: position2.liqPrice ? parseFloat(position2.liqPrice) : null
56867
56870
  };
56868
56871
  }
56869
56872
  var emptyPosition2 = {
@@ -58478,7 +58481,7 @@ class ExchangeAccount {
58478
58481
  symbol: payload.symbol,
58479
58482
  quantity: payload.use_current ? instance.quantity : trades[0].avg_size,
58480
58483
  kind: app_config.kind,
58481
- stop: payload.stop,
58484
+ stop: stop_orders.stop,
58482
58485
  price_places: app_config.price_places,
58483
58486
  decimal_places: app_config.decimal_places,
58484
58487
  place: true
@@ -58972,7 +58975,8 @@ class ExchangeAccount {
58972
58975
  place = true,
58973
58976
  stop,
58974
58977
  use_current,
58975
- ignore_config
58978
+ ignore_config,
58979
+ risky
58976
58980
  } = payload;
58977
58981
  const position2 = await this.syncAccount({
58978
58982
  symbol,
@@ -58986,7 +58990,7 @@ class ExchangeAccount {
58986
58990
  let condition = ignore_config ? true : position2?.config;
58987
58991
  if (condition) {
58988
58992
  let entry = payload.tp ? position2.entry || config2.entry : config2.entry;
58989
- const v = stop ? "place_stop_orders" : "place_limit_orders";
58993
+ const v = stop ? "place_stop_orders" : risky ? "dangerous_entry_orders" : "place_limit_orders";
58990
58994
  return await this.placeSharedOrder(v, {
58991
58995
  symbol,
58992
58996
  entry,
@@ -60009,7 +60013,8 @@ class ExchangeAccount {
60009
60013
  cancel,
60010
60014
  stop,
60011
60015
  ignore_config,
60012
- target_pnl
60016
+ target_pnl,
60017
+ risky
60013
60018
  } = payload;
60014
60019
  if (cancel) {
60015
60020
  await this.cancelOrders({
@@ -60024,7 +60029,8 @@ class ExchangeAccount {
60024
60029
  raw: payload.raw,
60025
60030
  stop,
60026
60031
  ignore_config,
60027
- place
60032
+ place,
60033
+ risky
60028
60034
  });
60029
60035
  }
60030
60036
  await this.syncAccount({
package/dist/index.d.ts CHANGED
@@ -2082,6 +2082,7 @@ declare class ExchangeAccount$1 {
2082
2082
  stop?: boolean;
2083
2083
  use_current?: boolean;
2084
2084
  ignore_config?: boolean;
2085
+ risky?: boolean;
2085
2086
  }): Promise<any>;
2086
2087
  verifyStopLoss(payload: {
2087
2088
  symbol: string;
@@ -2316,6 +2317,7 @@ declare class ExchangeAccount$1 {
2316
2317
  cancel?: boolean;
2317
2318
  ignore_config?: boolean;
2318
2319
  target_pnl?: number;
2320
+ risky?: boolean;
2319
2321
  }): Promise<any>;
2320
2322
  updateConfigPnl(payload: {
2321
2323
  symbol: string;
package/dist/index.js CHANGED
@@ -55031,7 +55031,7 @@ class Strategy {
55031
55031
  }
55032
55032
  }
55033
55033
 
55034
- // src/exchanges/binance.ts
55034
+ // src/exchanges/binance/index.ts
55035
55035
  var import_binance = __toESM(require_lib2(), 1);
55036
55036
  // src/types/index.ts
55037
55037
  class BaseExchange {
@@ -55204,16 +55204,18 @@ class BaseExchange {
55204
55204
  price_places = "%.1f",
55205
55205
  symbol
55206
55206
  } = payload;
55207
+ const order_payload = orders.map((order) => ({
55208
+ ...order,
55209
+ price: order.entry,
55210
+ kind,
55211
+ side: kind.toLowerCase() === "long" ? "buy" : "sell",
55212
+ stop: undefined
55213
+ }));
55207
55214
  return await this._createLimitPurchaseOrders({
55208
55215
  symbol,
55209
55216
  price_places,
55210
55217
  decimal_places,
55211
- orders: orders.map((order) => ({
55212
- ...order,
55213
- price: order.entry,
55214
- kind,
55215
- side: kind.toLowerCase() === "long" ? "buy" : "sell"
55216
- }))
55218
+ orders: order_payload
55217
55219
  });
55218
55220
  }
55219
55221
  async placeMarketOrder(payload) {
@@ -55361,7 +55363,7 @@ class BaseExchange {
55361
55363
  }
55362
55364
  }
55363
55365
 
55364
- // src/exchanges/binance.ts
55366
+ // src/exchanges/binance/index.ts
55365
55367
  var import_p_limit = __toESM(require_p_limit(), 1);
55366
55368
  var CONSTANTS = {
55367
55369
  SPOT_TO_FIAT: "MAIN_C2C",
@@ -56465,7 +56467,7 @@ async function cancelOrdersParallel(payload) {
56465
56467
  return results;
56466
56468
  }
56467
56469
 
56468
- // src/exchanges/bybit.ts
56470
+ // src/exchanges/bybit/index.ts
56469
56471
  var import_bybit_api = __toESM(require_lib3(), 1);
56470
56472
  var import_p_limit2 = __toESM(require_p_limit(), 1);
56471
56473
  async function initClient2(credentials, options) {
@@ -56811,7 +56813,8 @@ function buildPosition2(position2, orders, options) {
56811
56813
  stop_loss,
56812
56814
  take_profit,
56813
56815
  tp_quantity,
56814
- stop_quantity
56816
+ stop_quantity,
56817
+ liquidation: position2.liqPrice ? parseFloat(position2.liqPrice) : null
56815
56818
  };
56816
56819
  }
56817
56820
  var emptyPosition2 = {
@@ -58426,7 +58429,7 @@ class ExchangeAccount {
58426
58429
  symbol: payload.symbol,
58427
58430
  quantity: payload.use_current ? instance.quantity : trades[0].avg_size,
58428
58431
  kind: app_config.kind,
58429
- stop: payload.stop,
58432
+ stop: stop_orders.stop,
58430
58433
  price_places: app_config.price_places,
58431
58434
  decimal_places: app_config.decimal_places,
58432
58435
  place: true
@@ -58920,7 +58923,8 @@ class ExchangeAccount {
58920
58923
  place = true,
58921
58924
  stop,
58922
58925
  use_current,
58923
- ignore_config
58926
+ ignore_config,
58927
+ risky
58924
58928
  } = payload;
58925
58929
  const position2 = await this.syncAccount({
58926
58930
  symbol,
@@ -58934,7 +58938,7 @@ class ExchangeAccount {
58934
58938
  let condition = ignore_config ? true : position2?.config;
58935
58939
  if (condition) {
58936
58940
  let entry = payload.tp ? position2.entry || config2.entry : config2.entry;
58937
- const v = stop ? "place_stop_orders" : "place_limit_orders";
58941
+ const v = stop ? "place_stop_orders" : risky ? "dangerous_entry_orders" : "place_limit_orders";
58938
58942
  return await this.placeSharedOrder(v, {
58939
58943
  symbol,
58940
58944
  entry,
@@ -59957,7 +59961,8 @@ class ExchangeAccount {
59957
59961
  cancel,
59958
59962
  stop,
59959
59963
  ignore_config,
59960
- target_pnl
59964
+ target_pnl,
59965
+ risky
59961
59966
  } = payload;
59962
59967
  if (cancel) {
59963
59968
  await this.cancelOrders({
@@ -59972,7 +59977,8 @@ class ExchangeAccount {
59972
59977
  raw: payload.raw,
59973
59978
  stop,
59974
59979
  ignore_config,
59975
- place
59980
+ place,
59981
+ risky
59976
59982
  });
59977
59983
  }
59978
59984
  await this.syncAccount({
@@ -61759,7 +61759,7 @@ class Strategy {
61759
61759
  }
61760
61760
  }
61761
61761
 
61762
- // src/exchanges/binance.ts
61762
+ // src/exchanges/binance/index.ts
61763
61763
  var import_binance = __toESM(require_lib2());
61764
61764
  // src/types/index.ts
61765
61765
  class BaseExchange {
@@ -61932,16 +61932,18 @@ class BaseExchange {
61932
61932
  price_places = "%.1f",
61933
61933
  symbol
61934
61934
  } = payload;
61935
+ const order_payload = orders.map((order) => ({
61936
+ ...order,
61937
+ price: order.entry,
61938
+ kind,
61939
+ side: kind.toLowerCase() === "long" ? "buy" : "sell",
61940
+ stop: undefined
61941
+ }));
61935
61942
  return await this._createLimitPurchaseOrders({
61936
61943
  symbol,
61937
61944
  price_places,
61938
61945
  decimal_places,
61939
- orders: orders.map((order) => ({
61940
- ...order,
61941
- price: order.entry,
61942
- kind,
61943
- side: kind.toLowerCase() === "long" ? "buy" : "sell"
61944
- }))
61946
+ orders: order_payload
61945
61947
  });
61946
61948
  }
61947
61949
  async placeMarketOrder(payload) {
@@ -62089,7 +62091,7 @@ class BaseExchange {
62089
62091
  }
62090
62092
  }
62091
62093
 
62092
- // src/exchanges/binance.ts
62094
+ // src/exchanges/binance/index.ts
62093
62095
  var import_p_limit = __toESM(require_p_limit());
62094
62096
  var CONSTANTS = {
62095
62097
  SPOT_TO_FIAT: "MAIN_C2C",
@@ -63193,7 +63195,7 @@ async function cancelOrdersParallel(payload) {
63193
63195
  return results;
63194
63196
  }
63195
63197
 
63196
- // src/exchanges/bybit.ts
63198
+ // src/exchanges/bybit/index.ts
63197
63199
  var import_bybit_api = __toESM(require_lib3());
63198
63200
  var import_p_limit2 = __toESM(require_p_limit());
63199
63201
  async function initClient2(credentials, options) {
@@ -63539,7 +63541,8 @@ function buildPosition2(position2, orders, options) {
63539
63541
  stop_loss,
63540
63542
  take_profit,
63541
63543
  tp_quantity,
63542
- stop_quantity
63544
+ stop_quantity,
63545
+ liquidation: position2.liqPrice ? parseFloat(position2.liqPrice) : null
63543
63546
  };
63544
63547
  }
63545
63548
  var emptyPosition2 = {
@@ -65154,7 +65157,7 @@ class ExchangeAccount {
65154
65157
  symbol: payload.symbol,
65155
65158
  quantity: payload.use_current ? instance.quantity : trades[0].avg_size,
65156
65159
  kind: app_config.kind,
65157
- stop: payload.stop,
65160
+ stop: stop_orders.stop,
65158
65161
  price_places: app_config.price_places,
65159
65162
  decimal_places: app_config.decimal_places,
65160
65163
  place: true
@@ -65648,7 +65651,8 @@ class ExchangeAccount {
65648
65651
  place = true,
65649
65652
  stop,
65650
65653
  use_current,
65651
- ignore_config
65654
+ ignore_config,
65655
+ risky
65652
65656
  } = payload;
65653
65657
  const position2 = await this.syncAccount({
65654
65658
  symbol,
@@ -65662,7 +65666,7 @@ class ExchangeAccount {
65662
65666
  let condition = ignore_config ? true : position2?.config;
65663
65667
  if (condition) {
65664
65668
  let entry = payload.tp ? position2.entry || config2.entry : config2.entry;
65665
- const v = stop ? "place_stop_orders" : "place_limit_orders";
65669
+ const v = stop ? "place_stop_orders" : risky ? "dangerous_entry_orders" : "place_limit_orders";
65666
65670
  return await this.placeSharedOrder(v, {
65667
65671
  symbol,
65668
65672
  entry,
@@ -66685,7 +66689,8 @@ class ExchangeAccount {
66685
66689
  cancel,
66686
66690
  stop,
66687
66691
  ignore_config,
66688
- target_pnl
66692
+ target_pnl,
66693
+ risky
66689
66694
  } = payload;
66690
66695
  if (cancel) {
66691
66696
  await this.cancelOrders({
@@ -66700,7 +66705,8 @@ class ExchangeAccount {
66700
66705
  raw: payload.raw,
66701
66706
  stop,
66702
66707
  ignore_config,
66703
- place
66708
+ place,
66709
+ risky
66704
66710
  });
66705
66711
  }
66706
66712
  await this.syncAccount({
@@ -61736,7 +61736,7 @@ class Strategy {
61736
61736
  }
61737
61737
  }
61738
61738
 
61739
- // src/exchanges/binance.ts
61739
+ // src/exchanges/binance/index.ts
61740
61740
  var import_binance = __toESM(require_lib2(), 1);
61741
61741
  // src/types/index.ts
61742
61742
  class BaseExchange {
@@ -61909,16 +61909,18 @@ class BaseExchange {
61909
61909
  price_places = "%.1f",
61910
61910
  symbol
61911
61911
  } = payload;
61912
+ const order_payload = orders.map((order) => ({
61913
+ ...order,
61914
+ price: order.entry,
61915
+ kind,
61916
+ side: kind.toLowerCase() === "long" ? "buy" : "sell",
61917
+ stop: undefined
61918
+ }));
61912
61919
  return await this._createLimitPurchaseOrders({
61913
61920
  symbol,
61914
61921
  price_places,
61915
61922
  decimal_places,
61916
- orders: orders.map((order) => ({
61917
- ...order,
61918
- price: order.entry,
61919
- kind,
61920
- side: kind.toLowerCase() === "long" ? "buy" : "sell"
61921
- }))
61923
+ orders: order_payload
61922
61924
  });
61923
61925
  }
61924
61926
  async placeMarketOrder(payload) {
@@ -62066,7 +62068,7 @@ class BaseExchange {
62066
62068
  }
62067
62069
  }
62068
62070
 
62069
- // src/exchanges/binance.ts
62071
+ // src/exchanges/binance/index.ts
62070
62072
  var import_p_limit = __toESM(require_p_limit(), 1);
62071
62073
  var CONSTANTS = {
62072
62074
  SPOT_TO_FIAT: "MAIN_C2C",
@@ -63170,7 +63172,7 @@ async function cancelOrdersParallel(payload) {
63170
63172
  return results;
63171
63173
  }
63172
63174
 
63173
- // src/exchanges/bybit.ts
63175
+ // src/exchanges/bybit/index.ts
63174
63176
  var import_bybit_api = __toESM(require_lib3(), 1);
63175
63177
  var import_p_limit2 = __toESM(require_p_limit(), 1);
63176
63178
  async function initClient2(credentials, options) {
@@ -63516,7 +63518,8 @@ function buildPosition2(position2, orders, options) {
63516
63518
  stop_loss,
63517
63519
  take_profit,
63518
63520
  tp_quantity,
63519
- stop_quantity
63521
+ stop_quantity,
63522
+ liquidation: position2.liqPrice ? parseFloat(position2.liqPrice) : null
63520
63523
  };
63521
63524
  }
63522
63525
  var emptyPosition2 = {
@@ -65131,7 +65134,7 @@ class ExchangeAccount {
65131
65134
  symbol: payload.symbol,
65132
65135
  quantity: payload.use_current ? instance.quantity : trades[0].avg_size,
65133
65136
  kind: app_config.kind,
65134
- stop: payload.stop,
65137
+ stop: stop_orders.stop,
65135
65138
  price_places: app_config.price_places,
65136
65139
  decimal_places: app_config.decimal_places,
65137
65140
  place: true
@@ -65625,7 +65628,8 @@ class ExchangeAccount {
65625
65628
  place = true,
65626
65629
  stop,
65627
65630
  use_current,
65628
- ignore_config
65631
+ ignore_config,
65632
+ risky
65629
65633
  } = payload;
65630
65634
  const position2 = await this.syncAccount({
65631
65635
  symbol,
@@ -65639,7 +65643,7 @@ class ExchangeAccount {
65639
65643
  let condition = ignore_config ? true : position2?.config;
65640
65644
  if (condition) {
65641
65645
  let entry = payload.tp ? position2.entry || config2.entry : config2.entry;
65642
- const v = stop ? "place_stop_orders" : "place_limit_orders";
65646
+ const v = stop ? "place_stop_orders" : risky ? "dangerous_entry_orders" : "place_limit_orders";
65643
65647
  return await this.placeSharedOrder(v, {
65644
65648
  symbol,
65645
65649
  entry,
@@ -66662,7 +66666,8 @@ class ExchangeAccount {
66662
66666
  cancel,
66663
66667
  stop,
66664
66668
  ignore_config,
66665
- target_pnl
66669
+ target_pnl,
66670
+ risky
66666
66671
  } = payload;
66667
66672
  if (cancel) {
66668
66673
  await this.cancelOrders({
@@ -66677,7 +66682,8 @@ class ExchangeAccount {
66677
66682
  raw: payload.raw,
66678
66683
  stop,
66679
66684
  ignore_config,
66680
- place
66685
+ place,
66686
+ risky
66681
66687
  });
66682
66688
  }
66683
66689
  await this.syncAccount({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gbozee/ultimate",
3
3
  "type": "module",
4
- "version": "0.0.2-141",
4
+ "version": "0.0.2-144",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",