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 🙏

© 2026 – Pkg Stats / Ryan Hefner

livecoin-api

v1.8.0

Published

Simple LiveCoin API Wrapper for Node.js

Downloads

31

Readme

livecoin-api

Simple LiveCoin API wrapper for Node.js

LiveCoin API documentation can be found at https://www.livecoin.net/api/common

Installation

npm install livecoin-api

Usage

const LiveCoin = require('livecoin-api');
const client = new LiveCoin('key here', 'secret here');

client.getTicker('btc', 'usd').then(console.log).catch(console.error);
client.getAllTickers().then(console.log).catch(console.error);
client.getCurrencies().then(console.log).catch(console.error);

See examples.js for more examples.

Tests

npm test

API

Table of Contents

LiveCoin

Class representing LiveCoin client

Parameters

  • apiKey (optional, default '')
  • apiSecret (optional, default '')

login

Set client's API key and secret after constructing the object

Parameters

  • apiKey string API key generated from LiveCoin
  • apiSecret string API secret generated from LiveCoin

Examples

client.login('key here', 'secret here');

getTicker

Get ticker information

Parameters

  • ticker string currency ticker
  • pair string currency being traded with

Examples

client.getTicker('btc', 'usd').then(console.log).catch(console.error);

Returns Object ticker information

getAllTickers

Get all tickers' information

Examples

client.getAllTickers().then(console.log).catch(console.error);

Returns Object all tickers' information

getLastTrades

Get information on most recent trades

Parameters

  • ticker string currency ticker
  • pair string currency being traded with
  • options Object? options for the query (optional, default {})
    • options.minOrHr boolean? if true, info from minute, else hour
    • options.type string? must be either BUY or SELL

Examples

client.getLastTrades('btc', 'usd').then(console.log);
 client.getLastTrades('eth', 'btc', {minOrHr: true}).then(console.log);

Returns Object information on most recent trades

getOrders

Get information on orders

Parameters

  • ticker string currency ticker
  • pair string currency being traded with
  • options Object? options for the query (optional, default {})
    • options.groupByPrice boolean? if true, groups by price
    • options.depth number? maximum number of orders to return

Examples

client.getOrders('btc', 'usd').then(console.log).catch(console.log);
 client.getOrders('eth', 'btc', {groupByPrice: true, depth: 4}).then(console.log);

Returns Object information on orders

getAllOrders

Get information on orders for all exchanges

Parameters

  • options Object? options for the query (optional, default {})
    • options.groupByPrice boolean? if true, groups by price
    • options.depth number? maximum number of orders to return

Examples

client.getAllOrders().then(console.log).catch(console.log);
 client.getAllOrders({groupByPrice: true, depth: 4}).then(console.log);

Returns Object information on orders for all exchanges

getBidAndAsk

Get maximum bid and minimum ask for a currency

Parameters

  • ticker string currency ticker
  • pair string currency being traded with

Examples

client.getBidAndAsk('btc', 'usd').then(console.log).catch(console.error);

Returns Object maximum bid and minimum ask

getAllBidsAndAsks

Get maximum bid and minimum ask for all currencies

Examples

client.getAllBidsAndAsks().then(console.log).catch(console.error);

Returns Object maximum bid and minimum ask for all currencies

getRestrictions

Get minimum amount to open order for all currencies

Examples

client.getRestrictions().then(console.log).catch(console.error);

Returns Object minimum amount to open order for all currencies

getCurrencies

Get minimum amount to open order for all currencies

Examples

client.getCurrencies().then(console.log).catch(console.error);

Returns Object minimum amount to open order for all currencies

getUserTrades

Get information on user's recent trades, requires API key and secret

Parameters

  • options Object? options for the query (optional, default {})
    • options.currencyPair string? exchange in the format BTC/USD
    • options.orderDesc boolean? if true, new orders will be shown first
    • options.limit number? number of items per page
    • options.offset number? page offset

Examples

client.getUserTrades({orderDesc: true, limit: 4}).then(console.log);

Returns Object information on user's trades

getClientOrders

Get information on user's orders, requires API key and secret

Parameters

  • options Object? options for the query (optional, default {})
    • options.currencyPair string? exchange in the format BTC/USD
    • options.openClosed string? type of order, e.g 'ALL' or 'OPEN'
    • options.issuedFrom number? start date in UNIX format
    • options.issuedTo number? end date in UNIX format
    • options.startRow number? sequence number of first record
    • options.endRow number? sequence number of last record

