Support for new liquidity provider (tonco) #37
Merged
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.
This pull request includes several changes to improve the functionality and code quality of the Swap component and related stores. The most important changes include adding support for a new liquidity provider, improving the asset filtering logic, and updating various code formatting and imports.
Support for new liquidity provider:
lib/store/events.store.ts: Added 'tonco' as a new value for thedextype in theonSwapevent.lib/store/options.store.ts: Added 'tonco' and 'omniston' as new values for theliquidity_providertype inSwapOptions. Updated the defaultliquidity_providerto 'mytonswap' and added logic to initialize theMyTonSwapClientwith the specified liquidity provider. [1] [2] [3]lib/store/swap.store.tsandlib/store/wallet.store.ts: Updated the initialization ofMyTonSwapClientto remove thebaseUrlparameter and set headers with thewidget-version. [1] [2]lib/utils/swap.ts: Removed thebaseUrlparameter from theMyTonSwapClientinitialization and set headers with thewidget-version.Asset filtering improvements:
lib/components/SwapCard/CardDialog.tsx: Refactored the asset filtering logic to handle invalid addresses gracefully and improve search functionality.Code formatting and imports:
lib/store/events.store.tsandlib/store/options.store.ts: Updated import statements to use single quotes for consistency. [1] [2]lib/store/events.store.ts: Updated console log statements to use single quotes.Additional story for Swap component:
lib/components/Swap/Swap.stories.tsx: Added a new storyWithLiquidityProviderto demonstrate the Swap component with a liquidity provider.Styling improvements:
lib/components/Swap/Swap.scss: Set the background of buttons to transparent.