@orderly.network/hooks 2.12.1 → 2.12.2

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.d.mts CHANGED
@@ -170,7 +170,7 @@ declare global {
170
170
  };
171
171
  }
172
172
  }
173
- declare const _default: "2.12.1";
173
+ declare const _default: "2.12.2";
174
174
 
175
175
  declare const fetcher: (url: string, init: RequestInit | undefined, queryOptions: useQueryOptions<any>) => Promise<any>;
176
176
  type useQueryOptions<T> = SWRConfiguration & {
@@ -3135,6 +3135,12 @@ type TpslPriceParams = {
3135
3135
  slPrice?: string;
3136
3136
  liqPrice: number | null;
3137
3137
  side?: OrderSide;
3138
+ /**
3139
+ * Mark price for the symbol. When set with `side`, liq values that `useGetEstLiqPrice` would
3140
+ * hide (invalid vs mark — e.g. long est. liq above mark) are ignored here too so SL checks do
3141
+ * not run against a number the UI does not show as “Est. liq. price”.
3142
+ */
3143
+ markPrice?: number | null;
3138
3144
  /** Current position qty (signed: positive=Long, negative=Short). If missing, treated as is_reducing=true, skip liq check. */
3139
3145
  currentPosition?: number;
3140
3146
  /** Order quantity (non-negative, sign derived from side). If missing or 0, treated as is_reducing=true, skip liq check. */
package/dist/index.d.ts CHANGED
@@ -170,7 +170,7 @@ declare global {
170
170
  };
171
171
  }
172
172
  }
173
- declare const _default: "2.12.1";
173
+ declare const _default: "2.12.2";
174
174
 
175
175
  declare const fetcher: (url: string, init: RequestInit | undefined, queryOptions: useQueryOptions<any>) => Promise<any>;
176
176
  type useQueryOptions<T> = SWRConfiguration & {
@@ -3135,6 +3135,12 @@ type TpslPriceParams = {
3135
3135
  slPrice?: string;
3136
3136
  liqPrice: number | null;
3137
3137
  side?: OrderSide;
3138
+ /**
3139
+ * Mark price for the symbol. When set with `side`, liq values that `useGetEstLiqPrice` would
3140
+ * hide (invalid vs mark — e.g. long est. liq above mark) are ignored here too so SL checks do
3141
+ * not run against a number the UI does not show as “Est. liq. price”.
3142
+ */
3143
+ markPrice?: number | null;
3138
3144
  /** Current position qty (signed: positive=Long, negative=Short). If missing, treated as is_reducing=true, skip liq check. */
3139
3145
  currentPosition?: number;
3140
3146
  /** Order quantity (non-negative, sign derived from side). If missing or 0, treated as is_reducing=true, skip liq check. */
package/dist/index.js CHANGED
@@ -75,9 +75,9 @@ function useMarketCategoriesConfig() {
75
75
  // src/version.ts
76
76
  if (typeof window !== "undefined") {
77
77
  window.__ORDERLY_VERSION__ = window.__ORDERLY_VERSION__ || {};
78
- window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "2.12.1";
78
+ window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "2.12.2";
79
79
  }
80
- var version_default = "2.12.1";
80
+ var version_default = "2.12.2";
81
81
  var fetcher = (url, init2 = {}, queryOptions) => net.get(url, init2, queryOptions?.formatter);
82
82
  var noCacheConfig = {
83
83
  dedupingInterval: 0,
@@ -3154,7 +3154,9 @@ var DEFAULT_SYMBOL_DEPTHS = {
3154
3154
  };
3155
3155
  var DEFAULT_SYMBOL_DISPLAY_NAMES = {
3156
3156
  PERP_XAU_USDC: "XAU (Gold) ",
3157
- PERP_XAG_USDC: "XAG (Silver)"
3157
+ PERP_XAG_USDC: "XAG (Silver)",
3158
+ PERP_CL_USDC: "CL (WTI Crude Oil)",
3159
+ PERP_BZ_USDC: "BZ (Brent Crude Oil)"
3158
3160
  };
3159
3161
  var ProxyConfigStore = class {
3160
3162
  constructor(_originConfigStore) {
@@ -19706,6 +19708,7 @@ var useTpslPriceChecker = (params) => {
19706
19708
  slPrice,
19707
19709
  liqPrice,
19708
19710
  side,
19711
+ markPrice,
19709
19712
  currentPosition,
19710
19713
  orderQuantity
19711
19714
  } = params;
@@ -19761,6 +19764,14 @@ var useTpslPriceChecker = (params) => {
19761
19764
  if (slPrice === void 0 || liqPrice === void 0 || side === void 0 || liqPrice === null) {
19762
19765
  return null;
19763
19766
  }
19767
+ if (markPrice != null && Number.isFinite(markPrice) && markPrice > 0) {
19768
+ if (side === types.OrderSide.BUY && liqPrice > markPrice) {
19769
+ return null;
19770
+ }
19771
+ if (side === types.OrderSide.SELL && liqPrice < markPrice) {
19772
+ return null;
19773
+ }
19774
+ }
19764
19775
  let slPriceDecimal;
19765
19776
  let liqPriceDecimal;
19766
19777
  try {
@@ -19787,6 +19798,7 @@ var useTpslPriceChecker = (params) => {
19787
19798
  slPrice,
19788
19799
  liqPrice,
19789
19800
  side,
19801
+ markPrice,
19790
19802
  warning_threshold,
19791
19803
  currentPosition,
19792
19804
  orderQuantity