Variable heartbeat$Const

heartbeat$: Observable<Heartbeat.Update> = ...

You can call .subscribe() on this RxJS Observable

   import { PrivateWs } from 'ts-kraken';

let lastHeartbeatTs: number = null;
const maxSecondsWithoutHeartbeat = 10;
PrivateWs.heartbeat$.subscribe(() => {
const now = new Date().getTime();
if (lastHeartbeatTs) {
const diff = (now - lastHeartbeatTs) / 1000;
if (diff > maxSecondsWithoutHeartbeat) {
throw `heartbeat timed out after ${maxSecondsWithoutHeartbeat} seconds`;
}
}
lastHeartbeatTs = now;
});