dex-tracker
v1.0.2
Published
Real-time DEX transaction tracking library
Maintainers
Readme
DexTracker Client
A Node.js library for listening to real-time DEX transactions using the DexTracker API.
Installation
npm install wsUsage
const DexTracker = require('./dex-tracker');
const tracker = new DexTracker();
tracker.on('trade', (trade) => {
console.log('New trade:', trade);
});
tracker.connect('sol', '4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R');API
Methods
connect(network, address)- Connect to track trades for a specific tokendisconnect()- Close the connectionisConnected()- Check connection status
Events
connected- Fired when connection is establishedtrade- Fired when a new trade is receivederror- Fired when an error occursdisconnected- Fired when connection is lostreconnecting- Fired during reconnection attempts
Supported Networks
sol- Solanaeth- Ethereumbsc- Binance Smart Chainbase- Basetron- Tron
Trade Data Structure
{
type: 'buy' | 'sell',
network: 'sol' | 'eth' | 'bsc' | 'base' | 'tron',
volume: number, // USD amount
price: number, // USD price
exchange: string,
txn: string, // Transaction ID
walletAddress: string,
pool: string // Pool address
}