feat(widget)!: enforce single source of truth for fee/order/slippage/referrer#741
Merged
Merged
Conversation
…referrer Strip fee, referrer, order, slippage from sdkConfig.routeOptions (extends the existing Omit). Drop top-level WidgetConfig.fee — use feeConfig.fee instead. Fixes inconsistent precedence between SDKClientProvider and the settings store. Refs EMB-389
E2E Examples — failuresThe following example(s) failed:
See the workflow run for Playwright reports and logs. |
effie-ms
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which Linear task is linked to this PR?
EMB-389 — Wave 1, item #3
Why was it implemented this way?
Today four settings exist in two places — top-level
WidgetConfigandsdkConfig.routeOptions— with inconsistent precedence between read paths:sdkConfig.routeOptionsfeeWidgetConfig.feerouteOptions.fee(via spread)feeConfig?.fee || feereferrerWidgetConfig.referrerrouteOptions.referrerroutePriorityWidgetConfig.routePriorityrouteOptions.orderslippageWidgetConfig.slippagerouteOptions.slippageSetting both desyncs the SDK client from the settings UI.
This PR makes duplication impossible at the type level by extending the existing
OmitinWidgetSDKConfig.routeOptionsto also stripfee | referrer | order | slippage. This applies the same rule the codebase already follows forbridgesandexchanges.Additionally drops the top-level
WidgetConfig.feesofeeConfig.feeis the single way to set the integrator fee.Alternatives considered:
sdkConfig.routeOptions— these are user-configurable defaults that flow into the settings store/UI, conceptually closer toappearance/fromChainthan toapiUrl. Top-level is the right home.Visual showcase
N/A — backend API type changes; widget renders identically. Smoke test confirms the playground loads with no new console errors.
Checklist before requesting a review
Breaking change
Migration:
```diff
```