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

Reintroduce support for crosschain search results in swaps search #6440

Merged

Conversation

jinchung
Copy link
Member

@jinchung jinchung commented Feb 3, 2025

Fixes APP-2321

What changed (plus any additional context for devs)

  1. Consolidate calls that were being done separately for verified and unverified results. The new v3 endpoint allows consolidation across chains as well as "lists" (e.g, verified, high liquidity unverified, and low liquidity unverified). We can reduce the number of calls we were doing.
  2. Re-introduce crosschain search results when there's an exact match on the query.

Screen recordings / screenshots

Example showing crosschain results:
Screenshot 2025-02-02 at 6 05 34 PM

Another example showing crosschain results:
Screenshot 2025-02-02 at 6 05 25 PM

Example showing result for address search:
Screenshot 2025-02-02 at 12 06 50 PM

What to test

  • Test that swap search results still behave as expected, with the addition of crosschain search results showing up when there is an exact match (in name or symbol)
  • Test that pasting in a full address still works as expected

Copy link

linear bot commented Feb 3, 2025

@@ -4,6 +4,27 @@ import { SearchAsset } from '@/__swaps__/types/search';
import { Address } from 'viem';
import { isNativeAsset } from '@/handlers/assets';

export function parseTokenSearchResults(assets: SearchAsset[]): SearchAsset[] {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a new function here that will eventually replace / consolidate the other parsers in this file once I finish moving DiscoverSearch over to the new query store.

@@ -77,29 +72,6 @@ export const useTokenSearchStore = createQueryStore<VerifiedTokenData, TokenSear
{ persistThrottleMs: time.seconds(8), storageKey: 'verifiedTokenSearch' }
);

export const useUnverifiedTokenSearchStore = createQueryStore<SearchAsset[], TokenSearchParams<TokenLists.HighLiquidity>>(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the removal of the "extra" call for assets on the unverified list - these results will now show up as part of the main call to tokenSearchQueryFunction

@jinchung jinchung marked this pull request as ready for review February 3, 2025 02:04
@jinchung jinchung changed the title Reintroduce support for crosschain search in swaps Reintroduce support for crosschain search results in swaps search Feb 3, 2025
@brunobar79
Copy link
Member

Launch in simulator or device for 6e18c56

Copy link
Contributor

@walmat walmat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@derHowie derHowie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 🥇

Copy link
Contributor

@ibrahimtaveras00 ibrahimtaveras00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA passed 👍🏽

@jinchung jinchung merged commit 5651f36 into @christian/query-store-token-search Feb 6, 2025
11 of 12 checks passed
@jinchung jinchung deleted the @jin/swap-crosschain-search branch February 6, 2025 14:43
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.

6 participants