Skip to content

Fetch only stablecoins, Add Avalance, BNB, Celo, Gnosis, zkSync support#13

Open
timjrobinson wants to merge 3 commits intomainfrom
fetch-only-stablecoins
Open

Fetch only stablecoins, Add Avalance, BNB, Celo, Gnosis, zkSync support#13
timjrobinson wants to merge 3 commits intomainfrom
fetch-only-stablecoins

Conversation

@timjrobinson
Copy link
Copy Markdown
Contributor

  • Adds support for paying with tokens on Avalance, BNB, Celo, Gnosis, and zkSync
  • Fetches only Stablecoins from Alchemy to speed up requests
  • Refactor config into the same spot, and place supported chains and tokens in their own files

timjrobinson and others added 3 commits July 28, 2025 13:39
Major improvements to token fetching and chain support:

Token Fetching:
- Created tokens.ts configuration for supported stablecoins (USDC, USDT, DAI)
- Updated AlchemyService to only fetch configured tokens instead of all tokens
- Removed unnecessary metadata API calls for better performance
- Fixed native token pricing to use correct prices (MATIC, BNB, AVAX, etc.)

New Chains Added:
- BNB Chain (BSC) - Chain ID 56
- Avalanche - Chain ID 43114
- Gnosis - Chain ID 100
- Celo - Chain ID 42220
- zkSync Era - Chain ID 324

Configuration Consolidation:
- Enhanced ChainConfig interface with all chain properties
- Added centralized helper functions for chain lookups
- Removed duplicate network mappings across services
- Created O(1) lookup maps for better performance
- Single source of truth for all chain configurations

This significantly improves performance by only fetching ~3 tokens per chain
instead of potentially hundreds, and makes adding new chains much easier.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Extracted SUPPORTED_CHAINS array and related types/functions to chains.ts
- Kept all chain configuration logic in a dedicated module
- Improved code organization and separation of concerns
- No functional changes, purely organizational refactoring

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

1 participant