Rugplay Logger
A powerful TypeScript WebSocket client for real-time logging and exporting of Rugplay trading events with support for file exports and Discord notifications.
Features
- Real-time WebSocket Connection: Connect to Rugplayβs WebSocket API for live trading data
- Event Logging: Comprehensive logging of all trading events with timestamps
- Multiple Export Formats: Export data to JSON, YAML, or CSV formats
- Discord Integration: Send trading alerts directly to Discord via webhooks
- Auto-reconnection: Robust connection handling with automatic reconnection
- TypeScript Support: Full TypeScript implementation with type safety
- Event-driven Architecture: Subscribe to specific events with custom handlers
- Dark Mode Support: Toggle between light and dark themes for comfortable viewing
Quick Start
Installation
# Clone the repository
git clone https://github.com/your-repo/rugplay-logger.git
cd rugplay-logger
# Install dependencies
npm install
# Build the project
npm run build
# Run the logger
npm start
Basic Usage
import { RugplayClient } from './src/client/RugplayClient';
import { webSocketConfig } from './src/configuration/websocket';
import { exportConfig } from './src/configuration/export';
// Create client with auto-connect
const client = new RugplayClient({
config: webSocketConfig,
exportConfig: exportConfig,
autoConnect: true,
debug: false
});
// Listen for trade events
client.on('trade', (data) => {
console.log('New trade:', data);
});
// Listen for price updates
client.on('price', (data) => {
console.log('Price update:', data);
});
Project Structure
src/
βββ client/ # WebSocket client implementation
βββ configuration/ # Configuration files
βββ logger/ # Event logging system
βββ types/ # TypeScript type definitions
βββ index.ts # Main entry point
βββ sdk.ts # SDK exports
docs/ # Documentation (Jekyll)
exports/ # Generated export files
tests/ # Test files
Documentation
- API Reference - Complete API documentation
- Configuration - Setup and configuration guide
- Event Types - Available WebSocket events
- Examples - Usage examples and recipes
License
This project is licensed under the GNU License. See the LICENSE file for details.