aegis-swap-widget 0.12.2 → 0.13.1

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,78 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.13.1
4
+
5
+ ### Patch Changes
6
+
7
+ - dad3c28: Trust twelve more Ink direct-swap pools, so backend discovery now exposes all
8
+ thirteen enabled Ink markets: USDC-USDG, USDC-WETH, USD₮0-WETH, USDC-kBTC,
9
+ USD₮0-kBTC, WETH-kBTC, ETH-wSPYx, and wSPCXx, wNVDAx, wPLTRx, wTSLAx and wMSTRx
10
+ against wSPYx, alongside the existing USD₮0-USDC. Hosts on widget 0.13.x pick
11
+ these up by refreshing their resolved `@aegis-engine/core` lock entry.
12
+ - Updated dependencies [dad3c28]
13
+ - @aegis-engine/core@0.9.1
14
+
15
+ ## 0.13.0
16
+
17
+ ### Minor Changes
18
+
19
+ - af08d8a: Add Ink (57073) direct swaps. Core now ships an Ink chain config and trusts Ink's
20
+ AegisRouterV1 (`0xe2820f3DA0abC9C65B3727A7103E3F59c00D686E`, from the Engine
21
+ v1.0.3 manifest). It also catalogues the USD₮0-USDC and USD₮0-USDG pools and
22
+ exports `AEGIS_SWAP_INK_TOKENS` (USD₮0, USDC, USDG). Backend `/v1/config`
23
+ responses now keep the Ink contract registry and allowlist; before, they were
24
+ stripped. The widget adds the `USDT0_USDC_INK` and `USDT0_USDG_INK` built-in
25
+ markets. Only `USDT0_USDC_INK` is a default. The bundled Ink chain config retains the current backend
26
+ 50 bps output fee; backend discovery consumes its configured fee policy.
27
+
28
+ Add an optional per-chain `walletRpcUrls` prop (`{ [chainId]: string[] }`, and
29
+ `walletRpcUrls` on chain configs and `ProviderChainConfig`) that overrides the
30
+ URLs `wallet_addEthereumChain` offers. By default wallets are now offered the
31
+ chain's canonical public RPCs, so a host can read through its own proxy without
32
+ that proxy being saved into users' wallets. The aggregated widget honours it too.
33
+
34
+ The read client now caps JSON-RPC batches at 100 requests, times out after 5s
35
+ per endpoint when fallback URLs exist (10s for a single URL), retries the
36
+ fallback set once, and gathers concurrent contract reads into one Multicall3
37
+ call over a 16ms window.
38
+
39
+ Include Ink in the widget's backend discovery filter and Core's validated
40
+ quote request chain set. Backend-disabled markets and host chain restrictions
41
+ continue to apply; missing Ink backend configuration does not enable a static
42
+ fallback.
43
+
44
+ Respect explicit host wallet resolvers without injected-wallet fallback. A
45
+ controlled host may open its wallet modal and update props asynchronously;
46
+ this does not start an extension permission request or show a no-wallet error.
47
+ Standalone connections and explicitly returned host connections are unchanged.
48
+
49
+ Core wallet-session resolution also preserves an explicitly unresolved host
50
+ provider rather than selecting a different injected extension. Aggregated
51
+ Connect waits for the host modal instead of starting transaction-session
52
+ resolution, and Engine actions wait instead of failing with "Wallet not
53
+ connected."; explicit returned connections and standalone injection still work.
54
+
55
+ Pin the complete REST snapshot and generated request types to the committed Ink
56
+ API contract. Ink quote requests now use those types directly, without a
57
+ temporary assertion against the previous chain list. This source contract pin
58
+ does not enable Ink on an API environment that has not deployed the route.
59
+
60
+ Behaviour changes:
61
+
62
+ - A host-supplied `null` `provider` or a `getProvider` resolver no longer falls
63
+ back to `window.ethereum`.
64
+ - `wallet_addEthereumChain` offers the chain's canonical public RPCs instead of
65
+ the read `rpcUrls`; `rpcUrls` is used only for a chain without a canonical list.
66
+ - `walletRpcUrls` accepts only the per-chain record form.
67
+ - Read transport: JSON-RPC batches cap at 100, 5s per-endpoint timeout with
68
+ fallback URLs, one fallback retry, and a 16ms Multicall3 wait.
69
+ - `USDT0_USDC_INK` is a new default market.
70
+
71
+ ### Patch Changes
72
+
73
+ - Updated dependencies [af08d8a]
74
+ - @aegis-engine/core@0.9.0
75
+
3
76
  ## 0.12.2
