fix: Convert Heartbeat to Scala

Signed-off-by: Jussi Virtanen <jussi.virtanen@valotrading.com>
fix: Convert Logout to Scala

Signed-off-by: Jussi Virtanen <jussi.virtanen@valotrading.com>