@orderly.network/hooks 2.3.1 → 2.3.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.mjs CHANGED
@@ -36,9 +36,9 @@ var __export = (target, all) => {
36
36
  // src/version.ts
37
37
  if (typeof window !== "undefined") {
38
38
  window.__ORDERLY_VERSION__ = window.__ORDERLY_VERSION__ || {};
39
- window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "2.3.1";
39
+ window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "2.3.2";
40
40
  }
41
- var version_default = "2.3.1";
41
+ var version_default = "2.3.2";
42
42
  var fetcher = (url, init2 = {}, queryOptions) => get(url, init2, queryOptions?.formatter);
43
43
  var OrderlyContext = createContext({
44
44
  // configStore: new MemoryConfigStore(),
@@ -2274,6 +2274,10 @@ var useTickerStream = (symbol) => {
2274
2274
  };
2275
2275
 
2276
2276
  // src/orderly/useOrderbookStream.ts
2277
+ var DEFAULT_DEPTH = {
2278
+ PERP_BTC_USDC: "1",
2279
+ PERP_ETH_USDC: "0.1"
2280
+ };
2277
2281
  var paddingFn = (len) => Array(len).fill([
2278
2282
  Number.NaN,
2279
2283
  Number.NaN,
@@ -2405,8 +2409,12 @@ var useOrderbookStream = (symbol, initial = INIT_DATA, options) => {
2405
2409
  return [tick];
2406
2410
  }, [config("quote_tick")]);
2407
2411
  useEffect(() => {
2408
- setDepth(config("quote_tick"));
2409
- }, [config("quote_tick")]);
2412
+ if (DEFAULT_DEPTH[symbol]) {
2413
+ setDepth(Number(DEFAULT_DEPTH[symbol]));
2414
+ } else {
2415
+ setDepth(config("quote_tick"));
2416
+ }
2417
+ }, [config("quote_tick"), symbol]);
2410
2418
  const ws = useWS();
2411
2419
  const ticker = useTickerStream(symbol);
2412
2420
  const eventEmitter = useEventEmitter();
@@ -6954,20 +6962,22 @@ var useDistributionHistory = (parmas) => {
6954
6962
  return [parsedData, { meta: data?.meta, isLoading, isValidating }];
6955
6963
  };
6956
6964
  var useTransferHistory = (parmas) => {
6957
- const { dataRange, page, size, side, fromId, toId } = parmas;
6965
+ const { dataRange, page, size, side, fromId, toId, main_sub_only } = parmas;
6958
6966
  const infos = useSymbolsInfo();
6959
6967
  const memoizedQueryKey = React.useMemo(() => {
6960
6968
  const search = new URLSearchParams();
6961
6969
  search.set("page", page.toString());
6962
6970
  search.set("size", size.toString());
6963
6971
  search.set("side", side);
6964
- search.set("main_sub_only", `${true}`);
6972
+ if (main_sub_only === true || main_sub_only === false) {
6973
+ search.set("main_sub_only", main_sub_only.toString());
6974
+ }
6965
6975
  if (dataRange) {
6966
6976
  search.set("start_t", dataRange[0].toString());
6967
6977
  search.set("end_t", dataRange[1].toString());
6968
6978
  }
6969
6979
  return `/v1/internal_transfer_history?${search.toString()}`;
6970
- }, [page, size, fromId, toId, dataRange]);
6980
+ }, [page, size, fromId, toId, dataRange, main_sub_only]);
6971
6981
  const { data, isLoading } = usePrivateQuery(
6972
6982
  memoizedQueryKey,
6973
6983
  {