npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bitfinex-node-api

v3.0.0

Published

Bitfinex Node.js client

Downloads

1

Readme

bitfinex-node-api CI Status npm Coverage Status Known Vulnerabilities code style: prettier semantic-release Conventional Commits NPM license node version npm downloads GitHub top language

Bitfinex Node.js library

Installation

npm install bitfinex-node-api

Usage

PublicClient1

import { PublicClient1 } from "bitfinex-node-api";
const client = new PublicClient1();
const symbol = "btcusd";
const ticker = await client.getTicker({ symbol });
const symbol = "btcusd";
const stats = await client.getStats({ symbol });
const currency = "usd";
const limit_bids = 10;
const limit_asks = 5;
const book = await client.getFundingBook({ currency, limit_bids, limit_asks });
const symbol = "btcusd";
const limit_bids = 20;
const limit_asks = 10;
const group = 1;
const book = await client.getOrderBook({
  symbol,
  limit_bids,
  limit_asks,
  group,
});
const symbol = "btcusd";
const timestamp = 1444266681;
const limit_trades = 10;
const trades = await client.getTrades({ symbol, timestamp, limit_trades });
const currency = "usd";
const timestamp = 1444266681;
const limit_lends = 10;
const lends = await client.getLends({ currency, timestamp, limit_lends });
const symbols = await client.getSymbols();
const symbolDetails = await client.getSymbolDetails();

AuthenticatedClient1

import { AuthenticatedClient1 } from "bitfinex-node-api";
const key = "BitfinexAPIKey";
const secret = "BitfinexAPISecret";
const client = new AuthenticatedClient1({ key, secret });
const info = await client.getAccountInfo();
const fees = await client.getAccountFees();
const summary = await client.getSummary();
const method = "zcash";
const wallet_name = "trading";
const renew = 1;
const result = await client.getDepositAddress({ method, wallet_name, renew });
const permissions = await client.getKeyPermissions();
const marginInformation = await client.getMarginInformation();
const balances = await client.getWalletBalances();
const amount = "1.00954735";
const currency = "BAB";
const walletfrom = "trading";
const walletto = "exchange";
const result = await client.transfer({
  amount,
  currency,
  walletfrom,
  walletto,
});
const amount = "1.0";
const address = "1DKwqRhDmVyHJDL4FUYpDmQMYA3Rsxtvur";
const walletselected = "exchange";
const withdraw_type = "bitcoin";
const result = await client.withdraw({
  amount,
  withdraw_type,
  address,
  walletselected,
});
const amount = "1";
const price = "3";
const type = "limit";
const exchange = "bitfinex";
const symbol = "ETCUSD";
const side = "buy";
const is_postonly = true;
const order = await client.newOrder({
  amount,
  price,
  type,
  exchange,
  symbol,
  side,
  is_postonly,
});
const order1 = {
  amount: "1",
  price: "3",
  type: "limit",
  exchange: "bitfinex",
  symbol: "ETCUSD",
  side: "buy",
  is_postonly: true,
};
const order2 = {
  amount: "2",
  price: "2",
  type: "limit",
  symbol: "ETCUSD",
  side: "buy",
};
const orders = [order1, order2];
const result = await client.newOrders({ orders });
const order_id = 446915287;
const order = await client.cancelOrder({ order_id });
const order_id1 = 446915287;
const order_id2 = 446915287;
const order_ids = [order_id1, order_id2];
const { result } = await client.cancelOrders({ order_ids });
const { result } = await client.cancelAllOrders();
const amount = "3";
const price = "101";
const type = "limit";
const exchange = "bitfinex";
const side = "sell";
const is_postonly = true;
const symbol = "ETCUSD";
const order_id = 1;
const order = await client.replaceOrder({
  amount,
  price,
  type,
  exchange,
  symbol,
  side,
  is_postonly,
});
const order_id = 448411153;
const order = await client.getOrder({ order_id });
const orders = await client.getOrders();
const limit = 50;
const orders = await client.getOrderHistory({ limit });
const positions = await client.getPositions();
const position_id = 943715;
const amount = "1.0";
const position = await client.claimPosition({ position_id, amount });
const currency = "USD";
const since = "1444277602.0";
const history = await client.getBalanceHistory({ currency, since });
const currency = "BTC";
const since = "1444277602.0";
const limit = 10;
const history = await client.getDepositsWithdrawals({ currency, since, limit });
const symbol = "BTCEUR";
const limit_trades = 25;
const reverse = 1;
const trades = await client.getPastTrades({ symbol, limit_trades, reverse });
const currency = "USD";
const amount = "50.0";
const rate = "20.0";
const period = 2;
const direction = "lend";
const offer = await client.newOffer({
  currency,
  amount,
  rate,
  period,
  direction,
});
const offer_id = 13800585;
const offer = await client.cancelOffer({ offer_id });
const offer_id = 13800585;
const offer = await client.offerStatus({ offer_id });
const credits = await client.activeCredits();
const offers = await client.getOffers();
const limit = 25;
const offers = await client.offersHistory({ limit });
const symbol = "USD";
const limit_trades = 1;
const until = "1444141858.0";
const trades = await client.getFundingTrades({ limit_trades, symbol, until });
const funds = await client.getTakenFunds();
const funds = await client.getUnusedFunds();
const funds = await client.getTotalFunds();
const swap_id = 11576737;
const funding = await client.closeFunding({ swap_id });
const position_id = 943715;
const response = await client.closePosition({ position_id });