HomePhabricator

[token-server] Implement typescript

Description

[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

Details

Provenance
bytesofmanAuthored on Mar 2 2024, 06:26
bytesofmanPushed on Mar 3 2024, 22:15
Reviewer
Restricted Project
Differential Revision
D15609: [token-server] Implement typescript
Parents
rABCd9a6fa264d99: [Automated] Update seeds
Branches
Unknown
Tags
Unknown