aegis-swap-widget 0.16.0 → 0.17.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 CHANGED
@@ -1,5 +1,42 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.17.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 04a2e9d: Show the path behind aggregated swap quotes. `AggregatedSwapQuote` gains
8
+ display-only `routePaths` (each path's input share and its pool legs, as Kyber
9
+ or the Ink router reported them); it is omitted unless every path is complete
10
+ and chained, matches the quoted endpoints, and conserves known input allocations;
11
+ execution never reads it. `AegisAggregatedSwapWidget` adds a
12
+ Route row to Trade details that previews the path with real token artwork and
13
+ opens a diagram of the input, intermediate tokens and pools, with ribbons sized
14
+ by each path's share and colored from that artwork. Intermediate tokens outside
15
+ the token list resolve their symbol and icon through the token metadata
16
+ service. The diagram draws in along the flow, streams liquidity through
17
+ whatever pool or token is inspected by hover, tap or keyboard, morphs when only
18
+ the split shares change, and stays still under reduced motion. A refresh that
19
+ re-routes the same amounts now redraws it. The Route row is on by default;
20
+ hosts pass `showRoutePreview={false}` to hide it and skip the intermediate-token
21
+ metadata request.
22
+
23
+ Split percentages stay nonnegative and total 100% after rounding. Escape also
24
+ dismisses a hovered pool note while focus remains on the Route toggle, and both
25
+ system and host reduced-motion settings reveal the diagram with opacity only.
26
+
27
+ ### Patch Changes
28
+
29
+ - 7246abf: `AegisAggregatedSwapWidget` quotes and executes aggregated swaps with the
30
+ deployment fee from `/v1/config` (`fee.outputFeeBps`). The displayed quote is
31
+ keyed on the resolved fee and execution passes that same fee, so the two never
32
+ disagree. Quoting waits briefly for config on first load; with no backend, a
33
+ failed config read, or a slow one (over 3 s), it keeps the bundled 50 bps.
34
+ - Updated dependencies [04a2e9d]
35
+ - Updated dependencies [90c5b68]
36
+ - Updated dependencies [9af37b3]
37
+ - Updated dependencies [4c32cc7]
38
+ - @aegis-engine/core@0.13.0
39
+
3
40
  ## 0.16.0
4
41
 
5
42
  ### Minor Changes
package/README.md CHANGED
@@ -860,6 +860,20 @@ in-house provider instead: up to three hops over the bundled Ink Aegis pools,
860
860
  quoted in one Multicall3 call, settled on the Aegis router through Permit2.
861
861
  Ink requires `liquiditySources="aegis"`; `'any'` shows an error.
862
862
 
863
+ When the current quote reports its path, **Trade details** adds a **Route** row
864
+ that previews the tokens the swap passes through. Opening it draws the input,
865
+ each intermediate token, the pools between them and, for split routes, each
866
+ path's share of the input. Hover, tap or focus a pool for its source, or a token
867
+ to light up every path through it; **Technical details** lists each pool id.
868
+ Intermediate tokens outside your `tokens` list take their symbol and artwork
869
+ from the same token metadata service as the pair (one batched request, cached
870
+ for the session). The diagram otherwise makes no requests, follows the current
871
+ quote only, honours reduced motion, and is omitted when the provider reports no
872
+ complete path or more than five parallel paths.
873
+
874
+ The Route row is on by default. Pass `showRoutePreview={false}` to hide it; the
875
+ widget then also skips the intermediate-token metadata request.
876
+
863
877
  ## Fees
864
878
 
865
879
  The widget applies an internal output-token fee per chain. Each bundled chain config
@@ -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 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-Ct0upRU8.js";
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-BcjYe1-F.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({
@@ -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-Ct0upRU8.js";
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-BcjYe1-F.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";
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The deployment output fee from `/v1/config` (`fee.outputFeeBps`) for the
3
+ * aggregated swap path.
4
+ *
5
+ * - `settled` is false only while the first config read for this backend is
6
+ * pending, and never for longer than {@link OUTPUT_FEE_CONFIG_WAIT_MS}:
7
+ * quoting waits for it so the first displayed quote already carries the
8
+ * deployment fee, but a slow or broken backend never blocks quoting.
9
+ * - `outputFeeBps` is `undefined` when there is no backend, the read failed,
10
+ * or the wait ran out; core then applies its bundled default (50 bps).
11
+ */
12
+ export type BackendOutputFee = {
13
+ settled: boolean;
14
+ outputFeeBps: number | undefined;
15
+ };
16
+ export declare function __clearBackendOutputFeeCacheForTests(): void;
17
+ export declare function useBackendOutputFee({ baseUrl, timeoutMs }: {
18
+ baseUrl: string | null;
19
+ timeoutMs?: number;
20
+ }): BackendOutputFee;