Skip to content

Commit

Permalink
fix: add a hack to handle upbit long numeric id for trades
Browse files Browse the repository at this point in the history
  • Loading branch information
thaaddeus committed May 7, 2024
1 parent 00de259 commit 2665ab3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/replay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ export async function* replay<T extends Exchange, U extends boolean = false, Z e
if (exchange.startsWith('huobi-') && messageString.includes('.trade.detail')) {
messageString = messageString.replace(/"id":([0-9]+),/g, '"id":"$1",')
}
// hack to handle upbit long numeric id for trades
if (exchange === 'upbit' && messageString.includes('sequential_id')) {
messageString = messageString.replace(/"sequential_id":([0-9]+),/g, '"sequential_id":"$1",')
}

const message = JSON.parse(messageString)

const localTimestampString = localTimestampBuffer.toString()
Expand Down

0 comments on commit 2665ab3

Please sign in to comment.