# bfx-api-node-util

> Utilities for the Bitfinex node API

Latest version **1.0.12** (published 2024-09-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install bfx-api-node-util
pnpm add bfx-api-node-util
yarn add bfx-api-node-util
bun add bfx-api-node-util
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.12 |
| Published | 2024-09-17 |
| First published | 2018-10-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=7 |
| Dependencies | 1 |
| Unpacked size | 13.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Bitfinex |
| Maintainers | bitfinexorg, vigan-abd, prdn, mafintosh |
| Keywords | bitfinex, bitcoin, BTC |

## Links

- npm: https://www.npmjs.com/package/bfx-api-node-util
- Repository: https://github.com/bitfinexcom/bfx-api-node-util
- Homepage: http://bitfinexcom.github.io/bfx-api-node-util/
- Issues: https://github.com/bitfinexcom/bfx-api-node-util/issues
- npm.io page: https://npm.io/package/bfx-api-node-util

## Dependencies (1)

- [bignumber.js](https://npm.io/package/bignumber.js.md) 9.1.2

## Recent versions

- 1.0.12 (latest) — 2024-09-17
- 1.0.11 — 2021-11-22
- 1.0.10 — 2021-07-01
- 1.0.9 — 2020-05-08
- 1.0.8 — 2019-12-03
- 1.0.7 — 2019-10-11
- 1.0.6 — 2019-10-08
- 1.0.5 — 2019-10-06
- 1.0.4 — 2019-10-02
- 1.0.3 — 2019-09-26
- 1.0.2 — 2019-07-19
- 1.0.1 — 2018-11-09
- 1.0.0 — 2018-10-12

## README

# Bitfinex API Utilities for Node.JS

[![Build Status](https://travis-ci.org/bitfinexcom/bfx-api-node-util.svg?branch=master)](https://travis-ci.org/bitfinexcom/bfx-api-node-util)

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

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

### Quickstart

```js
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`](/docs/func_docs.md) for JSDoc-generated API documentation

### Example: Padding Candles

```js
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

---
_Source: https://npm.io/package/bfx-api-node-util · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
