JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 16
  • Score
    100M100P100Q74227F
  • License Apache-2.0

HF utilities

Package Exports

  • bfx-hf-util
  • bfx-hf-util/lib/catch_uncaught_errors

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bfx-hf-util) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Bitfinex Honey Framework Utilities

Build Status

This library hosts a set of utility functions used throughout the Bitfinex Honey Framework & API Libraries.

Features

  • Logic for processing Bitfinex candle data
  • Helper for catching uncaught errors (require('bfx-hf-util/lib/catch_uncaught_errors))

Installation

npm i --save bfx-hf-util

Quickstart

const { preprocessRemoteCandles } = require('bfx-hf-util')
const { RESTv2 } = require('bfx-api-node-rest')

const rest = new RESTv2()
const candles = await rest.candles({
  timeframe: '1m',
  symbol: 'tBTCUSD',
  query: {
    start: Date.now() - (24 * 60 * 60 * 1000),
    end: Date.now(),
    sort: 1,
  }
})

// Fill in empty candles to generate a consistent dataset
const processedCandles = preprocessRemoteCandles('1m', candles)

// Do something with data
processCandles.forEach(candle => console.log(JSON.stringify(candle)))

Docs

For JSDoc-generated API documentation, refer to docs/api.md

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request