Skip to content

Commit

Permalink
feat: add alias for specific list (#8342)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lanttcat committed Dec 23, 2022
1 parent a86c592 commit 895c254
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/web3-providers/src/DSearch/rules.ts
Expand Up @@ -12,6 +12,8 @@ export const getHandlers = <ChainId, SchemaType>(): Array<Handler<ChainId, Schem
filter: (data: SearchResult<ChainId, SchemaType>, keyword: string) => {
if (data.type !== SearchResultType.FungibleToken) return false

if (data.alias?.map((x) => x.toLowerCase()).includes(keyword.toLowerCase())) return true

const symbol = data.symbol
if (symbol === keyword || symbol?.replace(/\s/g, '') === keyword) return true

Expand Down
1 change: 1 addition & 0 deletions packages/web3-shared/base/src/specs/index.ts
Expand Up @@ -647,6 +647,7 @@ export interface FungibleTokenResult<ChainId, SchemaType> extends Result<ChainId
name: string
symbol: string
source: SourceType
alias?: string[]
token?: FungibleToken<ChainId, SchemaType>
}

Expand Down

0 comments on commit 895c254

Please sign in to comment.