https://github.com/bitfinexcom/bfx-hf-util
https://github.com/bitfinexcom/bfx-hf-util
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/bitfinexcom/bfx-hf-util
- Owner: bitfinexcom
- License: apache-2.0
- Created: 2018-08-08T10:28:50.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-07-26T12:51:39.000Z (almost 5 years ago)
- Last Synced: 2025-04-11T06:14:58.710Z (about 1 year ago)
- Language: JavaScript
- Size: 86.9 KB
- Stars: 5
- Watchers: 6
- Forks: 12
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Awesome Lists containing this project
README
## Bitfinex Honey Framework Utilities
[](https://travis-ci.org/bitfinexcom/bfx-hf-util)
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
```bash
npm i --save bfx-hf-util
```
### Quickstart
```js
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`](/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
### Note
This package will be maintained only via github, please use latest relases from github instead of npm.
Example on how to install specific version from github:
```
npm i --save-prod https://github.com/bitfinexcom/bfx-hf-util.git#v1.0.11
```
Example on how to install it latest version from github:
```
npm i --save-prod https://github.com/bitfinexcom/bfx-hf-util.git
```