-
Notifications
You must be signed in to change notification settings - Fork 15
Feat/swaps integration #2039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mchappell
wants to merge
52
commits into
main
Choose a base branch
from
feat/swaps-integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feat/swaps integration #2039
Conversation
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
- allow user to automatically lock up collateral without creating tx - if a suitable UTXO is available
7001a8c to
dc695c5
Compare
Collaborator
Allure Report
processReports: ❌ test report for f044c0d7
|
Fix bug where slippage value resets after being changed if any other input receives focus. The innerSlippage state now syncs with targetSlippage when the drawer opens.
Sync localExcludedDexs with excludedDexs when the liquidity sources drawer opens to ensure the drawer displays the current state.
Add validation for empty strings, NaN, and negative numbers in slippage input. Handle empty string case for better UX while typing.
Add validation in handleSaveSlippage to prevent saving invalid slippage values (NaN, <= 0, or > max).
Reset slippageError state when the drawer opens to ensure a clean state for each drawer session.
Add comment clarifying that feeAdust is intentionally misspelled as required by the SteelSwap API to prevent confusion.
Remove targetSlippage from useEffect dependencies to prevent innerSlippage from resetting when targetSlippage changes while the drawer is open. Only sync when the drawer opens.
Replace hardcoded 'Confirm' string with translation key
t('general.button.confirm') for consistency with other drawers.
Fix inconsistent capitalization from 'Steelswap' to 'SteelSwap' to match the brand name used elsewhere in the codebase.
…rwrite Make slippage a persistent global setting that: - Persists to localStorage when user changes it - Loads from localStorage on mount - Only initializes from feature flag if no user setting exists - Never gets overwritten by feature flag changes after user sets it
Use ref to track drawer state transitions and include targetSlippage in dependencies to ensure current value is used when drawer opens, preventing stale closure issues.
Use ref to track drawer state transitions and only sync when drawer opens, preventing local state from being reset when excludedDexs changes while drawer is open.
Validate that the stored slippage value from localStorage is a valid number before using it to prevent type errors from corrupted storage data.
Fix critical bug where Failure enum had same value as Success, causing failure state to be indistinguishable from success state. This would lead to incorrect UI rendering and state management.
Add defensive null check to prevent runtime error when unsignedTx is null or undefined. This prevents app crash if function is called without a valid transaction.
Fix incorrect error message that referenced 'ThemeContext' instead of 'SwapsContext', which would be confusing for developers debugging context issues.
Add defensive null check for unsignedTx and estimate to prevent runtime errors. While conditionally rendered in SwapContainer, this ensures type safety and prevents potential crashes. Moved null check after hooks to comply with React hooks rules.
Add delay before applying feature flag defaults to ensure storage load completes first. This prevents feature flag from overwriting user's persisted slippage setting if feature flag loads before storage completes.
Replace splice() with slice() to avoid mutating the original tokens array. This prevents unexpected behavior with re-renders and state consistency issues.
Add defensive null checks when accessing asset balances to prevent runtime errors if asset is not found. Also fix potential undefined string concatenation for tokenB selection.
- Add comment explaining why fetchEstimate returns early when unsignedTx exists - Fix interval cleanup to handle undefined case properly - Remove unused excludedDexs dependency from useEffect (already in fetchEstimate)
Add filtering to remove undefined values that could result from missing pools in split groups. This prevents 'undefined' from appearing in the quote sources string.
Fix misleading comment that said 'seconds' when the value is actually in milliseconds (15 seconds = 15,000 milliseconds).
Add useRef to imports for consistency instead of using React.useRef. This follows the standard import pattern used elsewhere in the codebase.
Add validation to check for NaN after converting quantity to number. This prevents invalid quantity values from being sent to the API and provides a clear error message if conversion fails.
Fix logic error where || was used instead of &&, which could cause the empty state to not render correctly. Now properly checks if tokens array is missing or empty before showing empty state.
Simplify the double negation logic to make it clearer. If the value is undefined, default to false (not acknowledged), then negate to show the disclaimer (true).
Add proper error logging and user feedback for fetchDexList and fetchSwappableTokensList. Errors are now logged to console and user is notified via toast notification instead of silently failing.
Replace console.error with logger from @lace/common for consistency with the rest of the codebase. Logger provides error capturing (Sentry) in addition to console output.
Make error handling more consistent by always returning (not throwing) and logging errors appropriately. 406 status still shows specific error message, while other errors show generic message with logging.
… issues Add check to ensure decimals is greater than 0 before using it in division and toFixed operations. This prevents potential issues with edge case tokens that might have zero or negative decimals.
Extract hardcoded values (900 for TTL, 20 for pagination) to named constants in const.ts for better maintainability and clarity.
Add basic runtime validation for API responses to ensure they have the expected structure before using them. This prevents runtime errors if the API returns unexpected data.
…nsList Remove toast notification that referenced non-existent translation key and restore original throw behavior
… calls Remove STEELSWAP_TOKEN from API headers as the proxy does not require authentication. Update comments to use relative documentation paths instead of full URLs.
Update .env.defaults to use https://steelswap.lw.iog.io as the default SteelSwap API URL instead of the direct API endpoint.
|
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.




LW-13779
LW-13350
LW-13351
LW-13352
LW-13353
LW-13354
LW-13356
LW-13357
LW-13398