Examples

client.getClientOrders({openClosed: 'CANCELLED', startRow: 2}).then(console.log);

Returns Object information on user's orders

getUserOrder

Get order information, requires API key and secret

Parameters

  • orderId number ID of the order, e.g. 88504958

Examples

client.getUserOrder(88504958).then(console.log).catch(console.error);

Returns Object order information

getBalances

Get information on balances, requires API key and secret

Parameters

  • currency string? will return all balances if not given, e.g. USD (optional, default '')

Examples

client.getBalances().then(console.log).catch(console.error);

Returns Array<Object> information on balances

getBalance

Get information on balance for a currency, requires API key and secret

Parameters

  • currency string currency to get balance for, e.g. BTC

Examples

client.getBalance('BTC').then(console.log).catch(console.error);

Returns Object information on balances

getTransactions

Get list of transactions, requires API key and secret

Parameters

  • start string start date in UNIX format
  • end string end date in UNIX format
  • options Object? options for the query (optional, default {})
    • options.types string? type of order, e.g 'BUY' or 'DEPOSIT'
    • options.limit number? max number of results
    • options.offset number? first index

Examples

client.getTransactions('1409920436000', '1409920636000', 
 {types: 'BUY', limit: 2}).then(console.log).catch(console.error);

Returns Array<Object> list of transactions in the date range

getNumTransactions

Get number of transactions, requires API key and secret

Parameters

  • start string start date in UNIX format
  • end string end date in UNIX format
  • types

Examples

client.getNumTransactions('1409920436000', '1409920636000', 'BUY').then(console.log);

Returns number number of transactions in the date range

getTradingFee

Get customer's trading fee

Examples

client.getTradingFee().then(console.log).catch(console.error);

Returns Object trading fee

getTradingFeeAndVolume

Get customer's trading fee and volume

Examples

client.getTradingFeeAndVolume().then(console.log).catch(console.error);

Returns Object trading fee and volume

buyLimit

Make a buy limit order

Parameters

  • ticker string currency ticker
  • pair string currency being traded with
  • price number price of currency
  • quantity number amount of currency to buy

Examples

client.buyLimit('btc', 'usd', 10000, 0.1).then(console.log);

Returns Object order ID

sellLimit

Make a sell limit order

Parameters

  • ticker string currency ticker
  • pair string currency being traded with
  • price number price of currency
  • quantity number amount of currency to sell

Examples

client.sellLimit('btc', 'usd', 10000, 0.1).then(console.log);

Returns Object order ID

buyMarket

Make a buy market order

Parameters

  • ticker string currency ticker
  • pair string currency being traded with
  • quantity number amount of currency to buy

Examples

client.buyMarket('btc', 'usd', 0.1).then(console.log);

Returns Object order ID

sellMarket

Make a sell market order

Parameters

  • ticker string currency ticker
  • pair string currency being traded with
  • quantity number amount of currency to sell

Examples

client.sellMarket('btc', 'usd', 0.1).then(console.log);

Returns Object order ID

cancelLimit

Cancel order

Parameters

  • ticker string currency ticker
  • pair string currency being traded with
  • orderId number ID of order to cancel

Examples

client.cancelLimit('btc', 'usd', 1111).then(console.log);

Returns Object order ID

getAddress

Get wallet address for a currency

Parameters

Examples

client.getAddress('btc').then(console.log);

Returns Object wallet address

withdraw

Withdraw to wallet address

Parameters

Examples

client.withdraw(1, 'usd', '1MfTTxGnBBgvyk9477hWurosfqj8MZKkAG')
 .then(console.log);

Returns Object information on withdrawal

toPayeer

Withdraw to Payeer account

Parameters

  • amount number amount to withdraw
  • ticker string currency ticker
  • wallet string wallet address
  • options Object? options object (optional, default {})
    • options.protect string? protection of payment
    • options.protect_code string? protect code
    • options.protect_period number? protect period in days

Examples

client.toPayeer(1, 'usd', '1MfTTxGnBBgvyk9477hWurosfqj8MZKkAG')
 .then(console.log);

Returns Object information on withdrawal

toCapitalist

Withdraw to Capitalist account

Parameters

  • amount number amount to withdraw
  • currency string can be USD, EUR, or RUR only
  • wallet string wallet address

