@orderly.network/hooks 2.8.14 → 2.9.0-alpha.0

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
@@ -38,9 +38,9 @@ var __export = (target, all) => {
38
38
  // src/version.ts
39
39
  if (typeof window !== "undefined") {
40
40
  window.__ORDERLY_VERSION__ = window.__ORDERLY_VERSION__ || {};
41
- window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "2.8.14";
41
+ window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "2.9.0-alpha.0";
42
42
  }
43
- var version_default = "2.8.14";
43
+ var version_default = "2.9.0-alpha.0";
44
44
  var fetcher = (url, init2 = {}, queryOptions) => get(url, init2, queryOptions?.formatter);
45
45
  var noCacheConfig = {
46
46
  dedupingInterval: 0,
@@ -746,6 +746,8 @@ function formatDate(date) {
746
746
  const day = String(date.getDate()).padStart(2, "0");
747
747
  return `${year}-${month}-${day}`;
748
748
  }
749
+
750
+ // src/referral/useDaily.ts
749
751
  var useDaily = (options) => {
750
752
  const path2 = "/v1/volume/user/daily";
751
753
  const endDate = options?.startDate || /* @__PURE__ */ new Date();
@@ -757,7 +759,7 @@ var useDaily = (options) => {
757
759
  end_date
758
760
  )}`;
759
761
  const { data: dailyVolume, mutate: mutate6 } = usePrivateQuery(url, {
760
- revalidateOnFocus: true
762
+ revalidateOnFocus: false
761
763
  });
762
764
  return {
763
765
  data: dailyVolume,
@@ -2576,6 +2578,7 @@ var createDataStore = (config) => {
2576
2578
  loading: false,
2577
2579
  error: null,
2578
2580
  hydrated: false,
2581
+ setHydrated: (hydrated) => set({ hydrated }),
2579
2582
  fetchData: async (dynamicBaseUrl, options) => {
2580
2583
  try {
2581
2584
  set({ loading: true });
@@ -2620,7 +2623,7 @@ var createDataStore = (config) => {
2620
2623
  */
2621
2624
  onRehydrateStorage: () => (state, error) => {
2622
2625
  if (state && !error) {
2623
- state.hydrated = true;
2626
+ state.setHydrated(true);
2624
2627
  }
2625
2628
  }
2626
2629
  }
@@ -12684,7 +12687,8 @@ var useAllBrokers = () => {
12684
12687
  formatter: (res) => {
12685
12688
  const { rows } = res;
12686
12689
  return rows?.map((item) => ({ [item.broker_id]: item.broker_name })).reduce((acc, curr) => ({ ...acc, ...curr }), {});
12687
- }
12690
+ },
12691
+ revalidateOnFocus: false
12688
12692
  });
12689
12693
  return [data];
12690
12694
  };
@@ -18683,9 +18687,14 @@ var useRestrictedInfo = (options) => {
18683
18687
  const [restrictedOpen, setRestrictedOpen] = useState(false);
18684
18688
  const [canUnblock, setCanUnblock] = useState(false);
18685
18689
  const [accessRestricted, setAccessRestricted] = useLocalStorage("orderly_access_restricted", void 0);
18686
- const { data: ipInfo } = useQuery("/v1/ip_info");
18690
+ const { data: ipInfo } = useQuery("/v1/ip_info", {
18691
+ revalidateOnFocus: false
18692
+ });
18687
18693
  const { data: restrictedAreas } = useQuery(
18688
- "/v1/restricted_areas"
18694
+ "/v1/restricted_areas",
18695
+ {
18696
+ revalidateOnFocus: false
18697
+ }
18689
18698
  );
18690
18699
  useEffect(() => {
18691
18700
  if (!restrictedAreas || !ipInfo) {