How to use bitfinex-api-node - 4 common examples

To help you get started, we’ve selected a few bitfinex-api-node examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dutu / poloLender / server / workers / poloLender / poloLender.js View on Github external
};
  let rateBTCUSD;
	let advisorInfo = {};
	let clientMessage = {};
	let liveData = {
	  activeLoans: [],
    openOffers: [],
  };

	let config = {};
	self.config = config;
	let apiCallTimes = [];
	let waitOneMinute = null;
	let callsLast100 = [];

	let bfxPublic = new Bitfinex(null, null, { version: 1, autoOpen: false }).rest;
  let poloPublic = new Poloniex();

  let _debugApiCallDuration = _.bind(debugApiCallDuration, this);
  let _debugCycleDuration = _.bind(debugCycleDuration, this);

  const isWriteAllowed = function isWriteAllowed(cliendId) {
    let authClient = _.find(authClients, { id: cliendId });
    return authClient && authClient.isReadWriteAllowed;
  };

  const isReadAllowed = function isReadAllowed(cliendId) {
    let authClient = _.find(authClients, { id: cliendId });
    return authClient && authClient.isReadAllowed;
  };

  const authClientsEmit = function authClientsEmit() {
github magic8bot / magic8bot / legacy / exchanges / bitfinex / index.ts View on Github external
function wsClient() {
    if (!ws_client) {
      if (!conf.bitfinex || !conf.bitfinex.key || conf.bitfinex.key === 'YOUR-API-KEY') {
        throw new Error('please configure your Bitfinex credentials in ' + path.resolve(__dirname, 'conf.js'))
      }
      ws_connecting = true
      ws_connected = false

      ws_client = new BFX(conf.bitfinex.key, conf.bitfinex.secret, { version: 2, transform: true }).ws

      ws_client
        .on('open', wsOpen)
        .on('close', wsClose)
        .on('error', wsError)
        .on('subscribed', wsSubscribed)
        .on('message', wsMessage)
        .on('trade', wsUpdateTrades)
        .on('ticker', wsUpdateTicker)
        .on('ws', updateWallet)
        .on('wu', updateWallet)
        .on('on', wsUpdateOrder)
        .on('on-req', wsUpdateReqOrder)
        .on('ou', wsUpdateOrder)
        .on('oc', wsUpdateOrderCancel)
        .on('miu', marginSymbolWebsocket)
github magic8bot / magic8bot / legacy / exchanges / bitfinex / index.ts View on Github external
function publicClient() {
    if (!public_client) public_client = new BFX(null, null, { version: 2, transform: true }).rest
    return public_client
  }
github askmike / gekko / exchange / wrappers / bitfinex.js View on Github external
var Trader = function(config) {
  _.bindAll(this);
  if(_.isObject(config)) {
    this.key = config.key;
    this.secret = config.secret;
  }
  this.name = 'Bitfinex';
  this.balance;
  this.price;
  this.asset = config.asset;
  this.currency = config.currency;
  this.pair = this.asset + this.currency;
  this.bitfinex = new Bitfinex.RESTv1({apiKey: this.key, apiSecret: this.secret, transform: true});

  this.interval = 4000;
}

bitfinex-api-node

Node reference library for Bitfinex API

MIT
Latest version published 2 months ago

Package Health Score

68 / 100
Full package analysis

Popular bitfinex-api-node functions