Examples

client.toCapitalist(1, 'USD', 'U0000001')
 .then(console.log);

Returns Object information on withdrawal

toAdvcash

Withdraw to Advcash account

Parameters

  • amount number amount to withdraw
  • currency string can be USD, EUR, or RUR only
  • wallet string wallet address

Examples

client.toAdvcash(1, 'USD', 'U123456789012')
 .then(console.log);

Returns Object information on withdrawal

toYandex

Withdraw to Yandex account

Parameters

  • amount number amount to withdraw
  • currency string can be RUR only
  • wallet string wallet address

Examples

client.toYandex(1, 'RUR', '410011234567890')
 .then(console.log);

Returns Object information on withdrawal

toQiwi

Withdraw to Qiwi account

Parameters

  • amount number amount to withdraw
  • currency string can be RUR only
  • wallet string wallet address including country code without '+'

Examples

client.toQiwi(1, 'RUR', '79036660099')
 .then(console.log);

Returns Object information on withdrawal

toBankCard

Withdraw to bank card

Parameters

  • amount number amount to withdraw
  • currency string can be USD, EUR, or RUR only
  • account string bank account number

Examples

client.toBankCard(1, 'USD', '5567025017512543', '09', '18')
 .then(console.log);

Returns Object information on withdrawal

toMastercard

Withdraw to Mastercard card

Parameters

  • amount number amount to withdraw
  • currency string can be USD or EUR only
  • cardNumber string Card number
  • cardHolder string Cardholder name
  • cardHolderCountry string Cardholder country in ISO 3166-1 alpha-2 format (e.g. RU)
  • cardHolderCity string Cardholder city
  • cardHolderDOB string Cardholder DOB in YYYY-MM-DD format
  • cardHolderMobilePhone string Cardholder phone number including country code without '+'

Examples

client.toMastercard(1, 'USD', '1234123412341234',
   'John Smith', 'US', 'Dallas', '1968-05-15', '79036660099')
 .then(console.log);

Returns Object information on withdrawal

toOkpay

Withdraw to Okpay card

Parameters

  • amount number amount to withdraw
  • currency string can be USD, EUR, or RUR only
  • wallet string account wallet
  • invoice number? optional invoice number (optional, default '')

Examples

client.toOkpay(1, 'USD', 'OK123456789')
 .then(console.log);

Returns Object information on withdrawal

toPerfectMoney

Withdraw to PerfectMoney account

Parameters

  • amount number amount to withdraw
  • ticker string currency ticker
  • wallet string wallet address
  • options Object? options object (optional, default {})
    • options.protect_code string? protect code
    • options.protect_period number? protect period in days

Examples

client.toPerfectMoney(1, 'usd', '1MfTTxGnBBgvyk9477hWurosfqj8MZKkAG')
 .then(console.log);

Returns Object information on withdrawal

makeVoucher

Creates a voucher

Parameters

  • amount number amount to withdraw
  • ticker string currency ticker
  • description string? purpose of payment (optional, default '')

Examples

client.makeVoucher(1, 'usd', 'need a voucher')
 .then(console.log);

Returns string voucher code

getVoucherAmount

Get voucher amount from voucher code

Parameters

  • voucherCode string voucher code

Examples

client.getVoucherAmount('LVC-USD-12345678-87654321-ABCDEFGI-ABCD1234')
 .then(console.log);

Returns string voucher amount

redeemVoucher

Redeem voucher from code

Parameters

  • voucherCode string voucher code

Examples

client.redeemVoucher('LVC-USD-12345678-87654321-ABCDEFGI-ABCD1234')
 .then(console.log);

Returns Object information on voucher redeeming

Contributing

Contributions welcome!

# 1. Fork the repo and clone it to your computer
$ git clone https://github.com/your-username/livecoin-api.git
$ cd livecoin-api

# 2. Connect your fork with this repo to stay up to date on any changes
$ git remote add upstream https://github.com/abhinavk99/livecoin-api.git

# 3. Make your feature branch
$ git checkout -b new-feature

# 4. Test your changes
$ npm test

# 5. Add and commit the changes you made
$ git add .
$ git commit -m "Added new feature"

# 6. Push to your branch
$ git push origin new-feature

# 7. Create a pull request on GitHub

Alternatively, feel free to open an issue.