[token-server] Implement typescript
Summary:
chronik-client is in typescript and has a number of specifically defined types for its output. Since this server uses chronik-client types, we should also use typescript to get the benefit of this information.
Implement typescript in this repo. Install types for modules used. Deprecate un-necessary module without type definitions (register-ip). Update syntax.
Test Plan:
npm test
ts-node index.ts and server starts
output from me doing this locally:
Express server started on port 3333 { type: 'Block', msgType: 'BLK_CONNECTED', blockHash: '00000000000000000f39c3307a459d311213708d390b9d0e230437b1c5c00d5f', blockHeight: 834086 } { type: 'Block', msgType: 'BLK_FINALIZED', blockHash: '00000000000000000f39c3307a459d311213708d390b9d0e230437b1c5c00d5f', blockHeight: 834086 }
Reviewers: #bitcoin_abc, emack
Reviewed By: #bitcoin_abc, emack
Differential Revision: https://reviews.bitcoinabc.org/D15609