@aegis-engine/core 0.6.0 → 0.7.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.
@@ -4,6 +4,7 @@ export type SwapSettlementContext = {
4
4
  recipient: Address;
5
5
  /** Output token address; zero address or the 0xEeee… sentinel means native. */
6
6
  outputToken: Address;
7
+ inputToken?: Address;
7
8
  };
8
9
  /**
9
10
  * Best-effort decode of what the swap actually settled to the recipient:
@@ -13,3 +14,6 @@ export type SwapSettlementContext = {
13
14
  * never failed retroactively over display data.
14
15
  */
15
16
  export declare function resolveSettledAmountOut(publicClient: PublicClient, receipt: TransactionReceipt, settlement: SwapSettlementContext): Promise<bigint | undefined>;
17
+ /** Receipt-local input transfers, net of token refunds. Native spends have no
18
+ * Transfer logs and remain unknown here rather than using a block balance guess. */
19
+ export declare function resolveSettledAmountIn(receipt: TransactionReceipt, settlement: SwapSettlementContext): bigint | undefined;
@@ -19,6 +19,8 @@ export type AegisSwapReceiptSummary = {
19
19
  * case UIs should keep showing the quote estimate with a "~" affordance.
20
20
  */
21
21
  settledAmountOut?: bigint;
22
+ /** Net input-token transfers from the payer in this receipt, after refunds. */
23
+ settledAmountIn?: bigint;
22
24
  };
23
25
  export declare function isBusy(status: SubmitStatus): boolean;
24
26
  export type TransactionProgressState = 'pending' | 'mining' | 'success' | 'error';
@@ -51,12 +53,42 @@ export type TransactionProgressView = {
51
53
  state: TransactionProgressState;
52
54
  label: string;
53
55
  walletPrompts: AegisSwapWalletPromptProgress;
54
- /** Calm fill showing completed wallet-provider prompts. */
56
+ /** Calm fill showing settled rail steps; the final action settles on receipt. */
55
57
  completePct: number;
56
58
  /** Visual activity layer width; pending/mining sweeps full-width by default. */
57
59
  activeWidthPct: number;
60
+ /**
61
+ * Steps the rail divides itself into, so a three-step flow reads
62
+ * 33/66/100 instead of one indivisible half. Presentation only, and separate
63
+ * from `walletPrompts`: the Engine counts settlement steps it can name, not
64
+ * provider prompts it cannot predict. Absent when the total is not known
65
+ * before the first prompt — the rail then stays one continuous bar rather
66
+ * than inventing a denominator that could grow mid-flight.
67
+ */
68
+ steps?: number;
69
+ };
70
+ /**
71
+ * Chips the top rail divides itself into. Explicit settlement steps when a
72
+ * producer counts them, else the wallet-prompt plan — which is the swap path's
73
+ * step count already. Fewer than two is not a division worth drawing, so the
74
+ * rail stays one continuous bar. Where along those chips the bar sits comes
75
+ * from `completePct`, so only the count is needed here.
76
+ */
77
+ export declare function progressRailSteps(view: TransactionProgressView | null | undefined): number | undefined;
78
+ export declare function normalizeProgressCount(value: number): number;
79
+ /** Shared geometry for every widget and host rail. The final action is only
80
+ * complete after confirmation, even if every wallet prompt has finished. */
81
+ export declare function transactionSequenceProgress({ total, completed, confirmed }: {
82
+ total: number;
83
+ completed: number;
84
+ confirmed?: boolean;
85
+ }): {
86
+ total: number;
87
+ completed: number;
88
+ completePct: number;
89
+ steps?: number;
58
90
  };
59
- export declare function transactionProgressView({ status, inputSymbol, txHash, transactionStage, actionError, approvalRequired, approvalDone, resetRequired, approvalsCompleted, authorizationRequired, authorizationPrompts, authorizationsCompleted }: {
91
+ export declare function transactionProgressView({ status, inputSymbol, txHash, transactionStage, actionError, approvalRequired, approvalPrompts, approvalDone, resetRequired, approvalsCompleted, authorizationRequired, authorizationPrompts, authorizationsCompleted }: {
60
92
  status: SubmitStatus;
61
93
  inputSymbol: string;
62
94
  txHash: Hex | null;
@@ -64,6 +96,8 @@ export declare function transactionProgressView({ status, inputSymbol, txHash, t
64
96
  transactionStage?: 'permission' | 'swap' | null;
65
97
  actionError: string | null;
66
98
  approvalRequired: boolean;
99
+ /** Explicit executor plan, including every prerequisite approval. */
100
+ approvalPrompts?: number;
67
101
  approvalDone: boolean;
68
102
  /** Whether the approval spends an extra approve(0) prompt first. */
69
103
  resetRequired?: boolean;
@@ -89,6 +123,11 @@ export type AegisSwapStatusSnapshot = {
89
123
  /** Rail geometry; null while idle. */
90
124
  completePct: number | null;
91
125
  activeWidthPct: number | null;
126
+ /**
127
+ * Segmented rail chip count; null for a continuous or hidden rail.
128
+ * Optional so existing host-authored snapshot fixtures may omit it.
129
+ */
130
+ steps?: number | null;
92
131
  txHash: Hex | null;
93
132
  /**
94
133
  * Submission-time chain, account, and asset identity for `txHash`. Null
package/dist/wallet.d.ts CHANGED
@@ -27,7 +27,7 @@ export declare function getProviderAccount(provider: Eip1193Provider): Promise<A
27
27
  export declare function requestProviderAccount(provider: Eip1193Provider): Promise<Address | null>;
28
28
  export declare function getProviderChainId(provider: Eip1193Provider): Promise<number | null>;
29
29
  export declare function switchProviderChain(provider: Eip1193Provider, chain: number | ProviderChainConfig): Promise<void>;
30
- export declare function createSwapPublicClient(chain: Chain, rpcUrls: readonly string[]): PublicClient;
30
+ export declare function createSwapPublicClient(chain: Chain, rpcUrls: readonly string[], readProvider?: Eip1193Provider): PublicClient;
31
31
  export declare function subscribeProvider(provider: Eip1193Provider, handlers: {
32
32
  onAccountsChanged?: () => void;
33
33
  onChainChanged?: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aegis-engine/core",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "React-free Aegis Swap and Engine quoting, risk, approval, and execution operations.",
5
5
  "license": "MIT",
6
6
  "type": "module",