Just a small thing for consideration; events like "finalized" look like:
{
"event": "finalized",
"block": {
"hash": "0x...",
"index": "2"
}
}
The "index" is a string, not a number. Given that we never expect indexes to be particularly huge (certainly not outside what JS can interpret as a number), should we just return the integer instead?
Consistency is a reason for doing so, eg with this event on the same subscription, numPeers is an integer, not a string:
{
"event": "broadcasted",
"numPeers": ...
}
What's your preference?