A server-sent event is when a web page automatically gets updates from a server.

Stockmind SSE

Every time a new transaction arrives to the server, a new event is throwed through SSE to all the participants involved in the transaction. This allows to update users with the new information.

Stockmind SSE endpoint

Each user has an endpoint that represents them based on the user ethereum address. This is necessary to only get events related to them.




Get SSE in javascript

EventSource can be used to get SSE from the server.

The following code shows an example:

evtSource = new EventSource(ENDPOINT);
      evtSource.onmessage = function(e) {
           /// Actions to do when a new event arrives