API Endpoint URL
WebSocket endpoint: wss://wsapi.mintrax.exchange
This page is served on normal HTTPS. Requests with Upgrade: websocket
are proxied to the live gateway.
Quick test (wscat)
wscat -c wss://wsapi.mintrax.exchange {"method":"getMarkets","params":{},"id":1}
wscat -c wss://wsapi.mintrax.exchange {"method":"subscribeTicker","params":{"symbol":"BTC/USDT"},"id":2}
Datetime & Number Formatting
- Timestamps are ISO8601 (UTC) like
2021-12-01T00:00:00Z
or unix ms (Number) where stated. - Prices/quantities/fees are strings for arbitrary precision (e.g.
"5.39300000"
).
Heartbeat
The server sends a ping/pong heartbeat roughly every 60s while connected.
Sequence
Subscription notifications include a monotonically increasing sequence
per symbol.
Errors
Errors follow JSON-RPC 2.0. Example:
{ "jsonrpc":"2.0", "error":{"code":10001,"message":"Invalid JSON Request"}, "id":123 }
Error Code | HTTP Code | Message | Details |
---|---|---|---|
400 | 400 | Unknown error | An unknown error occurred |
402 | 400 | Method not found | Unknown method |
403 | 401 | Forbidden | Action not allowed for account |
429 | 429 | Too many requests | Rate limited |
500 | 500 | Internal server error | Try later |
503 | 503 | Service unavailable | Try later |
504 | 504 | Gateway timeout | Try later |
1001 | 401 | Authorization required | Login first |
1002 | 401 | Authorization failed | Bad credentials |
1003 | 403 | API key forbidden | Insufficient permissions |
1004 | 401 | Unsupported auth method | Use BASIC or HS256 |
2001 | 400 | Symbol not found | Invalid market symbol |
2002 | 400 | Currency not found | Invalid ticker |
10001 | 400 | Validation error | Bad input |
20001 | 400 | Insufficient funds | Not enough balance |
20002 | 400 | Order not found | Missing order |
Global Parameters
method
– API method name (string)params
– method parameters (object)id
– echo identifier (any)
Asset Lists
getAsset (Public)
Get single asset information.
{ "method":"getAsset", "params":{"ticker":"BTC"}, "id":123 }
getAssets (Public)
Get all assets.
{ "method":"getAssets", "params":{}, "id":123 }
Market Lists
getMarket (Public)
Get single market information.
{ "method":"getMarket", "params":{"symbol":"BTC/USDT"}, "id":123 }
getMarkets (Public)
Get all markets.
{ "method":"getMarkets", "params":{}, "id":123 }
Trade History
Get trade history on a market.
Param | Type | Notes |
---|---|---|
symbol | string | e.g. ETH/BTC |
limit | number | default 100, max 1000 |
offset | number | default 0 |
sort | string | ASC or DESC (default) |
from | string (ISO) | use with till |
till | string (ISO) | use with from |
{ "method":"getTrades", "params":{"symbol":"ETH/BTC","limit":3,"offset":0,"sort":"DESC"}, "id":123 }
Subscribe to Ticker
subscribeTicker (Public)
{ "method":"subscribeTicker", "params":{"symbol":"ETH/BTC"}, "id":123 }
Notification: ticker
{ "jsonrpc":"2.0","method":"ticker", "params":{"symbol":"ETH/BTC","lastPrice":"0","lastPriceUpDown":"up","yesterdayPrice":"0","changePercent":"0","highPrice":"0","lowPrice":"0","volume":"0","bestBid":"0","bestAsk":"0","spreadPercent":"0","sequence":0} }
unsubscribeTicker
{ "method":"unsubscribeTicker", "params":{"symbol":"ETH/BTC"}, "id":123 }
Subscribe to Orderbook
subscribeOrderbook (Public)
limit
optional, default 100 per side.
{ "method":"subscribeOrderbook", "params":{"symbol":"ETH/BTC","limit":100}, "id":123 }
snapshotOrderbook
{ "jsonrpc":"2.0","method":"snapshotOrderbook", "params":{"asks":[{"price":"0.1","quantity":"1.0"}],"bids":[{"price":"0.09","quantity":"2.0"}],"symbol":"ETH/BTC","sequence":8073827} }
updateOrderbook
{ "jsonrpc":"2.0","method":"updateOrderbook", "params":{"asks":[{"price":"0.1000","quantity":"0.000"}],"bids":[],"symbol":"ETH/BTC","sequence":8073830} }
unsubscribeOrderbook
{ "method":"unsubscribeOrderbook","params":{"symbol":"ETH/BTC"},"id":123 }
Subscribe to Trades
subscribeTrades (Public)
{ "method":"subscribeTrades", "params":{"symbol":"ETH/BTC"}, "id":123 }
snapshotTrades / updateTrades
{ "jsonrpc":"2.0","method":"snapshotTrades", "params":{"data":[{"id":"abc","price":"0.054","quantity":"0.05","side":"buy","timestamp":"2022-10-19T16:33:42.821Z"}], "symbol":"ETH/BTC","sequence":0} }
{ "jsonrpc":"2.0","method":"updateTrades", "params":{"data":[{"id":"def","price":"0.055","quantity":"0.18","side":"sell","timestamp":"2022-10-19T16:34:25.041Z"}], "symbol":"ETH/BTC","sequence":0} }
unsubscribeTrades
{ "method":"unsubscribeTrades","params":{"symbol":"ETH/BTC"},"id":123 }
Subscribe to Candles
Periods (minutes): 5, 15, 30, 60, 180, 240, 480, 720, 1440
subscribeCandles (Public)
{ "method":"subscribeCandles", "params":{"symbol":"ETH/BTC","period":30}, "id":123 }
snapshotCandles / updateCandles
{ "jsonrpc":"2.0","method":"snapshotCandles", "params":{"data":[{"timestamp":"2017-10-19T15:00:00.000Z","open":"0.054801","close":"0.054625","min":"0.054601","max":"0.054894","volume":"380.750"}], "symbol":"ETH/BTC","period":30} }
{ "jsonrpc":"2.0","method":"updateCandles", "params":{"data":[{"timestamp":"2017-10-19T16:30:00.000Z","open":"0.054614","close":"0.054465","min":"0.054339","max":"0.054724","volume":"141.268"}], "symbol":"ETH/BTC","period":30} }
unsubscribeCandles
{ "method":"unsubscribeCandles","params":{"symbol":"ETH/BTC","period":30},"id":123 }
Socket Session Authentication
Private methods require login
. Two algos:
- BASIC: send public & secret key
- HS256: send public key + HMAC(secret, nonce)
login (BASIC)
{ "method":"login", "params":{"algo":"BASIC","pKey":"<PUBLIC>","sKey":"<SECRET>"}, "id":123 }
login (HS256)
{ "method":"login", "params":{"algo":"HS256","pKey":"<PUBLIC>","nonce":"N1g287gL8YOwDZr","signature":"<hex hmac256(secret,nonce)>"}, "id":123 }
Private Methods
newOrder
{ "method":"newOrder", "params":{"userProvidedId":"57d552...","symbol":"ETH/BTC","side":"sell","type":"limit","price":"0.059837","quantity":"0.015"}, "id":123 }
cancelOrder
{ "method":"cancelOrder", "params":{"userProvidedId":"57d552..."}, "id":123 }
getOrders
{ "method":"getOrders", "params":{"symbol":"BTC/USDT"}, "id":123 }
getTradingBalance
{ "method":"getTradingBalance", "params":{}, "id":123 }
subscribeReports
Snapshot of active orders then report
updates (new / trade / cancel / update).
{ "method":"subscribeReports","params":{},"id":123 }
{ "jsonrpc":"2.0","method":"activeOrders","params":[{ "...": "..." }]}
{ "jsonrpc":"2.0","method":"report","params":{"id":"...","symbol":"ETH/BTC","side":"sell","status":"New","type":"limit","price":"0.053868","quantity":"0.001"}}