Initializing a Websocket
The authentication procedure for TDN is the same as for the rest of our WebSocket API. To learn how to connect and authenticate a websocket, visit the WebSocket API documentation page. If you do not have a Blocknative account and API key, signup at Mempool Explorer.
Example initialization payload:
{
"timeStamp": "2022-05-05T01:00:00.000Z",
"dappId": "<YOUR_API_KEY>", // find this at https://explorer.blocknative.com/account
"version": "1",
"blockchain": {
"system": "ethereum",
"network": "rinkeby"
},
"categoryCode": "initialize",
"eventCode": "checkDappId"
}
Example initialization response payload:
{
"version": 0,
"serverVersion": "0.135.1",
"timeStamp": "2022-05-05T00:45:51.080Z",
"connectionId": "d7-a160f698-9366-4ee1-851d-e2cc88651f57",
"status": "ok",
"raw": "{\"timeStamp\":\"2022-05-05T00:45:49.932Z\",\"dappId\":\<your api key>,\"version\":\"1\",\"blockchain\":{\"system\":\"ethereum\",\"network\":\"rinkeby\"},\"categoryCode\":\"ini
tialize\",\"eventCode\":\"checkDappId\"}",
"event": {
"timeStamp": "2022-05-05T00:45:49.932Z",
"dappId": "<YOUR_API_KEY>",
"version": "1",
"blockchain": {
"system": "ethereum",
"network": "rinkeby"
},
"categoryCode": "initialize",
"eventCode": "checkDappId"
},
"reason": ""
}
Copy link