1.0.1 • Published 5 years ago

@strong-roots-capital/bitmex-get-last-record v1.0.1

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

bitmex-get-last-record Build status npm version codecov

Fetch the most-recent record from BitMEX, allowing for a slight publishing-delay

Tests with the /trade/bucketed endpoint show it takes ~15 seconds for BitMEX to publish a candle after session-end. This package abstracts away that (potential) wait with a Promise.

Install

npm install @strong-roots-capital/bitmex-get-last-record

Use

import bitmexGetLastRecord from '@strong-roots-capital/bitmex-get-last-record'
import Record from 'timeseries-record'

(async () => {
    const record: Record = await bitmexGetLastRecord({symbol: 'XBTUSD', binSize: '1d'})
}) ()

Related