4
77
 
5
78
  ### Patch Changes
package/README.md CHANGED
@@ -657,12 +657,13 @@ tokens — is documented in [DESIGN.md](./DESIGN.md).
657
657
 
658
658
  ## Configure Pools
659
659
 
660
- Out of the box, `<AegisSwapWidget />` exposes the enabled markets returned by
661
- the Aegis backend for the active chain. Use `enabledChainIds` when a project
662
- should expose only some backend-enabled networks, and use `poolIds` when a host
663
- wants a different backend-market order or subset. Pass `backendBaseUrl={null}`
664
- when those ids should resolve against the bundled static WATER, WOOD, GRASS,
665
- and STONE mainnet pools:
660
+ Out of the box, `<AegisSwapWidget />` exposes the backend-enabled markets for the
661
+ active chain that match the direct-swap catalogue shipped in the installed
662
+ `@aegis-engine/core`; the backend cannot add a pool outside that catalogue. Use
663
+ `enabledChainIds` when a project should expose only some backend-enabled
664
+ networks, and use `poolIds` when a host wants a different backend-market order
665
+ or subset. Pass `backendBaseUrl={null}` when those ids should resolve against
666
+ the bundled static WATER, WOOD, GRASS, and STONE mainnet pools:
666
667
 
667
668
  ```tsx
668
669
  import { AegisSwapWidget } from 'aegis-swap-widget'
@@ -1197,6 +1198,7 @@ No other props changed. See the [CHANGELOG](./CHANGELOG.md) for the full entry.
1197
1198
  - `defaultSlippagePercent`: number (canonical) or numeric string, in percent. Defaults to `1`.
1198
1199
  - `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
1200
  - `rpcUrls`: RPC fallback list for the active chain, or a `{ [chainId]: string[] }` map for multichain hosts.
1201
+ - `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
1202
  - `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
1203
  - `backendRequestTimeoutMs`: timeout for backend REST reads. Defaults to 30000 ms.
1202
1204
  - `metadataEndpoint`: optional metadata GraphQL endpoint for `GlobalToken.iconURL` token icons only. Set to `null` to disable icon hydration.
@@ -1253,6 +1255,14 @@ Tap uses a single workspace without top section tabs. The chart starts as a line
1253
1255
  - `statusSurface`: where transaction status is surfaced — `'rail'` (default), `'toast'`, `'both'`, or `'none'`. The root `data-progress-state` attribute stays on regardless (see Toasts).
1254
1256
  - `toastPosition`: viewport corner for the widget-provided toaster. Defaults to `'bottom-right'`; ignored once a host mounts `<AegisSwapToaster />`.
1255
1257
 
1258
+ When `getProvider` is supplied, it owns wallet selection. Returning `null`
1259
+ keeps the widget disconnected; resolver failure never switches to an injected
1260
+ extension. With a controlled `account` (including `null`), `onConnectWallet`
1261
+ may return nothing after opening the host's wallet modal. The widget then waits
1262
+ for updated account/provider props without requesting accounts itself. A host
1263
+ may instead return a provider or provider/account connection to complete the
1264
+ connection immediately. Standalone widgets retain their injected-wallet flow.
1265
+
1256
1266
  The widget intentionally does not inherit the host font; set the
1257
1267
  `--aegis-swap-font-family` CSS variable (via `style` or a stylesheet) to match
1258
1268
  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 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";
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({
@@ -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-CEotHPNT.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-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-CjYBjn94.js";
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,
@@ -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';
@@ -1,3 +1,4 @@
1
+ export { AEGIS_SWAP_INK_CHAIN_ID, AEGIS_SWAP_INK_HOOK, AEGIS_SWAP_INK_ROUTER } from '@aegis-engine/core';
1
2
  export declare const AEGIS_SWAP_CHAIN_ID = 1;
2
3
  export declare const AEGIS_SWAP_BSC_CHAIN_ID = 56;
3
4
  export declare const AEGIS_SWAP_ROUTER: `0x${string}`;
@@ -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';
@@ -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-CjYBjn94.js";
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
  };