@orderly.network/hooks 2.0.2 → 2.0.3

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
@@ -28,7 +28,7 @@ declare global {
28
28
  };
29
29
  }
30
30
  }
31
- declare const _default: "2.0.2";
31
+ declare const _default: "2.0.3";
32
32
 
33
33
  type useQueryOptions<T> = SWRConfiguration & {
34
34
  formatter?: (data: any) => T;
package/dist/index.d.ts CHANGED
@@ -28,7 +28,7 @@ declare global {
28
28
  };
29
29
  }
30
30
  }
31
- declare const _default: "2.0.2";
31
+ declare const _default: "2.0.3";
32
32
 
33
33
  type useQueryOptions<T> = SWRConfiguration & {
34
34
  formatter?: (data: any) => T;
package/dist/index.js CHANGED
@@ -60,9 +60,9 @@ var __export = (target, all) => {
60
60
  // src/version.ts
61
61
  if (typeof window !== "undefined") {
62
62
  window.__ORDERLY_VERSION__ = window.__ORDERLY_VERSION__ || {};
63
- window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "2.0.2";
63
+ window.__ORDERLY_VERSION__["@orderly.network/hooks"] = "2.0.3";
64
64
  }
65
- var version_default = "2.0.2";
65
+ var version_default = "2.0.3";
66
66
  var fetcher = (url, init2 = {}, queryOptions) => net.get(url, init2, queryOptions?.formatter);
67
67
  var OrderlyContext = React.createContext({
68
68
  // configStore: new MemoryConfigStore(),
@@ -6908,10 +6908,17 @@ function totalInputHandle(inputs) {
6908
6908
  values2.total = total.toString();
6909
6909
  }
6910
6910
  const quantity = total.div(price);
6911
+ let order_quantity = quantity.toDecimalPlaces(Math.min(config.base_dp, quantity.dp())).toString();
6912
+ if (config.base_tick >= 1) {
6913
+ order_quantity = formatNumber(
6914
+ order_quantity,
6915
+ new utils.Decimal(config?.base_tick || "0").toNumber()
6916
+ );
6917
+ }
6911
6918
  return [
6912
6919
  {
6913
6920
  ...values2,
6914
- order_quantity: quantity.toDecimalPlaces(Math.min(config.base_dp, quantity.dp())).toString()
6921
+ order_quantity
6915
6922
  },
6916
6923
  input,
6917
6924
  value,