Skip to content
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

Merged
merged 4 commits into from
Oct 22, 2024

Conversation

walmat
Copy link
Contributor

@walmat walmat commented Oct 15, 2024

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.

@walmat walmat changed the title remove bunch of duplicate utils Swaps v2 cleanup duplicates / unused utils Oct 15, 2024
@walmat walmat marked this pull request as ready for review October 16, 2024 19:30
@brunobar79
Copy link
Member

Launch in simulator or device for d8f0bd6

Copy link
Contributor

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

Copy link
Contributor

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?

@walmat walmat changed the base branch from feat/remove-swaps-v1 to develop October 21, 2024 20:43
@walmat walmat changed the base branch from develop to feat/remove-swaps-v1 October 21, 2024 20:43
@walmat walmat merged commit 85bf5ff into feat/remove-swaps-v1 Oct 22, 2024
9 checks passed
@walmat walmat deleted the @matthew/remove-duplicate-utils branch October 22, 2024 15:14
jinchung pushed a commit that referenced this pull request Oct 31, 2024
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants