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

bitbns

v3.0.36

Published

Bitbns Offical Node Module to trade

Downloads

179

Readme

Bitbns Node API

This project is designed to assist you make your own projects that interact with the Bitbns API. This project seeks to have complete API coverage.

Use Node Version 8.1.0+ Download NodeJs Installer

After the installation is completed, you can verify the version of Node.js installed:
node -v
v8.1.1
You can also check the version of npm installed:
npm -v
5.0.3

Alternative Method : Click Here

  • USDT market = 0.1 USDT
  • INR market = 10 INR

const instance1 = new bitbnsApi({ // ... });

const instance2 = new bitbnsApi({ // ... });

Explanation of fields: highest_buy_bid -> top entry of buy order book lowest_sell_bid -> top entry of sell order book last_traded_price -> price at which the last trade had happened

Explanation of fields: type -> type of action typeI -> action id amount -> the amount deposited date -> the time at which this event occured unit -> the symbol name of coin factor -> the division factor del_btc -> delta changes in normal wallet of coin del_inr -> delta changes in normal inr wallet delh_btc -> delta changes in hold wallet of coin

0 -> page no. (use pagination to fetch older deposit history)

Explanation of fields: type -> type of action typeI -> action id amt -> the amount deposited date -> the time at which this event occured unit -> the symbol name of coin factor -> the division factor id -> source of deposit

0 -> page no. (use pagination to fetch older deposit history)

Explanation of fields: type -> type of action typeI -> action id amt -> the amount deposited date -> the time at which this event occured unit -> the symbol name of coin factor -> the division factor id -> source of withdrawal

Explanation of fields: entry_id -> the unique id assigned to the order btc -> the volume of the coin rate -> the rate at which the order was placed time -> the timestamp at which the order was placed type -> 1 for sell and 0 for buy order status -> -1 for cancelled , 0 for not processed , 1 for partially executed, 2 for fully executed

Explanation of fields: entry_id -> the unique id assigned to the order btc -> the volume of the coin rate -> the rate at which the order was placed t_rate -> the trigger rate at which the order was placed time -> the timestamp at which the order was placed type -> 1 for sell and 0 for buy order status -> -1 for cancelled , 0 for not processed , 1 for partially executed, 2 for fully executed

Explanation of fields: token -> the token address expiry -> the time till which this address is user's valid address

Explanation of fields: token -> the token address tag -> the tag to be used for the token Deposits would not be valid unless you specify the tag

Explanation of fields: data -> Just a custom message id -> the unique id of the order

Explanation of fields: data -> Just a custom message id -> the unique id of the order

Explanation of fields: data -> Just a custom message id -> the unique id of the order

40 -> Quantity 24 -> Rate 24.5 -> Trigger rate

Explanation of fields: data -> Just a custom message id -> the unique id of the order

15 -> Quantity 76 -> Rate 77.5 -> Trigger rate 0.5 -> trail value

Explanation of fields: data -> Just a custom message id -> the unique id of the order

40 -> Quantity 24 -> Rate 24.5 -> Trigger rate

Explanation of fields: data -> Just a custom message id -> the unique id of the order

15 -> Quantity 80 -> Rate 78.5 -> Trigger rate 0.5 -> trail value

Explanation of fields: data -> Just a custom message id -> the unique id of the order

Explanation of fields: data -> just a custom message status -> status of cancellation 1 for success

Explanation of fields: rate -> the amount of the order btc -> the volume of the coin for that order

Explanation of fields: rate -> the amount of the order btc -> the volume of the coin for that order

{ rate: 478854.18, btc: 642042 },
{ rate: 478749.87, btc: 208356 },
{ rate: 478511.87, btc: 2446067 },
{ rate: 478000, btc: 80253706 },
{ rate: 477900, btc: 6261808 },
{ rate: 477777, btc: 208900000 },
{ rate: 477740, btc: 15000000 },
{ rate: 477706.19, btc: 5003424 } ],

status: 1, error: null }

Explanation of fields: rate -> the amount of the order btc -> the volume of the coin for that order

Explanation of fields: rate -> the amount of the order btc -> the volume of the coin for that order

Use symbol as XRPUSDT for fetching executed orders of USDT market. Just coin name, XRP, will return trades of INR market

Explanation of fields: type -> type of action typeI -> action id amount -> the amount deposited date -> the time at which this event occured unit -> the symbol name of coin factor -> the division factor del_btc -> delta changes in normal wallet of coin del_inr -> delta changes in normal inr wallet delh_btc -> delta changes in hold wallet of coin

Explanation of fields: entry_id -> the unique id for the order btc -> the volume of the currency placed rate -> the rate at which the order is placed time -> the timestamp of the entry type -> 0 for buy and 1 for sell status -> -1 for cancelled, 0 for not processed, 1 for partially executed, 2 for fully executed

Explanation of fields: data -> the custom message status -> for successful request the status is 1

side -> BUY or SELL symbol -> COIN NAME, quantity -> QUANTITY, rate -> RATE, target_rate -> TARGET RATE, t_rate -> TRRIGER RATE, trail_rate -> TRAIL RATE

To Place Simple Buy or Sell Order use rate To Place Stoploss Buy or Sell Order use rate & t_rate To Place Bracket Buy or Sell Order use rate , t_rate, target_rate & trail_rate

Explanation of fields: data -> the custom message status -> for successful request the status is 1 id -> the unique id of the order

bitbns.cancelOrders({ symbol : 'XRP', side : 'cancelOrder', entry_id : 462 }, function(error, data) { console.log(error, data); });

side -> "cancelOrder","cancelStopLossOrder", "usdtcancelOrder", "usdtcancelStopLossOrder" symbol -> COIN NAME entry_id : ENTRY ID

Explanation of fields: data -> the custom message status -> for successful request the status is 1

side -> BUY or SELL symbol -> COIN NAME(use suffix "_USDT" with coin name) quantity -> QUANTITY, rate -> RATE, target_rate -> TARGET RATE, t_rate -> TRRIGER RATE, trail_rate -> TRAIL RATE

To Place Simple Buy or Sell Order use rate To Place Stoploss Buy or Sell Order use rate & t_rate To Place Bracket Buy or Sell Order use rate , t_rate, target_rate & trail_rate

Explanation of fields: data -> the custom message status -> for successful request the status is 1 id -> the unique id of the order

bitbns.cancelOrders({ symbol : 'TRX_USDT', side : 'usdtcancelOrder', entry_id : 462 }, function(error, data) { console.log(error, data); });

side -> "cancelOrder","cancelStopLossOrder", "usdtcancelOrder", "usdtcancelStopLossOrder" symbol -> COIN NAME(use suffix "_USDT" with coin name) entry_id : ENTRY ID

Explanation of fields: data -> the custom message status -> for successful request the status is 1

bitbns.getOrders({ side : 'usdtListOpenOrders', symbol : 'TRX_USDT', page : 0 }, function(error, data) { console.log(data) });

side -> "listOpenOrders", "listOpenStopOrders", "listOpenBracketOrders", "usdtListOpenBracketOrders", "usdtListOpenStopOrders","usdtListOpenOrders" symbol -> COIN NAME(use suffix "_USDT" with coin name) page -> INTEGER

Explanation of fields: rate -> the amount of the order btc -> the volume of the coin for that order type -> 1 for sell and 0 for buy order status -> for successful request the status is 1

const socket = bitbns.getOrderBookSocket('BTC', 'INR')

socket.on('connect', () => console.log('Connected'))

socket.on('news', res => { try { const data = JSON.parse(res) console.log('Data Received') console.log(data) } catch (e) { console.log('Error in the Stream', e) } })

socket.on('disconnect', () => console.log('Disconnected'))

const socket = bitbns.getTickerSocket('INR')

socket.on('connect', () => console.log('Connected'))

socket.on('ticker', res => { try { const data = JSON.parse(JSON.stringify(res)) console.log('Data Received') console.log(data) } catch (e) { console.log('Error in the Stream', e) } })

socket.on('disconnect', () => console.log('Disconnected'))

Pass USDT as market to get ticks of USDT market

bitbns.getTokenSocket(function(error, response){ if(!error){

let token = response.data; const socket = bitbns.getExecutedOrders(token);

socket.on('connect', () => console.log('Connected'))

socket.on('delta_data', res => { try { console.log(data) } catch (e) { console.log('Error in the Stream', e) } })

socket.on('disconnect', () => console.log('Disconnected'))

} else { console.log('Error ::', error); }

})

here: BTC -> coin name INR -> market (INR or USDT) 0 -> page no (use pagination to fetch older data)

Explanation of fields: data -> just a custom message status -> status of cancellation 1 for success

side -> placeOrder type -> BORROW or LEND days -> 1,3,7,15,30 renew -> 0,1,2 symbol -> COIN NAME, qnty -> QUANTITY, rate -> RATE

Renew Flags => 0 - Don't renew, 1 -> Renew only Principal, 2 -> Renew with Principal + Interest

Explanation of fields: error -> the custom message status -> for successful request the status is 1

Pass id of the margin transaction you are looking to cancel symbol -> COIN NAME,

Explanation of fields: error -> the custom message status -> for successful request the status is 1

amt -> Amount to settle

Pass id of the margin transaction you are looking to settle and amt you want to settle

Explanation of fields: error -> the custom message status -> for successful request the status is 1

},function(error, data) { console.log(data) });

Pass id of the margin transaction you are looking to settle

Explanation of fields: error -> the custom message status -> for successful request the status is 1

type => LEND or BORROW

Explanation of fields: data -> the custom message worth_required -> the amount required to maintain the margin worth_current -> current worth of margin borrwoed margin_taken -> the amount value borrowed expiry -> time of expiry of margin margin_to_return -> amount to be returned. days -> number of days the margin was borrowed or lent. interest -> intreset of margin per day. amt -> the amount of coins lent error -> the custom message status -> for successful request the status is 1

Explanation of fields: data -> the custom message entry_id -> the unique id assigned to the order days -> number of days lent or borrowed btc -> the volume of the coin type -> 1 for borrow and 0 for lend order rate -> the rate at which the margin is lend or borrowed status -> for successful request the status is 1

type => LEND or BORROW

Explanation of fields: data -> the custom message days -> number of days lent or borrowed btc -> the volume of the coin rate -> the rate at which the margin is lend or borrowed status -> for successful request the status is 1

Explanation of fields: data -> the custom message status -> for successful request the status is 1 error -> error message if any

Explanation of fields: data -> the custom message status -> for successful request the status is 1 error -> error message if any

You can choose to not include fip_id in case you want to get all FIP transactions in process

Explanation of fields: data -> the custom message status -> for successful request the status is 1 error -> error message if any

Explanation of fields: data -> the custom message status -> for successful request the status is 1 error -> error message if any

Explanation of fields: data -> the custom message status -> for successful request the status is 1 error -> error message if any

Explanation of fields: data -> the custom message status -> for successful request the status is 1 error -> error message if any

Explanation of fields: data -> the custom message status -> for successful request the status is 1 error -> error message if any id -> order id

Explanation of fields: data -> the custom message status -> for successful request the status is 1 error -> error message if any id -> order id

Explanation of fields: data -> the custom message status -> for successful request the status is 1 error -> error message if any id -> order id

Explanation of fields: data -> the custom message status -> for successful request the status is 1 error -> error message if any id -> order id

Explanation of fields: data -> the custom message status -> for successful request the status is 1 error -> error message if any

Explanation of fields: data -> the custom message status -> for successful request the status is 1 error -> error message if any

Explanation of fields: data -> the custom message status -> for successful request the status is 1 error -> error message if any