aegis-swap-widget 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.
- package/CHANGELOG.md +6 -0
- package/README.md +33 -4
- package/dist/aegis-swap-widget.js +4472 -4433
- package/dist/widget/types.d.ts +11 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -164,10 +164,38 @@ silent unless the host supplies an `actionRequirement`; then the widget places
|
|
|
164
164
|
one compact purpose row beside the active Buy or Borrow transaction content.
|
|
165
165
|
Partner identity, weather, aggregate balances, activities, secondary details,
|
|
166
166
|
and navigation remain available only in the default `showroom` variant. If the
|
|
167
|
-
host already owns resource selection, pass
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
167
|
+
host already owns resource selection, pass the selected token through
|
|
168
|
+
`marketResource`. The widget resolves its eligible Lend/Borrow market from live
|
|
169
|
+
Engine discovery on the active chain by exact address and symbol:
|
|
170
|
+
|
|
171
|
+
```tsx
|
|
172
|
+
const wolfResources = {
|
|
173
|
+
WATER: {
|
|
174
|
+
chainId: 1,
|
|
175
|
+
address: '0x828B22c9ea1c20B551EeFC6198174C4bb7a8CBF6',
|
|
176
|
+
symbol: 'WATER',
|
|
177
|
+
},
|
|
178
|
+
// WOOD, GRASS, and STONE use the same shape.
|
|
179
|
+
} as const
|
|
180
|
+
|
|
181
|
+
<AegisEngineWidget
|
|
182
|
+
chainId={1}
|
|
183
|
+
enabledChainIds={[1]}
|
|
184
|
+
marketResource={wolfResources[selectedResource]}
|
|
185
|
+
/>
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
The resource chain must be the widget's active chain; Valley uses `chainId={1}`.
|
|
189
|
+
This controlled form hides the widget market picker. It selects only one exact,
|
|
190
|
+
surface-compatible match and fails closed when discovery returns none or more
|
|
191
|
+
than one. The host does not need to store Engine market ids. `marketResource`
|
|
192
|
+
locates the market; it does not lock which of the market's two tokens the user
|
|
193
|
+
chooses inside Lend or Borrow. If several Engine markets intentionally use the
|
|
194
|
+
same resource, add `marketId` only to disambiguate within those matches. A
|
|
195
|
+
mismatched id never bypasses resource identity. Use `defaultMarketId` when the
|
|
196
|
+
widget should own selection. The nested Buy surface remains independently
|
|
197
|
+
controlled through `buySwapConfig`; one-shot partner Buy intents already
|
|
198
|
+
resolve their matching direct pool.
|
|
171
199
|
|
|
172
200
|
Wolf Game's current aggregate API provides Community 12 balances, weather, and
|
|
173
201
|
harvesting data. It does not provide wallet-specific inventory, claimable
|
|
@@ -900,6 +928,7 @@ No other props changed. See the [CHANGELOG](./CHANGELOG.md) for the full entry.
|
|
|
900
928
|
- `title`: optional widget heading. Swap and Engine default to empty for compact embedded chrome.
|
|
901
929
|
- `showNetworkSelector`: Engine header-network visibility: `'never'` (default), `'auto'`, or `'always'`. Cross-chain markets and tokens remain available in the full selectors when the header rail is hidden.
|
|
902
930
|
- `onSurfaceChange`: Engine callback fired when the active unified tab changes (`'buy'`, `'borrow'`, `'lend'`, or `'positions'`).
|
|
931
|
+
- `marketResource`: controlled Lend/Borrow market locator (`chainId`, token `address`, and `symbol`). On the active chain, the widget resolves one eligible Engine market, hides its picker, and fails closed on missing or ambiguous matches. It does not lock token direction. Use `marketId` only as an optional disambiguator for the same resource.
|
|
903
932
|
- `buySwapConfig`: optional host overrides for the nested Engine Buy surface only. Use it to constrain Buy to a chain, pool set, or controlled `poolId` without changing Engine market discovery or the Lend/Borrow/Positions surfaces.
|
|
904
933
|
- `showBuySettings`: show the Engine Buy surface's slippage-settings control. Defaults to `false`.
|
|
905
934
|
- `showAmountSlider`: amount-slider visibility on the Engine lend/borrow amount boxes: `'auto'` (default) shows sliders on the borrow surface only, sized against the wallet's borrowing limit; `'always'` adds the lend deposit slider; `'never'` hides every amount slider.
|