Skip to content

Conversation

@bernatfp
Copy link
Member

Summary

Implement cosmos.directory integration to automatically fetch chain parameters (denom metadata, APR, slashing params) and provide RPC fallback. This feature works orthogonally with any provider and requires only a new 'chain_name' config field.

Changes

  • Add chain_name config field (defaults to lowercase of chain display name)
  • Parse cosmos.directory API responses for chain data (types, params, APR)
  • Use cosmos.directory as fallback for denom metadata and APR when ABCI queries fail
  • Automatically fallback to cosmos.directory RPC proxy when configured nodes fail
  • Add 10-second timeout to HTTP requests and 30-minute response caching
  • Updated example config with documentation

Testing

  • Build passes: go build ./...
  • Tests pass: go test ./...
  • Backward compatible: chains without chain_name use existing behavior
  • Works with all providers (default, namada, future providers)

🤖 Generated with Claude Code

bernatfp and others added 2 commits January 19, 2026 14:07
Implement cosmos.directory support to automatically fetch chain parameters
(denom metadata, APR, slashing params) and provide RPC fallback. This feature
works orthogonally with any provider (default, namada, etc.) and requires only
a new 'chain_name' config field. If not set, defaults to lowercase of the chain
display name.

Key changes:
- Add 'chain_name' config field to ChainConfig
- Add cosmos.directory data types and API fetching with 10s timeout and 30m caching
- Use cosmos.directory as fallback for denom metadata (after ABCI query fails)
- Use cosmos.directory as fallback for APR/chain info (after ABCI query fails)
- Automatically try cosmos.directory RPC proxy when configured nodes fail
- Updated example config with chain_name documentation

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add non-negative check before converting int exponent to uint32 to prevent
potential integer overflow when processing cosmos.directory denom units.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bernatfp bernatfp force-pushed the bernatfp/cosmos-directory-provider branch from 20a6041 to 1744855 Compare January 19, 2026 13:17
@bernatfp bernatfp requested a review from gluckzhang January 19, 2026 13:27
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.

2 participants