@orbs-network/spot-react 0.0.72 → 0.0.74

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.
@@ -1,4 +1,4 @@
1
- import { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as E, b as x, e as R, H as y, f as M } from "./index-CEgXYLzJ.js";
1
+ import { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as E, b as x, e as R, H as y, f as M } from "./index-BwhhYdOZ.js";
2
2
  class S extends p {
3
3
  constructor({ callbackSelector: r, cause: a, data: n, extraData: i, sender: f, urls: t }) {
4
4
  var o;
@@ -2511,7 +2511,7 @@ class Ow {
2511
2511
  const yt = new Ow(), Dw = (e) => {
2512
2512
  var o;
2513
2513
  const t = H(e.order.witness.output.limit || 0).gt(1), r = e.order.witness.output.stop, n = H(r || 0).eq(vf), s = H(r || 0).gt(0), a = ((o = e.metadata.chunks) == null ? void 0 : o.length) || H(e.order.witness.input.maxAmount).div(H(e.order.witness.input.amount)).toNumber();
2514
- return n ? Ve.TAKE_PROFIT : s ? t ? Ve.STOP_LOSS_LIMIT : Ve.STOP_LOSS_MARKET : t ? a >= 1 && t ? Ve.TWAP_LIMIT : t ? Ve.LIMIT : Ve.TWAP_MARKET : Ve.TWAP_MARKET;
2514
+ return n ? Ve.TAKE_PROFIT : s ? t ? Ve.STOP_LOSS_LIMIT : Ve.STOP_LOSS_MARKET : t ? a > 1 && t ? Ve.TWAP_LIMIT : t ? Ve.LIMIT : Ve.TWAP_MARKET : Ve.TWAP_MARKET;
2515
2515
  }, _w = (e) => {
2516
2516
  var s;
2517
2517
  const t = ((s = e.metadata.chunks) == null ? void 0 : s.filter((a) => a.status === "success").length) || 0, r = e.metadata.expectedChunks || 0, n = H(t).dividedBy(r).toNumber();
@@ -2937,7 +2937,7 @@ const Yw = async ({
2937
2937
  }) => (await Promise.all([
2938
2938
  s ? Yw({ chainId: r, signal: e, page: t, limit: n, filters: { accounts: [a], configs: s.twapConfig ? [s.twapConfig] : [] } }) : Promise.resolve([]),
2939
2939
  zw({ chainId: r, signal: e, account: a, exchange: s == null ? void 0 : s.adapter })
2940
- ]).then(([c, l]) => [...c, ...l])).sort((c, l) => l.createdAt - c.createdAt), Jw = "0.0.72", e3 = {
2940
+ ]).then(([c, l]) => [...c, ...l])).sort((c, l) => l.createdAt - c.createdAt), Jw = "0.0.74", e3 = {
2941
2941
  version: Jw
2942
2942
  };
2943
2943
  var yo = class {
@@ -11591,7 +11591,7 @@ async function yu(e, t) {
11591
11591
  });
11592
11592
  return ie === "0x" ? { data: void 0 } : { data: ie };
11593
11593
  } catch (U) {
11594
- const F = i7(U), { offchainLookup: R, offchainLookupSignature: L } = await import("./ccip-DwY9LX_o.js");
11594
+ const F = i7(U), { offchainLookup: R, offchainLookupSignature: L } = await import("./ccip-DRnK5YPv.js");
11595
11595
  if (e.ccipRead !== !1 && (F == null ? void 0 : F.slice(0, 10)) === L && C)
11596
11596
  return { data: await R(e, { data: F, to: C }) };
11597
11597
  throw S && (F == null ? void 0 : F.slice(0, 10)) === "0x101bb98d" ? new ME({ factory: f }) : c0(U, {
@@ -39535,6 +39535,8 @@ const pm = () => {
39535
39535
  switch (e) {
39536
39536
  case Ve.TWAP_MARKET:
39537
39537
  return t("twapMarket");
39538
+ case Ve.LIMIT:
39539
+ return t("limit");
39538
39540
  case Ve.TWAP_LIMIT:
39539
39541
  return t("twapLimit");
39540
39542
  case Ve.STOP_LOSS_MARKET:
@@ -39549,7 +39551,7 @@ const pm = () => {
39549
39551
  }, [t, e]);
39550
39552
  }, eW = () => {
39551
39553
  const { module: e } = oe(), t = ee((r) => r.state.isMarketOrder);
39552
- return J(() => e === xe.TWAP ? t ? Ve.TWAP_MARKET : Ve.TWAP_LIMIT : e === xe.LIMIT ? t ? Ve.LIMIT : Ve.TWAP_LIMIT : e === xe.STOP_LOSS ? t ? Ve.STOP_LOSS_MARKET : Ve.STOP_LOSS_LIMIT : e === xe.TAKE_PROFIT ? Ve.TAKE_PROFIT : Ve.TWAP_MARKET, [e, t]);
39554
+ return J(() => e === xe.TWAP ? t ? Ve.TWAP_MARKET : Ve.TWAP_LIMIT : e === xe.LIMIT ? Ve.LIMIT : e === xe.STOP_LOSS ? t ? Ve.STOP_LOSS_MARKET : Ve.STOP_LOSS_LIMIT : e === xe.TAKE_PROFIT ? Ve.TAKE_PROFIT : Ve.TWAP_MARKET, [e, t]);
39553
39555
  }, Q2 = () => {
39554
39556
  const e = eW();
39555
39557
  return X2(e);
@@ -43671,9 +43673,9 @@ const cK = () => {
43671
43673
  pricePerChunkUsd: m
43672
43674
  }), [l, u, d, f, m]);
43673
43675
  }, _Y = () => {
43674
- const { module: e, marketPrice: t, marketPriceLoading: r } = oe(), n = Le(), { amountUI: s, onChange: a, onPercentageChange: o, usd: i, selectedPercentage: c, error: l, pricePerChunkUI: u, pricePerChunkUsd: d } = xa(), f = ee((C) => C.state.isMarketOrder), m = ee((C) => C.updateState), { isInverted: y, onInvert: g, fromToken: E, toToken: v } = Im(), w = $e(() => {
43675
- m({ triggerPricePercent: void 0, typedTriggerPrice: void 0 });
43676
- }, [m]), A = e !== xe.STOP_LOSS && e !== xe.TAKE_PROFIT;
43676
+ const { module: e, marketPrice: t, marketPriceLoading: r } = oe(), n = Le(), { amountUI: s, onChange: a, onPercentageChange: o, usd: i, selectedPercentage: c, error: l, pricePerChunkUI: u, pricePerChunkUsd: d, isTypedValue: f } = xa(), m = ee((O) => O.state.isMarketOrder), y = ee((O) => O.updateState), { isInverted: g, onInvert: E, fromToken: v, toToken: w } = Im(), A = $e(() => {
43677
+ y({ triggerPricePercent: void 0, typedTriggerPrice: void 0 });
43678
+ }, [y]), C = e !== xe.STOP_LOSS && e !== xe.TAKE_PROFIT;
43677
43679
  return {
43678
43680
  price: s,
43679
43681
  amountPerChunk: u,
@@ -43684,17 +43686,18 @@ const cK = () => {
43684
43686
  onChange: a,
43685
43687
  onPercentageChange: o,
43686
43688
  percentage: c,
43687
- isActive: !f,
43688
- onReset: w,
43689
+ isActive: !m,
43690
+ onReset: A,
43689
43691
  usd: i,
43690
- fromToken: E,
43691
- toToken: v,
43692
+ fromToken: v,
43693
+ toToken: w,
43692
43694
  prefix: "",
43693
43695
  isLoading: r || !t,
43694
- isInverted: y,
43695
- hide: A,
43696
- onInvert: g,
43697
- totalTrades: qr().totalTrades
43696
+ isInverted: g,
43697
+ hide: C,
43698
+ onInvert: E,
43699
+ totalTrades: qr().totalTrades,
43700
+ isTypedValue: f
43698
43701
  };
43699
43702
  }, hK = (e) => {
43700
43703
  const { module: t, marketPrice: r, typedInputAmount: n } = oe(), s = Le(), { amountWei: a } = xa(), o = ee((i) => i.state.isMarketOrder);
@@ -43780,29 +43783,30 @@ const cK = () => {
43780
43783
  usd: s
43781
43784
  };
43782
43785
  }, RY = () => {
43783
- const { module: e, marketPriceLoading: t } = oe(), r = Le(), { amountUI: n, onChange: s, onPercentageChange: a, usd: o, selectedPercentage: i, error: c } = Tc(), { amountUI: l, usd: u } = Xu(), d = ee((O) => O.updateState), f = Pm(), { isLimitPrice: m, toggleLimitPrice: y } = bK(), { isInverted: g, onInvert: E, fromToken: v, toToken: w } = Im(), A = $e(() => {
43784
- d({ typedLimitPrice: void 0 }), d({ limitPricePercent: f });
43785
- }, [d, e, f]), C = J(() => e === xe.STOP_LOSS ? r("stopLossLimitPriceTooltip") : r("limitPriceTooltip"), [r, e]);
43786
+ const { module: e, marketPriceLoading: t } = oe(), r = Le(), { amountUI: n, onChange: s, onPercentageChange: a, usd: o, selectedPercentage: i, error: c, isTypedValue: l } = Tc(), { amountUI: u, usd: d } = Xu(), f = ee((N) => N.updateState), m = Pm(), { isLimitPrice: y, toggleLimitPrice: g } = bK(), { isInverted: E, onInvert: v, fromToken: w, toToken: A } = Im(), C = $e(() => {
43787
+ f({ typedLimitPrice: void 0 }), f({ limitPricePercent: m });
43788
+ }, [f, e, m]), O = J(() => e === xe.STOP_LOSS ? r("stopLossLimitPriceTooltip") : r("limitPriceTooltip"), [r, e]);
43786
43789
  return {
43787
43790
  price: n,
43788
- amountPerChunk: l,
43789
- amountPerChunkUsd: u,
43791
+ amountPerChunk: u,
43792
+ amountPerChunkUsd: d,
43790
43793
  error: c,
43791
43794
  label: r("limitPrice"),
43792
- tooltip: C,
43795
+ tooltip: O,
43793
43796
  onChange: s,
43794
43797
  onPercentageChange: a,
43795
- onReset: A,
43798
+ onReset: C,
43796
43799
  usd: o,
43797
- fromToken: v,
43800
+ fromToken: w,
43798
43801
  tradesAmount: qr().totalTrades,
43799
- toToken: w,
43802
+ toToken: A,
43800
43803
  percentage: i,
43801
- isInverted: g,
43804
+ isInverted: E,
43802
43805
  isLoading: t,
43803
- isLimitPrice: m,
43804
- toggleLimitPrice: y,
43805
- onInvert: E
43806
+ isLimitPrice: y,
43807
+ toggleLimitPrice: g,
43808
+ onInvert: v,
43809
+ isTypedValue: l
43806
43810
  };
43807
43811
  };
43808
43812
  function yK() {
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "@orbs-network/spot-react",
3
- "version": "0.0.72",
3
+ "version": "0.0.74",
4
4
  "description": "Spot React Components - React components for Spot SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/spot-react.umd.cjs",
@@ -1 +1 @@
1
- {"version":3,"file":"order-hooks.d.ts","sourceRoot":"","sources":["../../../../src/hooks/order-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,EACL,WAAW,EACX,SAAS,EAIV,MAAM,uBAAuB,CAAC;AAK/B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAUjC,eAAO,MAAM,aAAa,GAAI,OAAO,SAAS,WAkB7C,CAAC;AAwBF,eAAO,MAAM,oBAAoB,cAGhC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,QAAQ,KAAK,WAEjD,CAAC;AAWF,eAAO,MAAM,cAAc,gBAKf,KAAK,SAShB,CAAC;AAoCF,eAAO,MAAM,cAAc,sEAoC1B,CAAC;AAEF,eAAO,MAA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AAM,kBAAkB,GAC7B,WAAW,KAAK,EAChB,WAAW,KAAK,EAChB,QAAQ,KAAK,uBAUd,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,WAAW,KAAK,EAChB,WAAW,KAAK,EAChB,QAAQ,KAAK,uBAMd,CAAC;AAEF,eAAO,MAAM,0BAA0B,GACrC,WAAW,KAAK,EAChB,WAAW,KAAK,EAChB,QAAQ,KAAK,uBAMd,CAAC;AAEF,eAAO,MAAM,2BAA2B,aAI/B,MAAM,SAad,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;6BAyBpB,KAAK,EAAE;2BA+BR,KAAK;8BA3BH,WAAW;iDAbF,OAAO;wBA/BrB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiGd,CAAC"}
@@ -22,5 +22,6 @@ export declare const useLimitPricePanel: () => {
22
22
  isLimitPrice: boolean;
23
23
  toggleLimitPrice: () => void;
24
24
  onInvert: () => void;
25
+ isTypedValue: boolean;
25
26
  };
26
27
  //# sourceMappingURL=use-limit-price-panel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-limit-price-panel.d.ts","sourceRoot":"","sources":["../../../../src/hooks/use-limit-price-panel.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;CA4C5B,CAAC"}
1
+ {"version":3,"file":"use-limit-price-panel.d.ts","sourceRoot":"","sources":["../../../../src/hooks/use-limit-price-panel.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;CA6C5B,CAAC"}
@@ -23,5 +23,6 @@ export declare const useTriggerPricePanel: () => {
23
23
  hide: boolean;
24
24
  onInvert: () => void;
25
25
  totalTrades: number;
26
+ isTypedValue: boolean;
26
27
  };
27
28
  //# sourceMappingURL=use-trigger-price-panel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-trigger-price-panel.d.ts","sourceRoot":"","sources":["../../../../src/hooks/use-trigger-price-panel.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;CAoC9B,CAAC"}
1
+ {"version":3,"file":"use-trigger-price-panel.d.ts","sourceRoot":"","sources":["../../../../src/hooks/use-trigger-price-panel.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;CAqC9B,CAAC"}
@@ -1,4 +1,4 @@
1
- import { aS as e, C as r, a6 as t, D as i, aC as n, aQ as E, aO as o, aR as _, aP as T, aM as P, aG as u, aj as A, aE as l, aD as I, ai as R, an as O, aB as S, at as d, ar as g, as as L, av as D, au as M, M as C, aJ as m, aK as U, aI as b, aH as p, aL as N, O as c, L as F, P as k, K as y, aN as B, ak as G, aF as h, aq as x, S as f, I as Y, J as H, aw as W, al as v, am as w, a7 as K, be as V, ah as z, T as Q, Z as X, a3 as j, U as q, F as J, ag as Z, ap as $, aX as aa, ba as sa, aZ as ea, aT as ra, aU as ta, aW as ia, bd as na, a_ as Ea, a5 as oa, b9 as _a, b0 as Ta, b5 as Pa, aY as ua, bc as Aa, b7 as la, Y as Ia, b6 as Ra, b8 as Oa, a9 as Sa, ac as da, aa as ga, ad as La, a0 as Da, ab as Ma, aA as Ca, bb as ma, a$ as Ua, b3 as ba, b1 as pa, b4 as Na, b2 as ca, aV as Fa, ae as ka, a4 as ya, X as Ba, V as Ga, az as ha, _ as xa, $ as fa, ay as Ya, af as Ha, W as Wa, N as va, ao as wa, a8 as Ka, a2 as Va, a1 as za, bf as Qa, R as Xa, Q as ja, y as qa, q as Ja, m as Za, h as $a, j as as, G as ss, t as es, r as rs, k as ts, A as is, o as ns, E as Es, x as os, z as _s, p as Ts, v as Ps, u as us, w as As, n as ls, ax as Is } from "./index-CEgXYLzJ.js";
1
+ import { aS as e, C as r, a6 as t, D as i, aC as n, aQ as E, aO as o, aR as _, aP as T, aM as P, aG as u, aj as A, aE as l, aD as I, ai as R, an as O, aB as S, at as d, ar as g, as as L, av as D, au as M, M as C, aJ as m, aK as U, aI as b, aH as p, aL as N, O as c, L as F, P as k, K as y, aN as B, ak as G, aF as h, aq as x, S as f, I as Y, J as H, aw as W, al as v, am as w, a7 as K, be as V, ah as z, T as Q, Z as X, a3 as j, U as q, F as J, ag as Z, ap as $, aX as aa, ba as sa, aZ as ea, aT as ra, aU as ta, aW as ia, bd as na, a_ as Ea, a5 as oa, b9 as _a, b0 as Ta, b5 as Pa, aY as ua, bc as Aa, b7 as la, Y as Ia, b6 as Ra, b8 as Oa, a9 as Sa, ac as da, aa as ga, ad as La, a0 as Da, ab as Ma, aA as Ca, bb as ma, a$ as Ua, b3 as ba, b1 as pa, b4 as Na, b2 as ca, aV as Fa, ae as ka, a4 as ya, X as Ba, V as Ga, az as ha, _ as xa, $ as fa, ay as Ya, af as Ha, W as Wa, N as va, ao as wa, a8 as Ka, a2 as Va, a1 as za, bf as Qa, R as Xa, Q as ja, y as qa, q as Ja, m as Za, h as $a, j as as, G as ss, t as es, r as rs, k as ts, A as is, o as ns, E as Es, x as os, z as _s, p as Ts, v as Ps, u as us, w as As, n as ls, ax as Is } from "./index-BwhhYdOZ.js";
2
2
  export {
3
3
  e as CRASH_ERROR_MESSAGE,
4
4
  r as Components,