An unofficial implementation of the Bitfinex REST APIs written in TypeScript.
# npm
npm i --save @taichunmin/bitfinex
# yarn
yarn add @taichunmin/bitfinex
const { Bitfinex } = require('@taichunmin/bitfinex')
// For public endpoints
console.log(await Bitfinex.v2PlatformStatus())
// { status: 1 }
// For authenticated endpoints
const bitfinex = new Bitfinex({ apiKey: 'apiKey', apiSecret: 'apiSecret' })
console.log(await bitfinex.v2AuthReadPermissions())
/* {
account: { read: false, write: false },
history: { read: true, write: false },
orders: { read: false, write: false },
positions: { read: false, write: false },
funding: { read: true, write: true },
settings: { read: false, write: false },
wallets: { read: true, write: false },
withdraw: { read: false, write: false },
ui_withdraw: { read: false, write: false },
bfxpay: { read: false, write: false },
eaas_agreement: { read: false, write: false },
eaas_withdraw: { read: false, write: false },
eaas_deposit: { read: false, write: false },
eaas_brokerage: { read: false, write: false }
} */
I make multiple parallel request and I receive an error that the nonce is too small. What does it mean?
Nonces are used to guard against replay attacks. When multiple HTTP requests arrive at the API with the wrong nonce, e.g. because of an async timing issue, the API will reject the request.
If you need to go parallel, you have to use multiple API keys right now.