coinbase / coinbase/onchainkit
Bug: getTokens API search Parameter Returns Incomplete Results for "USDC"
- Dominant language
- TypeScript
- Stars
- 1k
- Forks
- 520
- Avg merge
- 32m
- Merged PRs (30d)
- 2
Description
### Describe the bug and the steps to reproduce it
🐛 Bug Description
When using the search parameter with the getTokens API, the returned token list is incomplete. For example, when searching for "USDC", the results do not include the standard USDC token (address: 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913), which is returned normally when no search parameter is provided.
🔍 Steps to Reproduce
Call the getTokens API with search: "USDC".
Observe the returned token list.
Call the getTokens API again without the search parameter.
Compare both results to find that the standard USDC token is missing from the search results.
Actual Request Example (JSON-RPC):
`{
"id": 1,
"jsonrpc": "2.0",
"method": "cdp_listSwapAssets",
"params": [
{
"limit": "50",
"page": "1",
"search": "USDC"
}
]
}`
Actual Response:
`{
"id": 1,
"jsonrpc": "2.0",
"result": [
{
"address": "0x90850a54004f9fcfbd0175a57747a39e231ea571",
"chainId": 8453,
"decimals": 18,
"image": "",
"name": "Stable AMM - USDbC/axlUSDC",
"symbol": "sAMM-USDbC/axlUSDC"
},
{
"address": "0xeb466342c4d449bc9f53a865d5cb90586f405215",
"chainId": 8453,
"decimals": 6,
"image": "",
"name": "Axelar Wrapped USDC",
"symbol": "axlUSDC"
}
]
}`
Expected Response: Should include the standard USDC token:
`{
"address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
"chainId": 8453,
"decimals": 6,
"image": "https://d3r81g40ycuhqg.cloudfront.net/wallet/wais/44/2b/442b80bd16af0c0d9b22e03a16753823fe826e5bfd457292b55fa0ba8c1ba213-ZWUzYjJmZGUtMDYxNy00NDcyLTg0NjQtMWI4OGEwYjBiODE2",
"name": "USDC",
"symbol": "USDC"
}`
💻 Environment Information
Library/API: @coinbase/onchainkit getTokens API
Network: Base Mainnet (chainId: 8453)
📝 Additional Context
This issue may prevent developers from obtaining complete relevant token lists through the search functionality, affecting the normal operation of application features. The search algorithm or backend data indexing might not be covering all tokens that should match the search criteria.
We hope this issue can be confirmed and resolved promptly. Thank you for the maintainers' hard work!
### What's the expected behavior?
The search results for "USDC" should include ALL tokens that match the search criteria in token name, symbol, or address, particularly the standard USDC token that exactly matches the search term.
### What version of the libraries are you using?
"@coinbase/onchainkit": "^1.1.2",
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the getTokens API and the cdp_listSwapAssets JSON-RPC method, reproducing the search="USDC" request on Base Mainnet and comparing it with an unfiltered response. Done means the search results include the standard USDC token at 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913 while retaining other matching tokens.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100