feat: init token and yield when disconnected - #426
Conversation
🦋 Changeset detectedLatest commit: 47d6d0b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Pull Request Overview
This PR improves the widget's initialization behavior when disconnected by implementing fallback logic for token and yield selection. When preferred tokens or yields are not available for the current network, the system now falls back to the first available option from any network.
- Enhanced
getInitialTokento use fallback token selection when preferred tokens are unavailable - Updated
firstEligibleYieldto implement similar fallback logic for yield selection - Added changelog entry documenting the new disconnected initialization behavior
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/widget/src/domain/types/stake.ts | Added fallback logic to select first available token when preferred tokens are missing |
| packages/widget/src/hooks/api/use-multi-yields.ts | Implemented fallback yield selection using first available network's yields |
| .changeset/warm-worms-study.md | Added changelog entry for the new fallback initialization feature |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This pull request introduces improvements to how the widget initializes tokens and yields when there is no direct connection or when preferred token/yield information is missing. The main focus is to provide sensible defaults by falling back to the first available token or yield in these cases.
Enhancements to default token and yield initialization:
getInitialTokeninstake.tsto fall back to the first available token yield when a preferred token yield is not specified, ensuring smoother initialization when disconnected.firstEligibleYield inuse-multi-yields.ts` to select the first available yield as a fallback if the preferred yield is not found, improving robustness in yield selection logic.Changelog update: