Thank you for your interest in contributing to the unofficial AsterDEX TypeScript SDK! This is a community-maintained project that provides a comprehensive TypeScript interface for the AsterDEX cryptocurrency exchange.
⚠️ Important: This is an unofficial SDK and is not affiliated with or endorsed by AsterDEX. This is a community effort to provide better developer tools for the AsterDEX platform.
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Testing
- Documentation
- Pull Request Process
- Reporting Issues
By participating in this project, you agree to abide by our Code of Conduct. Please be respectful and professional in all interactions.
- Be respectful and inclusive
- Accept constructive criticism gracefully
- Focus on what is best for the community
- Show empathy towards other community members
- Fork the repository on GitHub
- Clone your fork locally
- Set up the development environment
- Create a new branch for your changes
- Make your changes
- Test your changes
- Submit a pull request
- Node.js >= 18.0.0
- npm, yarn, or pnpm
- Git
# Clone your fork
git clone https://github.com/YOUR_USERNAME/asterdex-sdk.git
cd asterdex-sdk
# Install dependencies
npm install
# Copy environment template (if available)
cp .env.example .env
# Build the project
npm run build
# Run tests
npm testFor testing with real API credentials (optional):
ASTERDEX_API_KEY=your-api-key
ASTERDEX_API_SECRET=your-api-secret
ASTERDEX_ENVIRONMENT=testnet # Always use testnet for developmentUse descriptive branch names:
feature/add-futures-api- New featuresfix/websocket-reconnection- Bug fixesdocs/update-readme- Documentation updatesrefactor/error-handling- Code refactoring
We use ESLint and Prettier for code formatting:
# Check linting
npm run lint
# Fix linting issues
npm run lint:fix
# Format code
npm run format- Use strict TypeScript
- Add proper type annotations
- Avoid
anytypes when possible - Export all public types from the main index
Follow conventional commits format:
feat: add new endpoint for futures tradingfix: resolve websocket reconnection issuedocs: update API documentationtest: add unit tests for spot client
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverage
# Run specific test file
npm test -- config.test.ts- Write unit tests for all new functionality
- Use descriptive test names
- Mock external dependencies
- Aim for high test coverage (>90%)
- Test both success and error scenarios
import { describe, it, expect, vi } from 'vitest';
describe('FeatureName', () => {
describe('methodName', () => {
it('should handle normal case', () => {
// Test implementation
});
it('should handle error case', () => {
// Test error scenarios
});
});
});Add JSDoc comments for all public APIs:
/**
* Places a new order on the exchange
*
* @param params - Order parameters
* @returns Promise resolving to order response
* @throws {ValidationError} When required parameters are missing
* @throws {ApiResponseError} When API returns an error
*
* @example
* ```typescript
* const order = await client.spot.newOrder({
* symbol: 'BTCUSDT',
* side: 'BUY',
* type: 'LIMIT',
* quantity: '0.001',
* price: '35000'
* });
* ```
*/
public async newOrder(params: NewOrderParams): Promise<OrderAck> {
// Implementation
}- Add working examples for new features
- Update existing examples when APIs change
- Ensure examples are tested and functional
- Ensure your code follows the project's coding standards
- Write or update tests for your changes
- Update documentation as needed
- Run the full test suite
- Build the project successfully
When creating a pull request, include:
- Description: Clear description of changes
- Type: Feature, bug fix, documentation, etc.
- Testing: How you tested the changes
- Breaking Changes: Any breaking changes
- Related Issues: Link to related issues
- All PRs require at least one review
- All tests must pass
- Code coverage should not decrease
- Documentation must be updated for new features
- Breaking changes require special consideration
When reporting bugs on GitHub Issues, include:
- Environment: Node.js version, OS, SDK version
- Steps to Reproduce: Clear steps to reproduce the issue
- Expected Behavior: What you expected to happen
- Actual Behavior: What actually happened
- Code Sample: Minimal code to reproduce the issue
- Error Messages: Full error messages and stack traces
Template:
## Bug Description
Brief description of the bug
## Environment
- Node.js version:
- OS:
- SDK version:
- TypeScript version:
## Steps to Reproduce
1. Step 1
2. Step 2
3. Step 3
## Expected Behavior
What should happen
## Actual Behavior
What actually happens
## Code Sample
\```typescript
// Minimal reproducible code
\```
## Error Messages
\```
Error stack trace here
\```For feature requests, include:
- Use Case: Why is this feature needed?
- Proposal: How should it work?
- Examples: Example usage
- Alternatives: Alternative solutions considered
Template:
## Feature Request
### Problem/Use Case
Describe the problem or use case
### Proposed Solution
How should this feature work?
### Example Usage
\```typescript
// Example code showing how the feature would be used
\```
### Alternatives Considered
Other solutions you've considered
### Additional Context
Any other relevant information- Follow existing naming conventions
- Use consistent parameter patterns
- Maintain backwards compatibility when possible
- Use appropriate error types
- Provide meaningful error messages
- Include error codes when available
- Define interfaces for all API responses
- Use union types for enums
- Export all public types
- Document all public methods
- Include usage examples
- Document error conditions
Releases are handled by the maintainer:
- Version bump following semantic versioning
- MAJOR: Breaking changes
- MINOR: New features (backwards compatible)
- PATCH: Bug fixes (backwards compatible)
- Update
CHANGELOG.mdwith all changes - Create release notes on GitHub
- Publish to npm (if applicable)
- Tag release on GitHub
We especially welcome contributions in these areas:
- 🐛 Bug fixes and stability improvements
- 📚 Documentation improvements and examples
- ✅ Test coverage improvements
- 🔒 Security enhancements
- ⚡ Performance optimizations
- 🎨 Code quality and refactoring
- 🌐 New WebSocket stream types
- 📊 Additional utility functions
- 🔄 Rate limiting improvements
- 📈 Advanced trading strategies helpers
- 🎯 TypeScript strict mode improvements
- 🧪 Integration test suite
✅ Encouraged:
- Well-tested code with high coverage
- Clear, documented APIs
- Performance improvements
- Security enhancements
- Bug fixes with test cases
- Documentation improvements
- Helpful examples
❌ Discouraged:
- Breaking changes without discussion
- Code without tests
- Undocumented features
- Performance regressions
- Security vulnerabilities
Contributors will be:
- Listed in the project README
- Mentioned in release notes for significant contributions
- Credited in the
package.jsoncontributors field
By contributing, you agree that:
- Your contributions will be licensed under the MIT License
- You have the right to submit the work
- You understand this is an unofficial SDK not affiliated with AsterDEX
If you have questions about contributing:
- 📖 Check existing issues and pull requests
- 💬 Create a new GitHub Discussion for general questions
- 🐛 Open an issue for specific problems
- 🐦 Contact the maintainer on Twitter
Thank you for contributing to the AsterDEX TypeScript SDK! Your efforts help make cryptocurrency trading more accessible to developers. Every contribution, no matter how small, is valuable to the community.
Maintainer: methodnumber13 Repository: asterdex-sdk