API Documentation
API Documentation

WebSocket Overview

The Brave New Coin Websocket API exposes GWA / MWA data and XchangeFeed data via Websockets. 


Clients need to send a subscribe message to authenticate and start receiving data. See XchangeFeedGWA / MWA.


A sample project using the BNC Websocket API is available on Github :

Node.js


Connection URL

All websocket connections require authentication. For more information see -


Authentication

All websocket connections require authentication. For more information see -

Common Message Types

Websocket messages have an event field to identify them


Connection Message

Once the client connection is successful, the server will send back a connection message





{  
           "event" :"CONNECTED",   
           "timestamp" :"2018-09-05T01:34:39Z" 
}

Ping Message

Clients or server can send a ping request to check if the connection is active. Clients are expected to implement a ping response. The server may terminate the connection if the client does not respond to ping from the server.

Request

{  
     "event": "PING"
 }

Response

{   
    "event": "PONG",   "timestamp": "2018-09-05T01:34:39Z" 
}