cw-rest-api is a Node.js wrapper and HTTP REST API server for the ChatWars MMORPG Telegram game. Version 1.8.0 provides a promise-based interface to interact with the ChatWars API, including user profile retrieval, stock information, and trade commands (buy/sell). It uses AMQP for messaging with automatic reconnection via node-amqp-connection-manager. The package requires Node.js >=8.11.3 and is designed for building Telegram bots or other applications that automate gameplay. Key differentiators: provides both a programmatic Node.js API and a standalone HTTP server, supports authentication flow via Telegram, and offers real-time trade capabilities. Release cadence appears to be sporadic, with last update in 2018.
npm install cw-rest-apiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import CWExchange, connect, and make API calls (profile, stock, trade) with token authentication.
Consider using a maintained alternative or fork. Check game API compatibility before using.
Use Node.js version 8.11.3 or use nvm to switch versions.
Use default import: import CWExchange from 'cw-rest-api'; or require('cw-rest-api').default.Set environment variables: export CW_APP_NAME=your_username; export CW_APP_PASSWORD=your_password.
If using the server, ensure proper network isolation and update dependencies manually.
Use default import: import CWExchange from 'cw-rest-api';
Start the AMQP server or check apiUrl and accessToken passed to cw.connect().
Re-authenticate via the API/auth endpoint to obtain a new token.