Skip to content

Conversation

@LuccaBitfly
Copy link
Contributor

  • refactor: move search handler funcs into searchTypeMap
  • feat: add search for address, transaction, block, epoch and token

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Aug 19, 2025

Deploying beaconchain with  Cloudflare Pages  Cloudflare Pages

Latest commit: 48cef6b
Status: ✅  Deploy successful!
Preview URL: https://9dd836e4.beaconchain.pages.dev
Branch Preview URL: https://api-54-search-types.beaconchain.pages.dev

View logs

Copy link
Contributor

@remoterami remoterami left a comment

Choose a reason for hiding this comment

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

left some comments, ptal

}
export interface SearchToken {
address: Address;
token: 'erc20' | 'erc721' | 'erc1155'; // currently only erc20 tokens can be found
Copy link
Contributor

Choose a reason for hiding this comment

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

question: can tokens be found by name too or just by address?
and if i get this right, we cannot find e.g. USDC for now?

Copy link
Contributor

Choose a reason for hiding this comment

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

USDC is an ERC20 token, so you should be able to find this.

But only via address yes, searching via name depends on what name should refer to. If it's the contract name, it's likely not a good idea as anyone can name their contract however they want, so by searching for USDC you would probably get a list of 10k scam contracts and 1 legit one.
If name refers to some internal labeling system (which we've had ideas for floating around for a while) it would work in theory, but at least I don't see how that would be working by looking at the code, and it needs to be actively maintained.
If it refers to something else, it should be specified.

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks, today I learnt.
I meant searching for the token name (like Tether, USDC, etc).

Copy link
Contributor

@remoterami remoterami left a comment

Choose a reason for hiding this comment

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

left a small comment, otherwise utack

IsContract: true,
Label: foundAddress.Name,
},
Token: foundAddress.Token,
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: The bigtable func will return ERC20 while the API specifies the tstype to be erc20, should streamline the capitalization

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed, ptal

@LuccaBitfly LuccaBitfly merged commit 560bf6a into staging Sep 9, 2025
6 checks passed
@LuccaBitfly LuccaBitfly deleted the API-54/search-types branch September 9, 2025 09:17
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.

4 participants