@orderly.network/hooks 1.0.28-alpha.12 → 1.0.28-alpha.13

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
@@ -24,7 +24,7 @@ declare global {
24
24
  };
25
25
  }
26
26
  }
27
- declare const _default: "1.0.28-alpha.12";
27
+ declare const _default: "1.0.28-alpha.13";
28
28
 
29
29
  declare type useQueryOptions<T> = SWRConfiguration & {
30
30
  formatter?: (data: any) => T;
package/dist/index.d.ts CHANGED
@@ -24,7 +24,7 @@ declare global {
24
24
  };
25
25
  }
26
26
  }
27
- declare const _default: "1.0.28-alpha.12";
27
+ declare const _default: "1.0.28-alpha.13";
28
28
 
29
29
  declare type useQueryOptions<T> = SWRConfiguration & {
30
30
  formatter?: (data: any) => T;
package/dist/index.js CHANGED
@@ -28,9 +28,9 @@ var useSWRSubscription__default = /*#__PURE__*/_interopDefault(useSWRSubscriptio
28
28
  // src/version.ts
29
29
  if (typeof window !== "undefined") {
30
30
  window.__ORDERLY_VERSION__ = window.__ORDERLY_VERSION__ || {};
31
- window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "1.0.28-alpha.12";
31
+ window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "1.0.28-alpha.13";
32
32
  }
33
- var version_default = "1.0.28-alpha.12";
33
+ var version_default = "1.0.28-alpha.13";
34
34
  var fetcher = (url, init = {}, queryOptions) => net.get(url, init, queryOptions?.formatter);
35
35
  var OrderlyContext = React.createContext({
36
36
  // configStore: new MemoryConfigStore(),
@@ -1968,10 +1968,14 @@ var useMarkets = (type) => {
1968
1968
  if (jsonStr) {
1969
1969
  configStore.set(marketsKey, JSON.parse(jsonStr));
1970
1970
  } else {
1971
+ const defaultTab = { name: "Popular", id: 1 };
1971
1972
  configStore.set(marketsKey, {
1972
1973
  recent: [],
1973
- favorites: [],
1974
- favoriteTabs: [{ name: "Popular", id: 1 }]
1974
+ favorites: [
1975
+ { name: "PERP_ETH_USDC", tabs: [{ ...defaultTab }] },
1976
+ { name: "PERP_BTC_USDC", tabs: [{ ...defaultTab }] }
1977
+ ],
1978
+ favoriteTabs: [{ ...defaultTab }]
1975
1979
  });
1976
1980
  }
1977
1981
  }
@@ -1991,7 +1995,6 @@ var useMarkets = (type) => {
1991
1995
  }
1992
1996
  }
1993
1997
  configStore.set(marketsKey, { ...configStore.getOr(marketsKey, {}), favorites: result });
1994
- localStorage.setItem(marketsKey, JSON.stringify(configStore.get(marketsKey)));
1995
1998
  return result;
1996
1999
  }, [configStore]);
1997
2000
  const getRecent = React.useMemo(() => {
@@ -2008,7 +2011,6 @@ var useMarkets = (type) => {
2008
2011
  ...configStore.getOr(marketsKey, {}),
2009
2012
  "favoriteTabs": tabs3
2010
2013
  });
2011
- localStorage.setItem(marketsKey, JSON.stringify(configStore.get(marketsKey)));
2012
2014
  };
2013
2015
  if (Array.isArray(tab)) {
2014
2016
  saveTabs(tab);
@@ -2040,7 +2042,6 @@ var useMarkets = (type) => {
2040
2042
  ...configStore.getOr(marketsKey, {}),
2041
2043
  "recent": curData
2042
2044
  });
2043
- localStorage.setItem(marketsKey, JSON.stringify(configStore.get(marketsKey)));
2044
2045
  setRecent(curData);
2045
2046
  };
2046
2047
  const setFavoritesData = (symbol, tab, remove = false) => {
@@ -2083,7 +2084,6 @@ var useMarkets = (type) => {
2083
2084
  ...configStore.getOr(marketsKey, {}),
2084
2085
  "favorites": curData
2085
2086
  });
2086
- localStorage.setItem(marketsKey, JSON.stringify(configStore.get(marketsKey)));
2087
2087
  setFavorites(() => curData);
2088
2088
  };
2089
2089
  const getData = (type2) => {
@@ -2126,7 +2126,6 @@ var useMarkets = (type) => {
2126
2126
  ...configStore.getOr(marketsKey, {}),
2127
2127
  "favorites": list
2128
2128
  });
2129
- localStorage.setItem(marketsKey, JSON.stringify(configStore.get(marketsKey)));
2130
2129
  setFavorites(list);
2131
2130
  }
2132
2131
  };
@@ -3740,7 +3739,9 @@ var useDeposit = (options) => {
3740
3739
  const vaultAddress = getVaultAddress();
3741
3740
  return account5.assetsManager.approve(options.address, amount, vaultAddress).then((result) => {
3742
3741
  if (typeof amount !== "undefined") {
3743
- setAllowance((value) => new utils.Decimal(value).add(amount).toString());
3742
+ setAllowance(
3743
+ (value) => new utils.Decimal(value).add(amount || types.MaxUint256.toString()).toString()
3744
+ );
3744
3745
  }
3745
3746
  return result;
3746
3747
  });