@aegis-engine/core 0.12.0 → 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/README.md CHANGED
@@ -626,17 +626,32 @@ carry the `uniswap-v4-aegis` tag. It checks this before build and, in
626
626
  hop is tagged with any other source, it throws `NoAegisRouteError`
627
627
  (`reason: 'no-route' | 'non-aegis-leg'`).
628
628
 
629
+ Mainnet and Ink charge an output fee. Pass the deployment's `/v1/config`
630
+ `fee.outputFeeBps` as `outputFeeBps` in the same options object (an integer from
631
+ 0 to 200; `0` charges no fee) and to `executeKyberSwap`; the route request,
632
+ build and calldata check all use it. `executeKyberSwap` rejects a displayed
633
+ quote at any other fee before any wallet prompt, approval or signature, and
634
+ refuses to sign if the submitted fee differs. Omit it when config is
635
+ unavailable to keep the bundled 50 bps (`AGGREGATED_SWAP_FEE_BPS`).
636
+
629
637
  Ink (57073) has no Kyber coverage, so it uses an in-house provider that accepts
630
638
  only `liquiditySources: 'aegis'` (`'any'` is rejected). It enumerates every path
631
639
  of up to three hops through the shipped Ink pool catalogue, quotes all of them
632
640
  (at most 32) in one Multicall3 `eth_call` to the V4 quoter, and takes the best
633
- output net of the 50 bps fee. Pass a `publicClient` (the eighth argument) to
641
+ output net of the output fee. Pass a `publicClient` (the eighth argument) to
634
642
  reuse your RPC. The swap goes to the Aegis router, which pulls input through
635
643
  Permit2: `executeKyberSwap` approves Permit2 for the exact input, signs a
636
644
  Permit2 grant for the router, re-quotes, and simulates before sending. The
637
645
  calldata ends with a fixed `TAKE` of the reviewed minimum, so a short fill
638
646
  reverts.
639
647
 
648
+ Quotes carry `routePaths` for display: each path's input share (`amountIn`) and
649
+ its legs (`pool`, `tokenIn`, `tokenOut`, `source`), as the provider reported
650
+ them. It is omitted unless every path is complete, its legs chain, and its
651
+ endpoints match the quoted assets up to canonical native/wrapped aliases. Known
652
+ input allocations must sum to the quoted input. Invalid metadata is omitted
653
+ without rejecting the display quote. Execution never reads it.
654
+
640
655
  ## KyberSwap Execution
641
656
 
642
657
  ```ts
@@ -738,7 +753,13 @@ pnpm pack:check
738
753
 
739
754
  ## Engine account portfolio and activity
740
755
 
741
- `fetchEngineAccountPortfolio({ source, account, chainIds, signal })` reads one complete, bounded account snapshot from the versioned portfolio API. The returned positions, totals, prices and per-chain frames belong to the same snapshot. A failed or expired page rejects the read instead of mixing snapshots. Supported chain IDs are 1, 130, 8453 and 4663; pass the distinct host-selected set.
756
+ `fetchEngineAccountPortfolio({ source, account, chainIds, signal })` reads one complete, bounded account snapshot from the versioned portfolio API. The returned positions, totals, prices and per-chain frames belong to the same snapshot. A failed or expired page rejects the read instead of mixing snapshots. Supported chain IDs are 1, 56, 130, 8453, 4663 and 57073 (Ink); pass the distinct host-selected set. The complete read is bounded to 300 positions, matching the backend's six-chain maximum of 50 positions per chain, with the existing 25-position page requests, response byte limits and shared deadline.
757
+
758
+ Portfolio, paged activity and transaction acknowledgement reads are available through the existing `@aegis-engine/core/account` entrypoint. Ink support admits the source contract; it does not enable borrowing, activate an operator or establish a live wallet/accounting result. Hosts retain their existing action gates and must qualify the deployed backend separately.
759
+
760
+ Ink account reads require a deployed Engine account API that supports Ink and
761
+ the six-chain, 300-position contract. Hosts must qualify that backend before
762
+ enabling the integration and retain their existing action gates.
742
763
 
743
764
  Metrics keep `usd: null`, a `knownUsd` subtotal and reasons when coverage is incomplete. Gross assets include supplied value; adding supply again would double count it. Debt and net equity remain separate. NFT principal, fees, unknown prices and unavailable chains retain their coverage reasons. `performance` explicitly reports unavailable cash-flow and cost-basis evidence.
744
765
 
@@ -765,6 +786,9 @@ change does not claim it is already available through the accounting endpoint.
765
786
 
766
787
  `fetchEngineMarketCandles`, `fetchEngineMarketReferenceHistory`, and
767
788
  `fetchEngineRateHistory` read public market data with a shared, bounded REST request.
789
+ These display reads admit Ink (`57073`) through the same market identity, asset,
790
+ coverage and provenance guards. Admission does not establish live source coverage;
791
+ an unavailable history remains unavailable rather than falling back to another feed.
768
792
  Validated responses are cached for 30 seconds with at most 16 entries, keyed by
769
793
  endpoint, request headers, timeout, market, series and window. A missing endpoint
770
794
  backs off for 60 seconds; 429/503 responses back off for at least 30 seconds and
package/dist/account.js CHANGED
@@ -1,5 +1,5 @@
1
- import { w as u, o as b, n as A, s as I, l as P, E as g, A as h, r as f, a as x, i as c, b as E, c as S, d as C, e as _, P as T, f as D } from "./transactionHistory-B-F6o9hW.js";
2
- import { g as M, h as j, j as J, k as O, m as U, p as G, q as Z, t as Q, u as V, v as W, x as X, y as Y, z as ee, B as ae, C as oe, D as se, F as ne, G as te, H as re } from "./transactionHistory-B-F6o9hW.js";
1
+ import { w as u, o as b, n as A, s as I, l as P, E as g, A as h, r as f, a as x, i as c, b as E, c as S, d as C, e as _, P as T, f as D } from "./transactionHistory-CFVVYJeo.js";
2
+ import { g as M, h as j, j as J, k as O, m as U, p as G, q as Z, t as Q, u as V, v as W, x as X, y as Y, z as ee, B as ae, C as oe, D as se, F as ne, G as te, H as re } from "./transactionHistory-CFVVYJeo.js";
3
3
  import { keccak256 as k, encodeAbiParameters as y } from "viem";
4
4
  const H = b({ version: P(1), snapshotId: I().uuid(), page: A().int().min(1).max(95) }).strict();
5
5
  function v(e) {
@@ -39,6 +39,11 @@ export declare function executeKyberSwap(args: {
39
39
  approvalMode?: AegisSwapApprovalMode;
40
40
  /** `'aegis'` routes only through Aegis pools and fails closed otherwise. Defaults to `'any'`. */
41
41
  liquiditySources?: AggregatedSwapLiquiditySources;
42
+ /**
43
+ * Output fee in bps from `/v1/config` (`fee.outputFeeBps`). Pass the value
44
+ * the displayed quote was fetched with; omit it to keep the bundled default.
45
+ */
46
+ outputFeeBps?: number;
42
47
  signal?: AbortSignal;
43
48
  onWalletChainId?: (chainId: number | null) => void;
44
49
  } & AegisSwapActionCallbacks): Promise<AegisSwapActionResult<AggregatedSwapQuote>>;