1.0.7 • Published 6 months ago
@eco-foundation/eco-chains v1.0.7
@eco-foundation/eco-chains
A TypeScript library that provides chain definitions for various blockchain networks, with a focus on Eco ecosystem support. The library extends viem's chain interfaces and provides utilities for managing RPC connections with API key replacements.
Installation
# Using pnpm
pnpm add @eco-foundation/eco-chains
# Using yarn
yarn add @eco-foundation/eco-chains
# Using npm
npm install @eco-foundation/eco-chainsUsage
import { EcoChains, ethereum, eco } from '@eco-foundation/eco-chains'
// Initialize EcoChains with API keys
const chains = new EcoChains({
infuraKey: 'your-infura-key',
alchemyKey: 'your-alchemy-key',
})
// Get a specific chain with updated RPC URLs
const ethereumChain = chains.getChain(ethereum)
// Access chain properties
console.log(ethereumChain.id) // Chain ID
console.log(ethereumChain.name) // Chain name
console.log(ethereumChain.rpcUrls) // RPC endpoints with API keys insertedAvailable Chains
arbitrum- Arbitrum Onebase- Baseeco- Eco Chainethereum- Ethereum Mainnetgoerli- Ethereum Goerli Testnethelix- Helixmantle- Mantleoptimism- Optimismpolygon- Polygon
Features
- Extends viem's Chain interface
- Supports API key replacements in RPC URLs
- Includes WebSocket endpoints with validation
- Provides comprehensive chain metadata
- Type-safe with TypeScript and runtime validation
Development
Setup
# Install dependencies
pnpm install
# Build the project
pnpm build
# Run tests
pnpm testQuality Assurance
# Run linter
pnpm lint
# Fix linting issues
pnpm lint:fix
# Check formatting
pnpm format:check
# Format code
pnpm formatVersioning and Releases
This project uses Semantic Versioning and Conventional Commits to automate version management and package releases.
Releases are automatically created when changes are merged to the main branch. The version number is determined by the commit messages:
fix:orperf:commits trigger patch releases (0.0.x)feat:commits trigger minor releases (0.x.0)- Commits with
BREAKING CHANGE:in the message trigger major releases (x.0.0)
For more details on contributing, see CONTRIBUTING.md.
License
MIT
1.0.7
6 months ago
1.0.6
6 months ago
1.0.5
6 months ago
1.0.4
6 months ago
1.0.3
6 months ago
1.0.2
6 months ago
1.0.1
7 months ago
1.0.0
7 months ago
0.0.12-alpha
7 months ago
0.0.11-alpha
7 months ago
0.0.1-alpha
7 months ago