Skip to content
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.

strong-roots-capital/bitmex-get-last-record

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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