Thank you for your interest in contributing to the ChaosChain TypeScript SDK! This document provides guidelines for contributions.
- Node.js 18+
- npm or yarn
- Git
- Fork and clone the repository:
git clone https://github.com/YOUR_USERNAME/chaoschain-sdk-ts.git
cd chaoschain-sdk-ts- Install dependencies:
npm install- Create a
.envfile:
cp .env.example .env
# Add your private key and RPC URLs- Run tests:
npm test- Build the project:
npm run build- Create a new branch:
git checkout -b feature/your-feature-name- Make your changes following our code style
- Add tests for new functionality
- Ensure all tests pass:
npm run test
npm run typecheck
npm run lint- Build to ensure no errors:
npm run buildWe use ESLint and Prettier for code formatting:
# Format code
npm run format
# Check linting
npm run lintKey guidelines:
- Use TypeScript strict mode
- Add JSDoc comments for public APIs
- No
anytypes in public interfaces - Prefer
interfaceovertypefor object types - Use meaningful variable names
Follow conventional commits format:
feat: add support for new network
fix: resolve payment calculation issue
docs: update API documentation
test: add tests for WalletManager
chore: update dependencies
- Update documentation for any API changes
- Add tests for new features
- Ensure all CI checks pass
- Update CHANGELOG.md (if applicable)
- Request review from maintainers
- Tests added/updated and passing
- Documentation updated
- Code follows project style
- Commit messages are clear
- No breaking changes (or clearly documented)
- Build succeeds
# Run all tests
npm test
# Run specific test file
npm test -- WalletManager.test.ts
# Run with coverage
npm run test:coverageFor integration tests against live networks, ensure you have:
- Test wallet with testnet funds
- Valid RPC endpoints
- Storage provider credentials (for storage tests)
- Update README.md for user-facing changes
- Add JSDoc comments for new public APIs
- Update examples if API changes
- Keep CHANGELOG.md up to date
- Create file in
src/providers/storage/ - Implement
StorageProviderinterface - Export from
src/providers/storage/index.ts - Add tests
- Update documentation
- Add network to
NetworkConfigenum insrc/types.ts - Add contract addresses to
src/utils/networks.ts - Add RPC URL configuration
- Update documentation
Releases are automated via GitHub Actions:
- Update version in
package.json - Update CHANGELOG.md
- Create git tag:
git tag v0.1.0 - Push tag:
git push origin v0.1.0 - GitHub Actions will publish to npm
Use GitHub Issues with the bug template:
Title: Clear description of the bug
Description:
- Steps to reproduce
- Expected behavior
- Actual behavior
- Environment (Node.js version, OS)
- Relevant logs/errors
Use GitHub Issues with the feature request template:
Title: Feature name
Description:
- Use case / problem to solve
- Proposed solution
- Alternatives considered
- Additional context
- GitHub Discussions for questions
- Discord for community chat
- Email: sumeet.chougule@nethermind.io
- Be respectful and inclusive
- Provide constructive feedback
- Focus on what's best for the community
- Show empathy towards others
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to ChaosChain! 🎉