aegis-swap-widget 0.12.1 → 0.13.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/CHANGELOG.md +77 -0
- package/README.md +9 -0
- package/dist/{EngineTradeMarketChart-CizTLWE2.js → EngineTradeMarketChart-bxvPeAQ3.js} +42 -41
- package/dist/aegis-swap-widget.js +2 -2
- package/dist/config/chains.d.ts +1 -1
- package/dist/config/constants.d.ts +1 -0
- package/dist/config/tokens.d.ts +1 -1
- package/dist/config/types.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/hooks/useSubmitSwap.d.ts +1 -1
- package/dist/hooks/useWalletConnection.d.ts +1 -1
- package/dist/{index-CniNmEhV.js → index-CvIQ_zY8.js} +12366 -12164
- package/dist/markets-Dea2-UUy.js +166 -0
- package/dist/presets/wolf-game.js +1 -1
- 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/dist/widget/types.d.ts +7 -0
- package/dist/widget/useAggregatedSwapController.d.ts +1 -1
- package/dist/widget/useEngineController.d.ts +1 -1
- package/dist/widget/useSwapConfig.d.ts +3 -1
- package/package.json +2 -2
- package/dist/markets-CjYBjn94.js +0 -131
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,82 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.13.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- af08d8a: Add Ink (57073) direct swaps. Core now ships an Ink chain config and trusts Ink's
|
|
8
|
+
AegisRouterV1 (`0xe2820f3DA0abC9C65B3727A7103E3F59c00D686E`, from the Engine
|
|
9
|
+
v1.0.3 manifest). It also catalogues the USD₮0-USDC and USD₮0-USDG pools and
|
|
10
|
+
exports `AEGIS_SWAP_INK_TOKENS` (USD₮0, USDC, USDG). Backend `/v1/config`
|
|
11
|
+
responses now keep the Ink contract registry and allowlist; before, they were
|
|
12
|
+
stripped. The widget adds the `USDT0_USDC_INK` and `USDT0_USDG_INK` built-in
|
|
13
|
+
markets. Only `USDT0_USDC_INK` is a default. The bundled Ink chain config retains the current backend
|
|
14
|
+
50 bps output fee; backend discovery consumes its configured fee policy.
|
|
15
|
+
|
|
16
|
+
Add an optional per-chain `walletRpcUrls` prop (`{ [chainId]: string[] }`, and
|
|
17
|
+
`walletRpcUrls` on chain configs and `ProviderChainConfig`) that overrides the
|
|
18
|
+
URLs `wallet_addEthereumChain` offers. By default wallets are now offered the
|
|
19
|
+
chain's canonical public RPCs, so a host can read through its own proxy without
|
|
20
|
+
that proxy being saved into users' wallets. The aggregated widget honours it too.
|
|
21
|
+
|
|
22
|
+
The read client now caps JSON-RPC batches at 100 requests, times out after 5s
|
|
23
|
+
per endpoint when fallback URLs exist (10s for a single URL), retries the
|
|
24
|
+
fallback set once, and gathers concurrent contract reads into one Multicall3
|
|
25
|
+
call over a 16ms window.
|
|
26
|
+
|
|
27
|
+
Include Ink in the widget's backend discovery filter and Core's validated
|
|
28
|
+
quote request chain set. Backend-disabled markets and host chain restrictions
|
|
29
|
+
continue to apply; missing Ink backend configuration does not enable a static
|
|
30
|
+
fallback.
|
|
31
|
+
|
|
32
|
+
Respect explicit host wallet resolvers without injected-wallet fallback. A
|
|
33
|
+
controlled host may open its wallet modal and update props asynchronously;
|
|
34
|
+
this does not start an extension permission request or show a no-wallet error.
|
|
35
|
+
Standalone connections and explicitly returned host connections are unchanged.
|
|
36
|
+
|
|
37
|
+
Core wallet-session resolution also preserves an explicitly unresolved host
|
|
38
|
+
provider rather than selecting a different injected extension. Aggregated
|
|
39
|
+
Connect waits for the host modal instead of starting transaction-session
|
|
40
|
+
resolution, and Engine actions wait instead of failing with "Wallet not
|
|
41
|
+
connected."; explicit returned connections and standalone injection still work.
|
|
42
|
+
|
|
43
|
+
Pin the complete REST snapshot and generated request types to the committed Ink
|
|
44
|
+
API contract. Ink quote requests now use those types directly, without a
|
|
45
|
+
temporary assertion against the previous chain list. This source contract pin
|
|
46
|
+
does not enable Ink on an API environment that has not deployed the route.
|
|
47
|
+
|
|
48
|
+
Behaviour changes:
|
|
49
|
+
|
|
50
|
+
- A host-supplied `null` `provider` or a `getProvider` resolver no longer falls
|
|
51
|
+
back to `window.ethereum`.
|
|
52
|
+
- `wallet_addEthereumChain` offers the chain's canonical public RPCs instead of
|
|
53
|
+
the read `rpcUrls`; `rpcUrls` is used only for a chain without a canonical list.
|
|
54
|
+
- `walletRpcUrls` accepts only the per-chain record form.
|
|
55
|
+
- Read transport: JSON-RPC batches cap at 100, 5s per-endpoint timeout with
|
|
56
|
+
fallback URLs, one fallback retry, and a 16ms Multicall3 wait.
|
|
57
|
+
- `USDT0_USDC_INK` is a new default market.
|
|
58
|
+
|
|
59
|
+
### Patch Changes
|
|
60
|
+
|
|
61
|
+
- Updated dependencies [af08d8a]
|
|
62
|
+
- @aegis-engine/core@0.9.0
|
|
63
|
+
|
|
64
|
+
## 0.12.2
|
|
65
|
+
|
|
66
|
+
### Patch Changes
|
|
67
|
+
|
|
68
|
+
- 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.
|
|
69
|
+
- 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.
|
|
70
|
+
|
|
71
|
+
Orient historical price segments consistently with candles and the current pool price on quote-first markets.
|
|
72
|
+
|
|
73
|
+
- 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.
|
|
74
|
+
|
|
75
|
+
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.
|
|
76
|
+
|
|
77
|
+
- Updated dependencies [7c89417]
|
|
78
|
+
- @aegis-engine/core@0.8.2
|
|
79
|
+
|
|
3
80
|
## 0.12.1
|
|
4
81
|
|
|
5
82
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1197,6 +1197,7 @@ No other props changed. See the [CHANGELOG](./CHANGELOG.md) for the full entry.
|
|
|
1197
1197
|
- `defaultSlippagePercent`: number (canonical) or numeric string, in percent. Defaults to `1`.
|
|
1198
1198
|
- `maxEngineSwapPriceImpactBps`: maximum block-pinned price impact for Engine internal swaps, in basis points. Lend and Trade fail closed above it or when impact cannot be assessed. Defaults to `500` (5%); valid range is `0` through `10000`. This is an SDK/Widget gate, not a Router-level pool-price invariant.
|
|
1199
1199
|
- `rpcUrls`: RPC fallback list for the active chain, or a `{ [chainId]: string[] }` map for multichain hosts.
|
|
1200
|
+
- `walletRpcUrls`: optional `{ [chainId]: string[] }` override for the URLs offered to `wallet_addEthereumChain` (the first is the one wallets save). By default wallets are offered the chain's canonical public RPCs, never `rpcUrls`, so a host read proxy stays out of users' wallets; `rpcUrls` is used only for a chain without a canonical list.
|
|
1200
1201
|
- `backendBaseUrl`: REST origin for Swap discovery and token-price history, and for the Engine widget's nested Buy surface. Defaults to the Aegis production backend. Engine market and position discovery is controlled separately by `engineDataSource`.
|
|
1201
1202
|
- `backendRequestTimeoutMs`: timeout for backend REST reads. Defaults to 30000 ms.
|
|
1202
1203
|
- `metadataEndpoint`: optional metadata GraphQL endpoint for `GlobalToken.iconURL` token icons only. Set to `null` to disable icon hydration.
|
|
@@ -1253,6 +1254,14 @@ Tap uses a single workspace without top section tabs. The chart starts as a line
|
|
|
1253
1254
|
- `statusSurface`: where transaction status is surfaced — `'rail'` (default), `'toast'`, `'both'`, or `'none'`. The root `data-progress-state` attribute stays on regardless (see Toasts).
|
|
1254
1255
|
- `toastPosition`: viewport corner for the widget-provided toaster. Defaults to `'bottom-right'`; ignored once a host mounts `<AegisSwapToaster />`.
|
|
1255
1256
|
|
|
1257
|
+
When `getProvider` is supplied, it owns wallet selection. Returning `null`
|
|
1258
|
+
keeps the widget disconnected; resolver failure never switches to an injected
|
|
1259
|
+
extension. With a controlled `account` (including `null`), `onConnectWallet`
|
|
1260
|
+
may return nothing after opening the host's wallet modal. The widget then waits
|
|
1261
|
+
for updated account/provider props without requesting accounts itself. A host
|
|
1262
|
+
may instead return a provider or provider/account connection to complete the
|
|
1263
|
+
connection immediately. Standalone widgets retain their injected-wallet flow.
|
|
1264
|
+
|
|
1256
1265
|
The widget intentionally does not inherit the host font; set the
|
|
1257
1266
|
`--aegis-swap-font-family` CSS variable (via `style` or a stylesheet) to match
|
|
1258
1267
|
the host typography.
|
|
@@ -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-CvIQ_zY8.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,11 +1,11 @@
|
|
|
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-CvIQ_zY8.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";
|
|
5
5
|
export * from "@aegis-engine/core";
|
|
6
6
|
import { AEGIS_SWAP_DEFAULT_METADATA_ENDPOINT as H, AEGIS_SWAP_TOKENS as K, fetchGlobalTokenMetadata as q, resolveTokenIconUrl as j } from "@aegis-engine/core";
|
|
7
7
|
import { a as Q, m as V } from "./marketOrientation-B6SD7xSk.js";
|
|
8
|
-
import { A as Y, a as Z, b as $ } from "./markets-
|
|
8
|
+
import { A as Y, a as Z, b as $ } from "./markets-Dea2-UUy.js";
|
|
9
9
|
export {
|
|
10
10
|
Y as AEGIS_SWAP_CHAIN_ID,
|
|
11
11
|
H as AEGIS_SWAP_DEFAULT_METADATA_ENDPOINT,
|
package/dist/config/chains.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AEGIS_SWAP_BSC_CHAIN, AEGIS_SWAP_CHAINS, AEGIS_SWAP_DEFAULT_METADATA_ENDPOINT, AEGIS_SWAP_DEFAULT_RPC_URLS, AEGIS_SWAP_MAINNET_CHAIN, createAegisSwapChainConfig, createAegisSwapChains, getExplorerUrl } from '@aegis-engine/core';
|
|
1
|
+
export { AEGIS_SWAP_BSC_CHAIN, AEGIS_SWAP_CHAINS, AEGIS_SWAP_DEFAULT_METADATA_ENDPOINT, AEGIS_SWAP_DEFAULT_RPC_URLS, AEGIS_SWAP_INK_CHAIN, AEGIS_SWAP_MAINNET_CHAIN, createAegisSwapChainConfig, createAegisSwapChains, getExplorerUrl } from '@aegis-engine/core';
|
package/dist/config/tokens.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AEGIS_SWAP_BSC_TOKENS, AEGIS_SWAP_TOKENS, AGGREGATED_SWAP_CURATED_TOKENS, AGGREGATED_SWAP_DEFAULT_TOKENS, AGGREGATED_SWAP_DEFAULT_TOKEN_LIST, AGGREGATED_SWAP_TOKEN_PRESETS, AGGREGATED_SWAP_WOLFGAME_TOKENS, AGGREGATED_SWAP_WOLFGAME_TOKEN_LIST } from '@aegis-engine/core';
|
|
1
|
+
export { AEGIS_SWAP_BSC_TOKENS, AEGIS_SWAP_INK_TOKENS, AEGIS_SWAP_TOKENS, AGGREGATED_SWAP_CURATED_TOKENS, AGGREGATED_SWAP_DEFAULT_TOKENS, AGGREGATED_SWAP_DEFAULT_TOKEN_LIST, AGGREGATED_SWAP_TOKEN_PRESETS, AGGREGATED_SWAP_WOLFGAME_TOKENS, AGGREGATED_SWAP_WOLFGAME_TOKEN_LIST } from '@aegis-engine/core';
|
package/dist/config/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { AegisSwapBuiltInTokenSymbol } from '@aegis-engine/core';
|
|
2
2
|
export type { AegisPoolKey, AegisSwapBscTokenSymbol, AegisSwapBuiltInTokenSymbol, AegisSwapChainConfig, AegisSwapChainConfigInput, AegisSwapFeeConfig, AegisSwapMarket, AegisSwapPoolConfig, AegisSwapToken, AegisSwapTokenSymbol, AegisSwapUniswapV4Contracts, AegisSwapUniswapV4ContractsInput, AggregatedSwapDefaultTokenSymbol, AggregatedSwapToken, AggregatedSwapTokenSymbol, AggregatedSwapWolfGameTokenSymbol } from '@aegis-engine/core';
|
|
3
3
|
export type AegisSwapBuiltInAssetSymbol = Exclude<AegisSwapBuiltInTokenSymbol, 'USDC'>;
|
|
4
|
-
export type AegisSwapBuiltInMarketId = 'WATER_USDC' | 'WOOD_USDC' | 'GRASS_USDC' | 'STONE_USDC' | 'BNCB_BNB' | 'QQQB_BNB' | 'NVDAB_USDC_BSC';
|
|
4
|
+
export type AegisSwapBuiltInMarketId = 'WATER_USDC' | 'WOOD_USDC' | 'GRASS_USDC' | 'STONE_USDC' | 'BNCB_BNB' | 'QQQB_BNB' | 'NVDAB_USDC_BSC' | 'USDT0_USDC_INK' | 'USDT0_USDG_INK';
|
package/dist/core.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "@aegis-engine/core";
|
|
2
2
|
import { AEGIS_SWAP_DEFAULT_METADATA_ENDPOINT as o, AEGIS_SWAP_TOKENS as r, fetchGlobalTokenMetadata as e, resolveTokenIconUrl as S } from "@aegis-engine/core";
|
|
3
3
|
import { a as E, m as I } from "./marketOrientation-B6SD7xSk.js";
|
|
4
|
-
import { A as T, a as P, b as m } from "./markets-
|
|
4
|
+
import { A as T, a as P, b as m } from "./markets-Dea2-UUy.js";
|
|
5
5
|
export {
|
|
6
6
|
T as AEGIS_SWAP_CHAIN_ID,
|
|
7
7
|
o as AEGIS_SWAP_DEFAULT_METADATA_ENDPOINT,
|
|
@@ -66,7 +66,7 @@ export declare function useSubmitSwap({ publicClient, activeChain, market, input
|
|
|
66
66
|
setQuote: (quote: DirectSwapQuote | null) => void;
|
|
67
67
|
owner: Address | null;
|
|
68
68
|
getActiveProvider: () => Promise<Eip1193Provider | null>;
|
|
69
|
-
connectWallet: () => Promise<ResolvedWalletConnection | null>;
|
|
69
|
+
connectWallet: () => Promise<ResolvedWalletConnection | null | undefined>;
|
|
70
70
|
setWalletChainId: (chainId: number | null) => void;
|
|
71
71
|
commitAllowance: (owner: Address, market: AegisSwapMarket, amount: bigint) => void;
|
|
72
72
|
approvalMode: AegisSwapApprovalMode;
|
|
@@ -15,5 +15,5 @@ export declare function useWalletConnection({ provider, controlledAccount, accou
|
|
|
15
15
|
walletChainId: number | null;
|
|
16
16
|
setWalletChainId: (chainId: number | null) => void;
|
|
17
17
|
getActiveProvider: () => Promise<Eip1193Provider | null>;
|
|
18
|
-
connectWallet: () => Promise<ResolvedWalletConnection | null>;
|
|
18
|
+
connectWallet: () => Promise<ResolvedWalletConnection | null | undefined>;
|
|
19
19
|
};
|