Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

bfx-api-node-util

bitfinexcom1.5kMIT1.0.12

Utilities for the Bitfinex node API

bitfinex, bitcoin, BTC

readme

Bitfinex API Utilities for Node.JS

Build Status

This repo contains minor utilities shared by the Bitfinex Node.JS API libraries.

Features

  • prepareAmount and preparePrice for making values API-compatible
  • nonce generator function
  • padCandles for handling gaps in candle data returned by the Bitfinex APIs

Installation

npm i --save bfx-api-node-util

Quickstart

const { nonce } = require('bfx-api-node-util')
const n = nonce()

// n is ready to be passed to API requests, or used as order CIDs, etc

Docs

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 required

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

changelog

1.0.12

  • meta: update deps to latest versions

1.0.11

  • meta: fix dependency versions

1.0.10

  • meta: cleanup babel and lodash from package

1.0.9

  • meta: bump bignumber.js dep to 9.0.0

1.0.8

  • nonce: add parallel support

1.0.7

  • docs: create/update

1.0.6

  • remove function res_notification_info
  • fix circular dep error

1.0.5

  • add function res_notification_info

1.0.3

  • meta: add github issue/pr templates
  • meta: standardize travis config
  • meta: add example

1.0.2

  • refactor: add 1000 multiplier to nonce
  • refactor: use nonce method in gen_auth_sig
  • manifest: bump deps
  • manifest: update contributors

1.0.1

  • meta: populate README.md
  • manifest: add babel build for browser compatibility

1.0.0

  • Initial version