aegis-swap-widget 0.8.0 → 0.10.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 +122 -0
- package/DESIGN.md +2 -1
- package/README.md +272 -95
- package/dist/aegis-swap-widget.js +23255 -12175
- package/dist/components/Slider.d.ts +6 -2
- package/dist/components/Sparkline.d.ts +5 -1
- package/dist/components/icons.d.ts +2 -0
- package/dist/errors.d.ts +2 -3
- package/dist/format.d.ts +13 -0
- package/dist/hooks/useLatest.d.ts +2 -0
- package/dist/hooks/useRetryOnRefocus.d.ts +11 -0
- package/dist/hooks/useSubmitSwap.d.ts +46 -3
- package/dist/hooks/useSubmittedReceiptRecovery.d.ts +25 -0
- package/dist/hooks/useTokenAllowance.d.ts +7 -1
- package/dist/index.d.ts +6 -1
- package/dist/presets/wolf-game.js +131 -0
- package/dist/presets/wolfGame.d.ts +116 -0
- package/dist/styles.css +1 -1
- package/dist/submittedSwapContext.d.ts +19 -0
- package/dist/toast/useSwipeDismiss.d.ts +8 -1
- package/dist/transactionProgress.d.ts +1 -1
- package/dist/widget/AegisLeverageWidget.d.ts +8 -0
- package/dist/widget/AmountField.d.ts +1 -1
- package/dist/widget/AmountUnitToggle.d.ts +10 -0
- package/dist/widget/EngineAmountBox.d.ts +6 -1
- package/dist/widget/ProgressRail.d.ts +3 -1
- package/dist/widget/SwapFormBody.d.ts +2 -1
- package/dist/widget/SwapWidgetShell.d.ts +5 -1
- package/dist/widget/TokenPriceHistoryStrip.d.ts +8 -2
- package/dist/widget/TransactionStepList.d.ts +5 -0
- package/dist/widget/engine-controller/displayCache.d.ts +7 -1
- package/dist/widget/engine-controller/engineActionExpiry.d.ts +20 -1
- package/dist/widget/engine-controller/engineActionState.d.ts +22 -2
- package/dist/widget/engine-controller/engineCtaLabel.d.ts +17 -7
- package/dist/widget/engine-controller/engineDisplay.d.ts +85 -3
- package/dist/widget/engine-controller/engineLendCopy.d.ts +157 -0
- package/dist/widget/engine-controller/engineLifecycle.d.ts +15 -19
- package/dist/widget/engine-controller/engineOptions.d.ts +13 -1
- package/dist/widget/engine-controller/enginePermissionFamilies.d.ts +106 -0
- package/dist/widget/engine-controller/enginePositionBook.d.ts +66 -0
- package/dist/widget/engine-controller/enginePositionManageCopy.d.ts +61 -0
- package/dist/widget/engine-controller/engineQuoteFetch.d.ts +27 -6
- package/dist/widget/engine-controller/engineRequoteGuard.d.ts +5 -0
- package/dist/widget/engine-controller/engineTokenPull.d.ts +13 -0
- package/dist/widget/engine-controller/engineTradePositionStorage.d.ts +9 -0
- package/dist/widget/engine-controller/engineTransactionProgress.d.ts +17 -3
- package/dist/widget/engine-controller/engineTransactionView.d.ts +10 -1
- package/dist/widget/engine-controller/engineYieldAmount.d.ts +27 -0
- package/dist/widget/engine-controller/useEngineActionDrafts.d.ts +3 -3
- package/dist/widget/engine-controller/useEngineActivity.d.ts +1 -1
- package/dist/widget/engine-controller/useEngineAuthorizationPlan.d.ts +44 -0
- package/dist/widget/engine-controller/useEngineBuySwapProps.d.ts +3 -1
- package/dist/widget/engine-controller/useEngineMarketMarks.d.ts +18 -0
- package/dist/widget/engine-controller/useEnginePermissionSetup.d.ts +34 -0
- package/dist/widget/engine-controller/useEnginePositionActions.d.ts +75 -2
- package/dist/widget/engine-controller/useEnginePositionStrategies.d.ts +20 -0
- package/dist/widget/engine-controller/useEnginePositions.d.ts +48 -6
- package/dist/widget/engine-controller/useEngineSubmit.d.ts +58 -7
- package/dist/widget/engine-controller/useEngineTradePermissions.d.ts +81 -0
- package/dist/widget/engine-controller/useEngineTradeSubmit.d.ts +49 -0
- package/dist/widget/engine-ui/EngineBodySkeleton.d.ts +4 -0
- package/dist/widget/engine-ui/EngineBuyPanel.d.ts +7 -2
- package/dist/widget/engine-ui/EngineCollateralRow.d.ts +8 -0
- package/dist/widget/engine-ui/EngineCollateralRowSkeleton.d.ts +3 -0
- package/dist/widget/engine-ui/EngineDetailsBreakdown.d.ts +7 -0
- package/dist/widget/engine-ui/EngineEstimateReveal.d.ts +4 -0
- package/dist/widget/engine-ui/EngineLendPositionCard.d.ts +24 -2
- package/dist/widget/engine-ui/EngineLeverageControl.d.ts +22 -0
- package/dist/widget/engine-ui/EngineMarketDialog.d.ts +3 -1
- package/dist/widget/engine-ui/EngineNotice.d.ts +15 -0
- package/dist/widget/engine-ui/EngineOnboardingActivePermissions.d.ts +9 -0
- package/dist/widget/engine-ui/EngineOnboardingAuthorize.d.ts +18 -0
- package/dist/widget/engine-ui/EngineOnboardingFooter.d.ts +20 -0
- package/dist/widget/engine-ui/EngineOnboardingProgress.d.ts +12 -0
- package/dist/widget/engine-ui/EngineOnboardingReview.d.ts +19 -0
- package/dist/widget/engine-ui/EngineOnboardingSuccess.d.ts +15 -0
- package/dist/widget/engine-ui/EngineOverlaySheet.d.ts +18 -0
- package/dist/widget/engine-ui/EnginePartnerContext.d.ts +43 -0
- package/dist/widget/engine-ui/EnginePermissionRail.d.ts +21 -0
- package/dist/widget/engine-ui/EnginePermissionRailRow.d.ts +43 -0
- package/dist/widget/engine-ui/EnginePositionBookFacts.d.ts +5 -0
- package/dist/widget/engine-ui/EnginePositionManageDialog.d.ts +12 -2
- package/dist/widget/engine-ui/EnginePositionsPanel.d.ts +5 -3
- package/dist/widget/engine-ui/EngineQuotePending.d.ts +1 -0
- package/dist/widget/engine-ui/EngineReservedShell.d.ts +18 -0
- package/dist/widget/engine-ui/EngineRiskMeter.d.ts +7 -7
- package/dist/widget/engine-ui/EngineSegmentedControl.d.ts +12 -0
- package/dist/widget/engine-ui/EngineSimpleYieldPanel.d.ts +10 -0
- package/dist/widget/engine-ui/EngineStepStateIcon.d.ts +5 -0
- package/dist/widget/engine-ui/EngineStorePanel.d.ts +14 -0
- package/dist/widget/engine-ui/EngineTradeEstimate.d.ts +11 -0
- package/dist/widget/engine-ui/EngineTradeOnboarding.d.ts +49 -0
- package/dist/widget/engine-ui/EngineTradePermissions.d.ts +44 -0
- package/dist/widget/engine-ui/EngineTradePermissionsPanels.d.ts +62 -0
- package/dist/widget/engine-ui/EngineTransactionReceipt.d.ts +8 -1
- package/dist/widget/engine-ui/EngineTxDetailsPending.d.ts +1 -0
- package/dist/widget/engine-ui/TokenPairMark.d.ts +3 -3
- package/dist/widget/engine-ui/engineOnboardingPanelTypes.d.ts +6 -0
- package/dist/widget/engine-ui/enginePermissionCopy.d.ts +28 -0
- package/dist/widget/engine-ui/enginePermissionRailGeometry.d.ts +28 -0
- package/dist/widget/engine-ui/useEngineTradeEducation.d.ts +22 -0
- package/dist/widget/engine-ui/useLendCopy.d.ts +24 -0
- package/dist/widget/engine-ui/useOverlayClose.d.ts +1 -0
- package/dist/widget/engineTradeViewModel.d.ts +21 -0
- package/dist/widget/focusTrap.d.ts +1 -1
- package/dist/widget/transactionSteps.d.ts +44 -0
- package/dist/widget/types.d.ts +270 -15
- package/dist/widget/useAggregatedSwapController.d.ts +1 -1
- package/dist/widget/useEngineController.d.ts +3269 -5
- package/dist/widget/useSheetEntrance.d.ts +1 -1
- package/dist/widget/useStatusSurface.d.ts +17 -1
- package/dist/widget/useSwapController.d.ts +13 -3
- package/dist/widget/useWidgetStyle.d.ts +2 -1
- package/dist/widget/viewState.d.ts +19 -2
- package/package.json +8 -2
- package/dist/encoding.d.ts +0 -2
- package/dist/quote/aggregatedSwapQuote.d.ts +0 -1
- package/dist/services/kyberSwap.d.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,127 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3429c86: Launch the focused Wolf Game Trade and Earn integration without coupling the
|
|
8
|
+
SDK packages to the playground host.
|
|
9
|
+
|
|
10
|
+
Core now exports `summarizeEngineSimpleYieldPosition` for React-free lender
|
|
11
|
+
share valuation, add-funds projection, and realized historical weekly growth.
|
|
12
|
+
It uses live shares when available, falls back to trusted indexed shares, and
|
|
13
|
+
never presents the market's modeled `lendApyPct` as realized earnings. Core also
|
|
14
|
+
classifies RPC simulation failures for wallet-safe preflight messaging and
|
|
15
|
+
re-quotes direct swaps after permissions settle before submission.
|
|
16
|
+
|
|
17
|
+
Widget adds the Store buy presentation and the `simple-yield` Earn
|
|
18
|
+
presentation, including compact position growth, historical earnings context,
|
|
19
|
+
transparent partial withdrawals, stable loading states, and transaction-step
|
|
20
|
+
progress. The new `aegis-swap-widget/presets/wolf-game` export provides the
|
|
21
|
+
four-resource catalogue, focused defaults, and a helper that keeps the Store
|
|
22
|
+
pool and Earn market synchronized from one controlled resource.
|
|
23
|
+
|
|
24
|
+
The generic opt-in capabilities remain available to other hosts:
|
|
25
|
+
`surfaceLabels` renames exposed tabs, `lendPresentation` selects a built-in
|
|
26
|
+
plain-language presentation, and `onInteractionLockChange` reports when host
|
|
27
|
+
navigation must stay fixed.
|
|
28
|
+
|
|
29
|
+
Add the opt-in `showTransactionSteps` prop to Swap and Engine. It renders a
|
|
30
|
+
compact ordered wallet journey only while an action is active, with the total
|
|
31
|
+
step count, completed steps, current wallet or network wait, and the next step.
|
|
32
|
+
The Wolf Game preset enables it for Trade and Earn.
|
|
33
|
+
|
|
34
|
+
Trade rechecks price after wallet permissions without weakening the reviewed
|
|
35
|
+
protection or exceeding the signed spend cap. Receipt recovery keeps an
|
|
36
|
+
unconfirmed permission transaction on its permission step instead of implying
|
|
37
|
+
that the final Trade or Earn action was submitted.
|
|
38
|
+
|
|
39
|
+
`lendPresentation` selects a built-in lexicon, exported as `AegisEngineLendCopy`
|
|
40
|
+
and overridable per string through the new `lendCopy` prop. Hosts supply their
|
|
41
|
+
own vocabulary rather than inheriting another integration's.
|
|
42
|
+
|
|
43
|
+
`marketId` and `defaultMarketId` now compare `evm_`-prefixed ids case
|
|
44
|
+
insensitively inside the widget, so externally supplied casing cannot lose a
|
|
45
|
+
controlled market selection. Uncontrolled hosts are unaffected — both sides of
|
|
46
|
+
that comparison come from the same market list.
|
|
47
|
+
|
|
48
|
+
Use these in the Wolf Game preview to launch a focused Trade and Earn flow,
|
|
49
|
+
keep one resource selected across both actions, and leave the game dashboard
|
|
50
|
+
context behind an explicit optional Showroom mode.
|
|
51
|
+
|
|
52
|
+
### Patch Changes
|
|
53
|
+
|
|
54
|
+
- Updated dependencies [3429c86]
|
|
55
|
+
- @aegis-engine/core@0.6.0
|
|
56
|
+
|
|
57
|
+
## 0.9.0
|
|
58
|
+
|
|
59
|
+
### Minor Changes
|
|
60
|
+
|
|
61
|
+
- c76ba41: Add Engine Long/Short trading.
|
|
62
|
+
|
|
63
|
+
Core sizes a directional position against one block-pinned Engine state and v4
|
|
64
|
+
route, then opens it in a single atomic router call. The swap settles inside the
|
|
65
|
+
transaction, so the wallet signs only the authorizations it must.
|
|
66
|
+
|
|
67
|
+
The widget gains an opt-in `'trade'` surface and a dedicated one-view
|
|
68
|
+
`AegisLeverageWidget`. Leverage limits come from the quote, alongside the
|
|
69
|
+
trader-facing risk facts for the position. Authorization reports its request
|
|
70
|
+
count per chain, and a review step is mandatory before submission but stays
|
|
71
|
+
customizable. Permissions are granted in sequence, each with its own checkpoint;
|
|
72
|
+
after a partial failure the revoke guidance for what was already granted stays
|
|
73
|
+
on screen. A successful open links through to Positions.
|
|
74
|
+
|
|
75
|
+
Position identity survives a reload: the strategy is reconstructed from indexed
|
|
76
|
+
opening actions, with optional bounded persistence of the reviewed target
|
|
77
|
+
scenario.
|
|
78
|
+
|
|
79
|
+
- 1e7a963: Keep the Leverage Positions surface trader-first and evidence-backed.
|
|
80
|
+
|
|
81
|
+
Only positions with strict indexed Long/Short evidence appear in the Leverage
|
|
82
|
+
widget. Ordinary borrow vaults remain in the portfolio presentation and are no
|
|
83
|
+
longer relabelled as trades while classification loads or fails. Stored opening
|
|
84
|
+
intents enrich matching indexed strategies but never classify a vault alone.
|
|
85
|
+
|
|
86
|
+
The collapsed trade row removes the borrow-rate runway, LTV bar, and
|
|
87
|
+
credit-product language. It shows direction, pair, opening-plan leverage, and a
|
|
88
|
+
signed underlying price move only while a fresh on-chain pool mark is available.
|
|
89
|
+
It does not call that move PnL or return. The detail keeps the reviewed
|
|
90
|
+
entry→target plan, and live debt/equity use the Engine liquidity-debt valuation
|
|
91
|
+
instead of deriving dollars or leverage from the protocol LTV ratio.
|
|
92
|
+
When NFT/LP collateral is attached and cannot be valued from the live idle
|
|
93
|
+
balances, the widget omits total equity rather than presenting a partial value.
|
|
94
|
+
|
|
95
|
+
"Last activity" now appears only when something actually happened after the
|
|
96
|
+
open. On an untouched lot it restated the opening date the collapsed row already
|
|
97
|
+
carries — one fact wearing two formats.
|
|
98
|
+
|
|
99
|
+
### Patch Changes
|
|
100
|
+
|
|
101
|
+
- 1e7a963: Unify the failure taxonomy and remove dead-end error states.
|
|
102
|
+
|
|
103
|
+
Core now owns one error classifier: `classifyError` returns curated copy plus a
|
|
104
|
+
failure `kind` and `retryable` flag, `UserFacingError` accepts both, and
|
|
105
|
+
`errorMessage` stays as a message-only compat wrapper. Wallet-cancelled sends
|
|
106
|
+
and not-ready Engine markets keep their curated copy instead of collapsing to a
|
|
107
|
+
generic fallback, and a not-ready market is marked non-retryable so retry CTAs
|
|
108
|
+
suppress.
|
|
109
|
+
|
|
110
|
+
The widget re-exports the core classifier (removing its diverged fork), catches
|
|
111
|
+
core's `TransactionReceiptTimeoutError` (hash included, explorer-link
|
|
112
|
+
messaging) instead of viem's unreachable timeout, retries failed Engine market
|
|
113
|
+
discovery via a Try again button and on refocus, turns a failed allowance check
|
|
114
|
+
into an enabled Try again CTA, labels fallback-served Engine data as
|
|
115
|
+
"last known" with a retry, derives inline errors from one precedence object
|
|
116
|
+
(submit failures outrank background quote failures), and keeps raw backend
|
|
117
|
+
error text out of the inline alert (widget log only).
|
|
118
|
+
|
|
119
|
+
- 1e7a963: Hug Engine onboarding sheets to their content and end leverage opens on a trading success screen with See position and Open another.
|
|
120
|
+
- Updated dependencies [1e7a963]
|
|
121
|
+
- Updated dependencies [c76ba41]
|
|
122
|
+
- Updated dependencies [1e7a963]
|
|
123
|
+
- @aegis-engine/core@0.5.0
|
|
124
|
+
|
|
3
125
|
## 0.8.0
|
|
4
126
|
|
|
5
127
|
### Minor Changes
|
package/DESIGN.md
CHANGED
|
@@ -45,7 +45,8 @@ carry across both themes. `theme="auto"` follows `prefers-color-scheme`.
|
|
|
45
45
|
|
|
46
46
|
## Motion
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
Motion uses CSS and the browser Web Animations API. No third-party animation
|
|
49
|
+
runtime ships with the widget, and `prefers-reduced-motion` is respected.
|
|
49
50
|
|
|
50
51
|
| Token | Default | Role |
|
|
51
52
|
| --- | --- | --- |
|