-
Notifications
You must be signed in to change notification settings - Fork 635
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
Swaps v2 cleanup duplicates / unused utils #6202
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
helpers/utilities
is a funny name lmao
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wdyt of removing the Worklet
suffix? since worklet functions work in both runtimes, we can consolidate it all in single functions, rn we have two functions for the same thing in multiple cases
not for this pr, just what do you think?
* start on ripping out old swaps * Update package.json * clean up lint * add pbx? * tslint is a liar * fixed it * rm graph * revert changes to pbx * Swaps v2 cleanup duplicates / unused utils (#6202) * remove bunch of duplicate utils * remove unused hooks and remove duplicate AnimatedBlurView * remove multiple getUniqueIds and only keep worklet version * reorder worklets * remove getCrosschainSwapServiceTime from handlers/swap * remove ExchangeSearch * remove unused NetworkSwitcher components * rename useFeePanelInputRefs to useFeesPanelInputRefs * remove swapSearch and walletFilter * delete unused useMinRefuelAmount hook * delete unused exchangeModalTypes file * remove unused selectUserAssetsListByChainId selector * change getAddressAndChainIdFromUniqueId to work for both networks and chains * remove duplicate buildLocalizedTimeUnitString util * remove duplicate buildLocalizedTimeUnitString util * remove TokenSelectionButton * remove SendFab * replace a couple accessors to native assets that could be sync * remove unused fromChainId from useSearchCurrencyList * remove unused isCrosschainSearch from useSearchCurrencyList * bring back navigation hook that prevents readOnly wallets from navigating to buy, send, and swaps * clean up crossChainServiceTime and remove traces * add swaps v2 comment * fix initial asset missing on expanded state navigation (#6240) * fix gas button stuck on loading (#6241) * fix gas button issues? * rm poll causing infinite loop * remove some weird checks * maybe? * move unused vars to swaps util
What changed (plus any additional context for devs)
All of the shared / unused utils for swaps got moved into the already existing version or deleted.
@/__swaps__/utils/numbers
->@/helpers/utilities
@/__swaps__/screens/Swap/components/AnimatedBlurView
->
@/components/AnimatedComponents/AnimatedBlurView
@/__swaps__/utils/ethereum
->@/parsers
@/__swaps__/utils/hex
->@/handlers/web3
@/__swaps__/utils/strings
->@/utils
@/__swaps__/utils/address
->@/utils/ethereumUtils
@/__swaps__/utils/chains
->@/handlers/assets
Any swaps function that was unused by anything I went ahead and deleted.
Condensed
@/__swaps__/utils/time
->@/__swaps__/utils/gasUtils.ts
since we only needed one function in that file and it was only used in gas related stuff.Remove unused hooks
useAssetsToBuy
,useAssetsToSell
,useAssets
,There were multiple functions handling deriving uniqueId from asset address and chainId, so I condensed those into one place. And there was also multiple uniqueId builders, which now we only have one.
Also, I moved
safe-math
into the TLD. Didn't move other swaps files as that should be done in another PR in order to keep this one as small as possible.Screen recordings / screenshots
What to test
test critical paths from swaps, sends, etc.