ConnectionClosed
We are using external proxy service called CloudFlare. To deliver best and reliable services our provider is changing routing policy few times per day. This might cause instantaneous lost of connection on WebSocket channel. We recommend to consider and solve such situations at the beginning of developing own application.
Secured Websocket URI:
wss://api.zondacrypto.exchange/websocket/
To perform a valid private subscription, you need to send: action subscribe-private, module, path and required authentication parameters to the endpoint. Required format is JSON.
To cancell subscription - just send action unsubscribe with previous module and path. This will close all active channels.
Required parameters for authenctication:
Key | Description |
---|---|
hashSignature | HMAC("SHA512", public_key + current_timestamp, private_key) |
publicKey | Public API key. |
requestTimestamp | Current time in Unix Timestamp. |
{
"action": "subscribe-private",
"module": "trading",
"path": "offers",
"hashSignature": "8892f16e0713c5f3e3d7e9fa26c5a5f2817b09fc48fece72ed5712ae33547c92e91e735b1818397136beea760efae61d1449a93e48ee2f80789dfa24830ef720",
"publicKey": "12345f6f-1b1d-1234-a973-a10b1bdba1a1",
"requestTimestamp": 1529897422
}
{
"action": "unsubscribe",
"module": "trading",
"path": "offer",
}
{
"error": "Authentication failed"
}
Snapshot
Some of the endpoints allows to catch a snapshot.
In this case we need to use action proxy to specific module and path.
In private connection also additional parameters are required:
- requestId - UUID value of our request
- queryString - optional - query string, required only in specified endpoints
{
"requestId": "78539fe0-e9b0-4e4e-8c86-70b36aa93d4f",
"action": "proxy",
"module": "trading",
"path": "history/transactions",
"queryString": "markets=BTC-PLN&rateFrom=23000",
"hashSignature": "8892f16e0713c5f3e3d7e9fa26c5a5f2817b09fc48fece72ed5712ae33547c92e91e735b1818397136beea760efae61d1449a93e48ee2f80789dfa24830ef720",
"publicKey": "12345f6f-1b1d-1234-a973-a10b1bdba1a1",
"requestTimestamp": 1529897422
}
{
"requestId": "78539fe0-e9b0-4e4e-8c86-70b36aa93d4f",
"statusCode": 200,
"body": {
"status": "Ok",
"totalRows": "31503",
"items": [
{
"id": "d0e4746b-288e-4869-8107-d8277fcf4b9d",
"market": "BTC-PLN",
"time": "1529670604532",
"amount": "0.01281693",
"rate": "23572.84",
"initializedBy": "Sell",
"wasTaker": false,
"userAction": "Buy"
}
],
"query": {
"markets": [
"BTC-PLN"
],
"limit": [],
"offset": [],
"fromTime": [],
"toTime": [],
"initializedBy": [],
"rateFrom": 2300,
"rateTo": [],
"userAction": [],
"nextPageCursor": [
"start"
]
},
"nextPageCursor": "QW9ON3cvcjk2T0lDUHdWallXVTRPRFV3WWkwelpUQTVMVFEyTXpndFlqVmtOQzA1TldJeU56RmxOR1U0WWpZL0kxc2lSVlJJTFZCTVRpSXNJakUxTWpNNU5ERXhNREkyTlRFaUxDSmpZV1U0T0RVd1lpMHpaVEE1TFRRMk16Z3RZalZrTkMwNU5XSXlOekZsTkdVNFlqWWlYUT09"
}
}