aegis-swap-widget 0.12.0 → 0.12.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/CHANGELOG.md +28 -0
- package/dist/{EngineTradeMarketChart-B-RlSrjp.js → EngineTradeMarketChart-DJSBcaZm.js} +42 -41
- package/dist/aegis-swap-widget.js +1 -1
- package/dist/{index-SHw1Anop.js → index-CEotHPNT.js} +11969 -11785
- package/dist/styles.css +1 -1
- package/dist/widget/engine-controller/enginePositionManageCopy.d.ts +7 -0
- package/dist/widget/engine-controller/engineRepayReceipt.d.ts +11 -0
- package/dist/widget/engine-controller/engineTransactionView.d.ts +3 -0
- package/dist/widget/engine-controller/useEnginePositionActions.d.ts +2 -1
- package/dist/widget/engine-controller/useEngineSubmit.d.ts +3 -0
- package/dist/widget/engine-ui/EngineMarketContracts.d.ts +18 -0
- package/dist/widget/engine-ui/ManageLedgerChange.d.ts +4 -0
- package/dist/widget/engine-ui/shareVerification.d.ts +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.12.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7c89417: Keep long deposit amounts fully visible in Tap entry and review, use consistent hover and focus borders, preserve numeric tokens when narrow trade estimates wrap, and keep direction text clear of wallet controls in narrow tickets.
|
|
8
|
+
- 7c89417: Share the existing bounded pool price-line response validator with same-origin chart transports. Preserve verified quiet-market price segments, legacy candle compatibility, and coverage/reorg/gap checks. The playground proxy now forwards validated pool/1d price-line requests without dropping their checkpoint envelope.
|
|
9
|
+
|
|
10
|
+
Orient historical price segments consistently with candles and the current pool price on quote-first markets.
|
|
11
|
+
|
|
12
|
+
- 7c89417: Show quote-estimated USD debt reduction and before/after position values for trade repayments. Keep plain-loan repayment wording, show token amounts when USD prices are unavailable, and estimate network fees in USD when the same chain's native-token price is available. Keep receipt actions reachable in short confirmation sheets.
|
|
13
|
+
|
|
14
|
+
Label portfolio position values as estimated assets and load each position's P&L on request, with retry controls and explicit native-token unavailability. Add a market contracts drawer for copying addresses and opening the configured explorer.
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [7c89417]
|
|
17
|
+
- @aegis-engine/core@0.8.2
|
|
18
|
+
|
|
19
|
+
## 0.12.1
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- ab04bc3: Use bounded, block-pinned SDK swap resizing for repayment and two-step close.
|
|
24
|
+
Keep slippage and token-debit guards, and distinguish swap shortfalls from
|
|
25
|
+
insufficient token balances without suggesting unverified smaller repayments.
|
|
26
|
+
The widget opts into canonical-frame verification up to 30 seconds old for
|
|
27
|
+
repayment/close; Core callers retain strict verification unless explicitly opted in.
|
|
28
|
+
- Updated dependencies [ab04bc3]
|
|
29
|
+
- @aegis-engine/core@0.8.1
|
|
30
|
+
|
|
3
31
|
## 0.12.0
|
|
4
32
|
|
|
5
33
|
### Minor Changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as h, jsx as i, Fragment as Pe } from "react/jsx-runtime";
|
|
2
2
|
import * as E from "react";
|
|
3
3
|
import { useState as H, useEffect as ue, useRef as F, useId as kt, useMemo as ce } from "react";
|
|
4
|
-
import { E as
|
|
4
|
+
import { E as St, u as _t, a as Ye, b as $t, c as Ft, d as Pt, e as Ot, F as mt, f as gt, g as ft, C as Ut, h as Ht, i as pt, j as Vt } from "./index-CEotHPNT.js";
|
|
5
5
|
import { enginePoolPriceSegments as Xt, splitEngineMarketCandleSegments as Yt, fetchTokenPriceHistory as jt } from "@aegis-engine/core";
|
|
6
6
|
import { m as Wt } from "./marketOrientation-B6SD7xSk.js";
|
|
7
7
|
function qt({
|
|
@@ -173,7 +173,7 @@ function rn({
|
|
|
173
173
|
}
|
|
174
174
|
const on = /* @__PURE__ */ E.forwardRef(rn), an = 3600, Oe = [];
|
|
175
175
|
function sn(e, t, n) {
|
|
176
|
-
if (!Number.isFinite(t.price) || t.price <= 0 || !Number.isFinite(t.observedAt) || t.observedAt > n || n - t.observedAt >=
|
|
176
|
+
if (!Number.isFinite(t.price) || t.price <= 0 || !Number.isFinite(t.observedAt) || t.observedAt > n || n - t.observedAt >= St) return e;
|
|
177
177
|
const a = t.observedAt / 1e3, o = e.at(-1);
|
|
178
178
|
return o && a < o.time ? e : o && a === o.time ? o.value === t.price ? e : [...e.slice(0, -1), { time: a, value: t.price }] : [...e.filter((r) => r.time > a - an), { time: a, value: t.price }].slice(-720);
|
|
179
179
|
}
|
|
@@ -276,7 +276,7 @@ function Qe(e, t) {
|
|
|
276
276
|
function wn({ min: e, max: t, plot: n, enabled: a = !0, selectable: o = !1, contextKey: r, onSelect: l, onTimeWheel: u, onTimePan: v }) {
|
|
277
277
|
const [g, k] = H(null), [I, T] = H(null), [W, V] = H(r), [Q, Y] = H(null), [ee, p] = H(!1);
|
|
278
278
|
W !== r && (V(r), T(null), Y(null), p(!1));
|
|
279
|
-
const P = a ? I?.low ?? e : e, L = a ? I?.high ?? t : t, c = F(null),
|
|
279
|
+
const P = a ? I?.low ?? e : e, L = a ? I?.high ?? t : t, c = F(null), _ = F(!1), S = F(null), x = F(null), C = (d, m) => {
|
|
280
280
|
const w = x.current ?? g?.getScreenCTM();
|
|
281
281
|
if (!g || !w) return null;
|
|
282
282
|
const N = g.createSVGPoint();
|
|
@@ -287,7 +287,7 @@ function wn({ min: e, max: t, plot: n, enabled: a = !0, selectable: o = !1, cont
|
|
|
287
287
|
}, M = (d) => {
|
|
288
288
|
const m = Math.max((t - e) / 100, Math.min((t - e) * 20, (L - P) * d));
|
|
289
289
|
$((P + L - m) / 2, m), Y(null);
|
|
290
|
-
}, q = (d) => d.x >= n.x && d.x <= n.x + n.width && d.y >= n.y && d.y <= n.y + n.height, R =
|
|
290
|
+
}, q = (d) => d.x >= n.x && d.x <= n.x + n.width && d.y >= n.y && d.y <= n.y + n.height, R = _t({
|
|
291
291
|
wheel(d) {
|
|
292
292
|
const m = C(d.clientX, d.clientY);
|
|
293
293
|
if (!m || !q(m)) return;
|
|
@@ -297,20 +297,20 @@ function wn({ min: e, max: t, plot: n, enabled: a = !0, selectable: o = !1, cont
|
|
|
297
297
|
},
|
|
298
298
|
pinch(d) {
|
|
299
299
|
if (d.touches.length !== 2) {
|
|
300
|
-
|
|
300
|
+
S.current = null;
|
|
301
301
|
return;
|
|
302
302
|
}
|
|
303
303
|
const m = d.touches[0], w = d.touches[1], N = C((m.clientX + w.clientX) / 2, (m.clientY + w.clientY) / 2);
|
|
304
304
|
if (!N || !q(N)) return;
|
|
305
305
|
d.preventDefault();
|
|
306
306
|
const B = Math.hypot(m.clientX - w.clientX, m.clientY - w.clientY);
|
|
307
|
-
|
|
307
|
+
S.current && B > 0 && u(0, Math.log(S.current / B) / 5e-3, (N.x - n.x) / n.width), S.current = B, c.current = null, _.current = !0, p(!1);
|
|
308
308
|
}
|
|
309
309
|
});
|
|
310
310
|
ue(() => {
|
|
311
311
|
if (!g || !a) return;
|
|
312
312
|
const d = (N) => R.current.wheel(N), m = (N) => R.current.pinch(N), w = () => {
|
|
313
|
-
|
|
313
|
+
S.current = null, c.current = null, p(!1);
|
|
314
314
|
};
|
|
315
315
|
return g.addEventListener("wheel", d, { passive: !1 }), g.addEventListener("touchstart", m, { passive: !1 }), g.addEventListener("touchmove", m, { passive: !1 }), g.addEventListener("touchend", w), g.addEventListener("touchcancel", w), () => {
|
|
316
316
|
g.removeEventListener("wheel", d), g.removeEventListener("touchstart", m), g.removeEventListener("touchmove", m), g.removeEventListener("touchend", w), g.removeEventListener("touchcancel", w);
|
|
@@ -323,7 +323,7 @@ function wn({ min: e, max: t, plot: n, enabled: a = !0, selectable: o = !1, cont
|
|
|
323
323
|
const m = C(d.clientX, d.clientY);
|
|
324
324
|
if (!m) return;
|
|
325
325
|
const w = c.current;
|
|
326
|
-
if (w && !
|
|
326
|
+
if (w && !_.current && Math.hypot(d.clientX - w.clientX, d.clientY - w.clientY) > 5 && (_.current = !0, p(!0), x.current || (x.current = g?.getScreenCTM() ?? null)), w && _.current)
|
|
327
327
|
v((w.x - m.x) / n.width), w.x = m.x, d.pointerType === "mouse" && $(w.low + (m.y - w.y) / n.height * (w.high - w.low), w.high - w.low), Y(null);
|
|
328
328
|
else {
|
|
329
329
|
const N = d.pointerType === "mouse" && q(m) ? O(m.y) : null;
|
|
@@ -347,7 +347,7 @@ function wn({ min: e, max: t, plot: n, enabled: a = !0, selectable: o = !1, cont
|
|
|
347
347
|
if (!a || d.button !== 0) return;
|
|
348
348
|
x.current = g?.getScreenCTM() ?? null;
|
|
349
349
|
const m = C(d.clientX, d.clientY);
|
|
350
|
-
!m || !q(m) || (
|
|
350
|
+
!m || !q(m) || (_.current = !1, c.current = { x: m.x, y: m.y, clientX: d.clientX, clientY: d.clientY, low: P, high: L }, d.currentTarget.setPointerCapture(d.pointerId));
|
|
351
351
|
},
|
|
352
352
|
onPointerMove(d) {
|
|
353
353
|
te(d);
|
|
@@ -356,14 +356,14 @@ function wn({ min: e, max: t, plot: n, enabled: a = !0, selectable: o = !1, cont
|
|
|
356
356
|
re();
|
|
357
357
|
},
|
|
358
358
|
onPointerCancel() {
|
|
359
|
-
|
|
359
|
+
_.current = !0, re(), Y(null);
|
|
360
360
|
},
|
|
361
361
|
onPointerLeave() {
|
|
362
362
|
c.current || Y(null);
|
|
363
363
|
},
|
|
364
364
|
onClick(d) {
|
|
365
|
-
if (
|
|
366
|
-
|
|
365
|
+
if (_.current) {
|
|
366
|
+
_.current = !1;
|
|
367
367
|
return;
|
|
368
368
|
}
|
|
369
369
|
if (!a || !o) return;
|
|
@@ -422,9 +422,9 @@ function kn(e, { immediate: t }) {
|
|
|
422
422
|
return l = requestAnimationFrame(v), () => cancelAnimationFrame(l);
|
|
423
423
|
}, [t, e.low, e.high]), t ? e : { ...e, low: n.low, high: n.high };
|
|
424
424
|
}
|
|
425
|
-
const Ct = 180,
|
|
425
|
+
const Ct = 180, Sn = 84, Et = 26, _n = 10, We = 18, Nn = 5, rt = 7, Cn = 14, En = 250, Tn = 16, Mt = 2400;
|
|
426
426
|
function Dn(e, t = Ct) {
|
|
427
|
-
return { x: 8, y: 10, width: Math.max(40, e - 8 -
|
|
427
|
+
return { x: 8, y: 10, width: Math.max(40, e - 8 - Sn), height: Math.max(40, t - 10 - Et) };
|
|
428
428
|
}
|
|
429
429
|
function In(e, t, n) {
|
|
430
430
|
const a = t - e;
|
|
@@ -460,7 +460,7 @@ function Ae({ y: e, label: t, right: n, left: a, tone: o, title: r }) {
|
|
|
460
460
|
] });
|
|
461
461
|
}
|
|
462
462
|
function Ln({ candles: e, entryPrice: t, onEntryClick: n, width: a, height: o, plot: r, segments: l, latest: u, domain: v, immediateDomain: g, hold: k, scrolling: I, selectedPrice: T, hoverPrice: W, selectable: V, emptyMessage: Q, onSelect: Y, svgProps: ee }) {
|
|
463
|
-
const p = kn(v, { immediate: g }), P = kt(), { from: L, to: c, low:
|
|
463
|
+
const p = kn(v, { immediate: g }), P = kt(), { from: L, to: c, low: _, high: S } = p, x = c > L && S > _ && Number.isFinite(_) && Number.isFinite(S), C = r.x + r.width - _n, O = (C - r.x) / (c - L), $ = (s) => r.x + (s - L) * O, M = (s) => r.y + (S - s) / (S - _) * r.height, q = r.x + r.width + 6, R = a - 4, G = R - rt, A = F(null), de = (s) => {
|
|
464
464
|
const f = A.current;
|
|
465
465
|
return !f || !I ? u?.value ?? 0 : f.from + (f.to - f.from) * je(Math.min(1, (s - f.startedAt) / En));
|
|
466
466
|
};
|
|
@@ -472,7 +472,7 @@ function Ln({ candles: e, entryPrice: t, onEntryClick: n, width: a, height: o, p
|
|
|
472
472
|
let re = null;
|
|
473
473
|
if (u?.kind === "live")
|
|
474
474
|
for (const s of l) s.kind === "live" && (re = s);
|
|
475
|
-
const be = re?.points.at(-2) ?? null, d = u && x ? M(u.value) : null, m = W !== null && x ? M(W) : null, w = T !== void 0 && x && T >=
|
|
475
|
+
const be = re?.points.at(-2) ?? null, d = u && x ? M(u.value) : null, m = W !== null && x ? M(W) : null, w = T !== void 0 && x && T >= _ && T <= S, N = w ? M(T) : null, B = t !== void 0 && Number.isFinite(t) && t > 0 && x, Le = t !== void 0 && x && t >= _ && t <= S, Te = B ? Math.min(r.y + r.height - 9, Math.max(r.y + 9, M(t))) : null, ye = d !== null && !Ue(d, m), $e = N !== null && !Ue(N, m) && !(ye && Ue(N, d)), me = [Te, m, ye ? d : null, $e ? N : null], ie = T !== void 0 && x && !w ? T > S ? "above" : "below" : null, b = x ? fn({ from: L, to: c + 2 }, Math.max(2, Math.floor((C - r.x) / 84))) : [], ge = k !== null && u !== null && x && u.time <= c, fe = ge ? Math.max(r.x, $(u.time)) : C, De = F(null), Ie = F(null), ve = F(null), z = F(null), Me = F(null), K = F(null), pe = _t({ to: c, pxPerSecond: O, latest: u, x: $, y: M }), he = (s, f) => {
|
|
476
476
|
const Z = pe.current, J = `translate(${s.toFixed(2)} 0)`;
|
|
477
477
|
De.current?.setAttribute("transform", J), Ie.current?.setAttribute("transform", J);
|
|
478
478
|
const ne = D(Z.y(f));
|
|
@@ -499,7 +499,7 @@ function Ln({ candles: e, entryPrice: t, onEntryClick: n, width: a, height: o, p
|
|
|
499
499
|
}, [I]);
|
|
500
500
|
const Be = (s) => {
|
|
501
501
|
!V || !u || (s.key === "ArrowUp" || s.key === "ArrowDown" ? (s.preventDefault(), Y((T ?? u.value) * (s.key === "ArrowUp" ? 1.01 : 0.99))) : (s.key === "Enter" || s.key === " ") && (s.preventDefault(), Y(u.value)));
|
|
502
|
-
}, oe = x ? D(M(te)) : "0", xe = In(
|
|
502
|
+
}, oe = x ? D(M(te)) : "0", xe = In(_, S, r.height), U = Math.max(4, Math.min(12, O * 240));
|
|
503
503
|
return /* @__PURE__ */ h(
|
|
504
504
|
"svg",
|
|
505
505
|
{
|
|
@@ -578,7 +578,7 @@ function Ln({ candles: e, entryPrice: t, onEntryClick: n, width: a, height: o, p
|
|
|
578
578
|
Ae,
|
|
579
579
|
{
|
|
580
580
|
y: Math.min(r.y + r.height - 14, Math.max(r.y + 14, M(t))),
|
|
581
|
-
label: `Entry ${Ce(t)}${Le ? "" : t >
|
|
581
|
+
label: `Entry ${Ce(t)}${Le ? "" : t > S ? " ↑" : " ↓"}`,
|
|
582
582
|
left: r.x,
|
|
583
583
|
right: r.x + Math.min(r.width, 165),
|
|
584
584
|
tone: "entry"
|
|
@@ -628,15 +628,15 @@ function Fn({ seconds: e, onChange: t, coverage: n, reduceMotion: a = !1, histor
|
|
|
628
628
|
ue(() => () => {
|
|
629
629
|
for (const c of I.current.values()) clearTimeout(c);
|
|
630
630
|
}, []);
|
|
631
|
-
const T = (c,
|
|
632
|
-
if (c ===
|
|
633
|
-
const
|
|
631
|
+
const T = (c, _) => {
|
|
632
|
+
if (c === _) return;
|
|
633
|
+
const S = X.filter((x) => {
|
|
634
634
|
const C = j(x);
|
|
635
|
-
return C >= Math.min(c,
|
|
635
|
+
return C >= Math.min(c, _) && C <= Math.max(c, _);
|
|
636
636
|
});
|
|
637
|
-
if (
|
|
638
|
-
k((x) => /* @__PURE__ */ new Set([...x, ...
|
|
639
|
-
for (const x of
|
|
637
|
+
if (S.length) {
|
|
638
|
+
k((x) => /* @__PURE__ */ new Set([...x, ...S]));
|
|
639
|
+
for (const x of S)
|
|
640
640
|
clearTimeout(I.current.get(x)), I.current.set(x, setTimeout(() => {
|
|
641
641
|
I.current.delete(x), k((C) => {
|
|
642
642
|
const O = new Set(C);
|
|
@@ -652,13 +652,13 @@ function Fn({ seconds: e, onChange: t, coverage: n, reduceMotion: a = !1, histor
|
|
|
652
652
|
v(c), r?.(c);
|
|
653
653
|
}, Y = () => {
|
|
654
654
|
l.current = !1, Q(!1);
|
|
655
|
-
}, ee = (c) => X.reduce((
|
|
655
|
+
}, ee = (c) => X.reduce((_, S) => Math.abs(j(S) - c) < Math.abs(j(_) - c) ? S : _), p = (c, _, S = !1) => {
|
|
656
656
|
const x = c.getBoundingClientRect();
|
|
657
657
|
if (!x.width) return;
|
|
658
|
-
const C = Math.max(0, Math.min(1, (
|
|
658
|
+
const C = Math.max(0, Math.min(1, (_ - x.left) / x.width));
|
|
659
659
|
T(V.current, C), V.current = C;
|
|
660
660
|
const O = ee(C), $ = X.indexOf(O), M = j(O), q = X[$ + (C < M ? -1 : 1)], R = q === void 0 ? 0 : Math.abs(j(q) - M) * 0.3, G = C - M;
|
|
661
|
-
if (
|
|
661
|
+
if (S && Math.abs(G) <= R) {
|
|
662
662
|
t(O);
|
|
663
663
|
return;
|
|
664
664
|
}
|
|
@@ -701,14 +701,14 @@ function Fn({ seconds: e, onChange: t, coverage: n, reduceMotion: a = !1, histor
|
|
|
701
701
|
onKeyDown: (c) => {
|
|
702
702
|
if (["ArrowRight", "ArrowUp", "ArrowLeft", "ArrowDown", "Home", "End"].includes(c.key)) {
|
|
703
703
|
c.preventDefault();
|
|
704
|
-
const
|
|
705
|
-
t(Math.max(Ve, Math.min(Xe,
|
|
704
|
+
const S = c.key === "Home" ? Ve : c.key === "End" ? Xe : ["ArrowRight", "ArrowUp"].includes(c.key) ? Math.max(e + 1, He(j(e) + 1e-3)) : Math.min(e - 1, He(j(e) - 1e-3));
|
|
705
|
+
t(Math.max(Ve, Math.min(Xe, S)));
|
|
706
706
|
return;
|
|
707
707
|
}
|
|
708
708
|
if (c.key !== "PageUp" && c.key !== "PageDown") return;
|
|
709
709
|
c.preventDefault();
|
|
710
|
-
const
|
|
711
|
-
t(
|
|
710
|
+
const _ = c.key === "PageUp" ? X : [...X].reverse();
|
|
711
|
+
t(_.find((S) => c.key === "PageUp" ? S > e : S < e) ?? (c.key === "PageUp" ? Xe : Ve));
|
|
712
712
|
}
|
|
713
713
|
}
|
|
714
714
|
)
|
|
@@ -761,6 +761,7 @@ function Zn(e) {
|
|
|
761
761
|
return {
|
|
762
762
|
...e,
|
|
763
763
|
candles: e.candles.map((t) => ({ ...t, open: 1 / t.open, close: 1 / t.close, high: 1 / t.low, low: 1 / t.high })),
|
|
764
|
+
priceSegments: e.priceSegments?.map((t) => ({ ...t, price: 1 / t.price })),
|
|
764
765
|
priceReference: e.priceReference ? { ...e.priceReference, price: 1 / e.priceReference.price } : e.priceReference
|
|
765
766
|
};
|
|
766
767
|
}
|
|
@@ -776,9 +777,9 @@ function Gn(e) {
|
|
|
776
777
|
function nr({ market: e, mark: t, state: n, onRetry: a, selectedPrice: o, onSelectPrice: r, onClearPrice: l, entryPrice: u, viewContext: v, referenceSource: g = {}, reduceMotion: k = !1 }) {
|
|
777
778
|
const I = Wt(e), { asset: T, quote: W } = I, V = !I.assetIsToken0, [Q, Y] = H(null);
|
|
778
779
|
n.kind === "ready" && n.candles !== Q && Y(n.candles);
|
|
779
|
-
const ee = n.kind === "ready" ? n.candles : Q, p = ce(() => V && ee ? Zn(ee) : ee, [V, ee]), P = ce(() => V && t ? { ...t, price: 1 / t.price } : t, [V, t]), L = u === void 0 ? void 0 : Ft(I, u), c = ln(`${e.chainId}:${e.id}`, P, p?.freshness.status === "reorg_detected"), [
|
|
780
|
+
const ee = n.kind === "ready" ? n.candles : Q, p = ce(() => V && ee ? Zn(ee) : ee, [V, ee]), P = ce(() => V && t ? { ...t, price: 1 / t.price } : t, [V, t]), L = u === void 0 ? void 0 : Ft(I, u), c = ln(`${e.chainId}:${e.id}`, P, p?.freshness.status === "reorg_detected"), [_, S] = H(!0);
|
|
780
781
|
ue(() => {
|
|
781
|
-
const y = setTimeout(() =>
|
|
782
|
+
const y = setTimeout(() => S(!1), 15e3);
|
|
782
783
|
return () => clearTimeout(y);
|
|
783
784
|
}, [e.id]);
|
|
784
785
|
const [x, C] = H(!1), O = Un({ market: e, source: g, enabled: x }), $ = ce(() => (V ? O.points?.map((y) => ({ ...y, price: 1 / y.price })) : O.points) ?? null, [V, O.points]), M = $?.at(-1), q = F(null), [R, G] = H("line"), [A, de] = H(tt), [te, re] = H(null), [be, d] = H(!1), [m, w] = H(!1), N = F(null), B = kt(), Le = Pt(), Te = k || Le, [ye, $e] = H(!0), me = Gn(ye), ie = ce(() => hn({
|
|
@@ -795,7 +796,7 @@ function nr({ market: e, mark: t, state: n, onRetry: a, selectedPrice: o, onSele
|
|
|
795
796
|
}, z = ce(() => ({ from: fe - A, to: fe }), [fe, A]), Me = ce(
|
|
796
797
|
() => p?.candles.filter((y) => y.t >= z.from && y.t <= z.to) ?? [],
|
|
797
798
|
[p, z]
|
|
798
|
-
), K = o !== void 0, pe = P !== null && me.nowMs >= P.observedAt && me.nowMs - P.observedAt <
|
|
799
|
+
), K = o !== void 0, pe = P !== null && me.nowMs >= P.observedAt && me.nowMs - P.observedAt < St, he = ce(
|
|
799
800
|
() => Hn(p, pe ? b?.value ?? null : null, me.now),
|
|
800
801
|
[p, pe, b, me.now]
|
|
801
802
|
), ke = b && b.time <= fe ? b.kind === "live" && pe ? "live" : "stale" : null, Be = ce(() => ie.segments.some(
|
|
@@ -830,13 +831,13 @@ function nr({ market: e, mark: t, state: n, onRetry: a, selectedPrice: o, onSele
|
|
|
830
831
|
Ye(() => {
|
|
831
832
|
U && (st.current = !0);
|
|
832
833
|
}, [U]);
|
|
833
|
-
const It = te === null && me.visible && ye && !Te && U,
|
|
834
|
+
const It = te === null && me.visible && ye && !Te && U, Se = n.kind === "error" || n.kind === "unavailable" ? n.kind : p?.freshness.status === "source_unavailable" || p?.freshness.status === "reorg_detected" ? "source" : null, Fe = Se ? qn[Se] : null, Rt = !Se && p !== null && p.candles.length === 0 && p.coverage.coverageStart > 0, _e = !Se && b === null && !U && (n.kind === "loading" || _), lt = Fe && !U ? Fe : R === "candles" && !Me.length && !_e ? "No recorded swap candles in this period." : U || _e ? null : b ? "No recorded prices in this period." : "Waiting for a current price.", ct = p !== null && z.to - p.coverage.completedThrough > 600, Ze = ct && p ? `Swap history indexed through ${nt.format(new Date(p.coverage.completedThrough * 1e3))} · newer swaps may be missing` : null, Ge = U ? K ? { text: "Tap to set a target · drag to pan", hint: !0 } : n.kind === "loading" && p ? { text: "Updating history…" } : Ze ? { text: Ze } : b?.kind === "live" && !pe ? { text: "Updates interrupted" } : b && b.kind !== "live" && !_ ? { text: `Last price update ${nt.format(new Date(b.time * 1e3))}` } : xe ? { text: "Last observed price · collecting live history" } : { text: "Drag to pan · scroll to zoom time", hint: !0 } : null, Ke = U ? Fe ?? (Rt ? "No trades in this period" : null) : null, ut = ct && !Se, At = ae.manual || te !== null || A !== tt, Lt = () => {
|
|
834
835
|
ae.reset(), re(null), de(tt);
|
|
835
|
-
}, Je = (p?.candles.length ?? 0) > 0, dt = Ke ?? (
|
|
836
|
-
return /* @__PURE__ */ h("section", { className: "aegis-engine-widget__trade-chart", "aria-label": "Pair price chart", "aria-busy":
|
|
836
|
+
}, Je = (p?.candles.length ?? 0) > 0, dt = Ke ?? (_e ? null : b ? Je ? null : "Candles need recorded price history." : Bn), ht = b ? !U && te !== null ? "No recorded prices in this window" : R === "candles" && p ? `${p.resolution} swap candles · live line shows pool observations` : xe ? "Collecting live history" : c.length > 0 ? "Recorded prices and live observations" : "Available recorded prices" : "Waiting for recorded prices";
|
|
837
|
+
return /* @__PURE__ */ h("section", { className: "aegis-engine-widget__trade-chart", "aria-label": "Pair price chart", "aria-busy": _e || void 0, children: [
|
|
837
838
|
/* @__PURE__ */ h("div", { className: "aegis-engine-widget__chart-price-row", children: [
|
|
838
839
|
/* @__PURE__ */ h("div", { className: "aegis-engine-widget__trade-chart-head", children: [
|
|
839
|
-
/* @__PURE__ */ i("output", { "aria-label": "Last chart price", children: b ? Ee(b.value) :
|
|
840
|
+
/* @__PURE__ */ i("output", { "aria-label": "Last chart price", children: b ? Ee(b.value) : _e ? /* @__PURE__ */ i("span", { className: "aegis-swap-widget__skeleton aegis-swap-widget__skeleton--line", style: { "--aegis-skeleton-w": "6ch", "--aegis-skeleton-h": "0.8em" } }) : /* @__PURE__ */ h(Pe, { children: [
|
|
840
841
|
/* @__PURE__ */ i("span", { "aria-hidden": "true", children: "—" }),
|
|
841
842
|
/* @__PURE__ */ i("span", { className: "aegis-swap-widget__sr-only", children: "Price unavailable" })
|
|
842
843
|
] }) }),
|
|
@@ -882,7 +883,7 @@ function nr({ market: e, mark: t, state: n, onRetry: a, selectedPrice: o, onSele
|
|
|
882
883
|
/* @__PURE__ */ i("button", { type: "button", onClick: l, disabled: !l, "aria-label": "Clear target price", children: /* @__PURE__ */ i(on, { "aria-hidden": "true" }) })
|
|
883
884
|
] }) : null
|
|
884
885
|
] }),
|
|
885
|
-
/* @__PURE__ */ i("div", { ref: we, className: "aegis-engine-widget__chart-plot", "data-cursor-only": xe || void 0, children:
|
|
886
|
+
/* @__PURE__ */ i("div", { ref: we, className: "aegis-engine-widget__chart-plot", "data-cursor-only": xe || void 0, children: _e ? /* @__PURE__ */ i(Ut, {}) : /* @__PURE__ */ i(
|
|
886
887
|
Ln,
|
|
887
888
|
{
|
|
888
889
|
candles: R === "candles" ? p?.candles ?? [] : void 0,
|
|
@@ -930,7 +931,7 @@ function nr({ market: e, mark: t, state: n, onRetry: a, selectedPrice: o, onSele
|
|
|
930
931
|
/* @__PURE__ */ i("button", { type: "button", "aria-label": "Zoom in price range", disabled: !U, title: "Zoom in price range", onClick: ae.zoomIn, children: /* @__PURE__ */ i(ft, { "aria-hidden": "true" }) }),
|
|
931
932
|
/* @__PURE__ */ i("button", { type: "button", disabled: !At, "aria-label": "Reset chart", title: "Reset chart", onClick: Lt, children: /* @__PURE__ */ i(Ht, { "aria-hidden": "true" }) })
|
|
932
933
|
] }),
|
|
933
|
-
|
|
934
|
+
Se === "error" ? /* @__PURE__ */ i("button", { type: "button", className: "aegis-engine-widget__chart-retry", disabled: n.kind === "loading", onClick: a, children: n.kind === "loading" ? "Refreshing…" : "Retry" }) : null
|
|
934
935
|
] })
|
|
935
936
|
] }),
|
|
936
937
|
/* @__PURE__ */ i("p", { id: B, className: "aegis-engine-widget__trade-chart-status", role: Fe ? "status" : void 0, "aria-hidden": !dt || void 0, children: dt ?? " " }),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as s, k as i, l as o, m as n, n as r, o as t, p as A, q as E, r as g, s as u, t as S, S as _, v as c, k as m, w as l, x as P, y as p, z as d, B as W } from "./index-
|
|
1
|
+
import { A as s, k as i, l as o, m as n, n as r, o as t, p as A, q as E, r as g, s as u, t as S, S as _, v as c, k as m, w as l, x as P, y as p, z as d, B as W } from "./index-CEotHPNT.js";
|
|
2
2
|
import { u as R, a as T, b as G, c as I, d as O, e as L, f as x, g as D } from "./useEngineActivity-BkhItrUI.js";
|
|
3
3
|
import { WOLF_GAME_ENGINE_WIDGET_PRESET as k, WOLF_GAME_RESOURCES as v, WOLF_GAME_RESOURCE_ORDER as w, resolveWolfGameResource as M, wolfGameResourceWidgetProps as y } from "./presets/wolf-game.js";
|
|
4
4
|
import { normalizePartnerActionRequirement as N, normalizePartnerResourceAmount as z, partnerLaunchIntentForRequirement as C, partnerResourceAssetKey as U } from "./partner-context.js";
|