Package Exports
- bfx-api-node-util-remove-babel
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-api-node-util-remove-babel) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Bitfinex API Utilities for Node.JS
This repo contains minor utilities shared by the Bitfinex Node.JS API libraries.
Features
prepareAmountandpreparePricefor making values API-compatiblenoncegenerator functionpadCandlesfor handling gaps in candle data returned by the Bitfinex APIs
Installation
npm i --save bfx-api-node-utilQuickstart
const { nonce } = require('bfx-api-node-util')
const n = nonce()
// n is ready to be passed to API requests, or used as order CIDs, etcDocs
Refer to docs/func_docs.md for JSDoc-generated API documentation
Example: Padding Candles
const { padCandles } = require('bfx-api-node-util')
const { RESTv2 } = require('bfx-api-node-rest')
const rest = new RESTv2()
const candles = await rest.candles({
symbol: 'tBTCUSD',
timeframe: '1m',
})
const paddedCandles = padCandles(candles, 60 * 1000)
// paddedCandles are ready to be used for processing where 0-volume candles are requiredContributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request