Complete API client implementations for the Coinmate.io cryptocurrency exchange in Java, TypeScript, Python, and PHP.
All four implementations provide:
- β Complete API Coverage - All 55+ Coinmate API endpoints
- β Type Safety - Full type checking (compile-time for Java/TS, runtime hints for Python/PHP)
- β HMAC-SHA256 Authentication - Automatic signature generation
- β Production Ready - Error handling, proper decimal precision
- β Well Documented - Examples and detailed documentation
| Language | Best For | Async | Precision | Documentation |
|---|---|---|---|---|
| Java | Enterprise, trading bots | Blocking | BigDecimal | π Java Docs |
| TypeScript | Web apps, Node.js services | Non-blocking | number | π TS Docs |
| Python | Scripts, data analysis | Non-blocking | Decimal | π Python Docs |
| PHP | Web backends, APIs | Blocking | string | π PHP Docs |
All four implementations share the same .env file for credentials!
# Copy the example file
cp .env.example .env
# Edit .env and add your Coinmate API credentials
# COINMATE_CLIENT_ID=your_client_id
# COINMATE_PUBLIC_KEY=your_public_key
# COINMATE_PRIVATE_KEY=your_private_keyGet your credentials from Coinmate Account Settings.
|
Java mvn exec:java \
-Dexec.mainClass="org.example.Main" |
TypeScript cd typescript
npm install
npm start |
Python cd python
pip install -r requirements.txt
python -m src.main |
PHP cd php
composer install
composer start |
| Java | TypeScript | Python |
|---|---|---|
CoinmateTypedClient client =
new CoinmateTypedClient(config);
CoinmateResponse<Ticker> response =
client.getTicker("BTC_EUR");
if (response.isSuccess()) {
Ticker ticker = response.getData();
System.out.println(ticker.getLast());
} |
const client = new CoinmateClient(config);
const response =
await client.getTicker('BTC_EUR');
if (!response.error) {
const ticker = response.data;
console.log(ticker.last);
} |
async with CoinmateClient(config) as client:
response = await client.get_ticker('BTC_EUR')
if not response.error:
ticker = response.data
print(ticker.last) |
| Java | TypeScript | Python |
|---|---|---|
CoinmateResponse<OrderResult> order =
client.buyLimit(
"BTC_EUR",
"0.001",
"50000"
);
if (order.isSuccess()) {
System.out.println(
order.getData().getOrderId()
);
} |
const order = await client.buyLimit({
currencyPair: 'BTC_EUR',
amount: '0.001',
price: '50000'
});
if (!order.error) {
console.log(order.data.orderId);
} |
order = await client.buy_limit(
currency_pair='BTC_EUR',
amount='0.001',
price='50000'
)
if not order.error:
print(order.data.order_id) |
All four implementations support the same complete set of endpoints:
- πͺ Currencies and trading pairs
- π Order book and ticker data
- π Recent transactions
- β° Server time
- π° Account balances
- π΅ Trading fees
- π Transaction history
- π Trade history
- π Transfer history
- π Buy/Sell limit orders
- β‘ Buy/Sell instant (market) orders
- π Replace orders
- β Cancel orders
- π Order history
- βΏ Bitcoin (BTC) - including Lightning Network
- Ξ Ethereum (ETH)
- Ε Litecoin (LTC)
- β Ripple (XRP)
- β³ Cardano (ADA)
- β Solana (SOL)
- π³ Bank wire withdrawals
Total: 55+ endpoints fully implemented
coinmateApiExamples/
βββ .env # Shared credentials (all languages)
βββ .env.example # Template
βββ LICENSE # MIT License
βββ README.md # This file (language-neutral)
β
βββ java/ # Java implementation
β βββ main/java/org/example/coinmate/
β β βββ auth/ # HMAC-SHA256 authentication
β β βββ client/ # API clients
β β βββ config/ # Configuration
β β βββ model/ # Type-safe models
β βββ README.md # Java documentation
β βββ API_METHODS.md # Complete method reference
β βββ TYPED_MODELS.md # Typed models guide
β
βββ typescript/ # TypeScript/Node.js implementation
β βββ src/
β β βββ auth/ # HMAC-SHA256 authentication
β β βββ client/ # API clients
β β βββ types/ # TypeScript type definitions
β β βββ main.ts # Example application
β βββ README.md # TypeScript documentation
β
βββ python/ # Python implementation
β βββ src/
β β βββ auth/ # HMAC-SHA256 authentication
β β βββ client/ # API clients
β β βββ types/ # Python type definitions (dataclasses)
β β βββ main.py # Example application
β βββ README.md # Python documentation
β
βββ php/ # PHP implementation
βββ src/
β βββ Auth/ # HMAC-SHA256 authentication
β βββ Client/ # API clients
β βββ Types/ # PHP type definitions (readonly classes)
β βββ main.php # Example application
βββ README.md # PHP documentation
All implementations use the same HMAC-SHA256 authentication mechanism:
- Nonce: Unix timestamp in milliseconds (must increase with each request)
- Message: Concatenate
nonce + clientId + publicKey - Signature: HMAC-SHA256 hash of message using private key
- Format: Convert signature to uppercase hexadecimal string
Authentication is handled automatically by each client.
| Feature | Java | TypeScript | Python | PHP |
|---|---|---|---|---|
| Compile-time checks | β Yes | β Yes | ||
| IDE auto-completion | β Full | β Full | β Full | β Full |
| Decimal precision | BigDecimal | number (float) | Decimal | string |
| Refactoring support | β Full | β Full | ||
| Null safety | β Yes | β Yes |
- Two API styles: JsonObject (flexible) and Typed Models (recommended)
- BigDecimal for precise financial calculations
- Builder pattern for configuration
- Try-with-resources for automatic cleanup
- Maven for dependency management
- Full TypeScript type definitions
- Async/await with Promises
- Zero external dependencies (only axios and dotenv)
- npm scripts for development
- Works in Node.js
- Type hints with dataclasses
- Async/await with asyncio and aiohttp
- Decimal type for financial precision
- Context managers for cleanup
- pip for dependency management
- Python 3.11+ required
- Readonly classes for immutable types (PHP 8.2+)
- Guzzle HTTP client for requests
- phpdotenv for environment configuration
- Composer for dependency management
- PSR-4 autoloading
π Never commit your API keys!
- The
.envfile is in.gitignoreand won't be committed - Use environment variables or the
.envfile for credentials - Consider using read-only API keys for non-trading operations
- Rotate your keys regularly
- Use different keys for development and production
All four implementations can run without credentials and will test only public endpoints:
# Java
mvn exec:java -Dexec.mainClass="org.example.Main"
# TypeScript
cd typescript && npm start
# Python
cd python && python -m src.main
# PHP
cd php && composer startAll implementations follow the same error handling pattern:
- Network errors: Caught as exceptions/errors at the call site
- API errors: Returned in the response object with
error: trueanderrorMessage - Check before use: Always check
isSuccess()(Java) or!error(TS/Python) before accessing data
mvn clean package
java -jar target/coinmate-api-example-1.0-SNAPSHOT.jarcd typescript
npm run build
node dist/main.jscd python
python -m src.main # Or deploy with your preferred methodcd php
composer install --no-dev
php src/main.phpThis is an example project demonstrating Coinmate API integration in multiple languages. Feel free to:
- Fork and extend for your needs
- Report issues
- Suggest improvements
- Add more language implementations
MIT License - See LICENSE for details.
- π Coinmate Website
- π Coinmate API Documentation
- π Get API Keys
- π¬ Coinmate Support
- Java: See java/README.md
- TypeScript: See typescript/README.md
- Python: See python/README.md
- PHP: See php/README.md
- API Methods: See java/API_METHODS.md
- Typed Models (Java): See java/TYPED_MODELS.md
Made with β€οΈ for the Coinmate.io community