3.0.36 • Published 1 year ago

bitbns v3.0.36

Weekly downloads
8
License
MIT
Repository
github
Last release
1 year ago

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

3.0.36

1 year ago

3.0.34

2 years ago

3.0.35

2 years ago

3.0.32

2 years ago

3.0.33

2 years ago

3.0.30

2 years ago

3.0.31

2 years ago

3.0.23

2 years ago

3.0.21

2 years ago

3.0.22

2 years ago

3.0.27

2 years ago

3.0.28

2 years ago

3.0.25

2 years ago

3.0.26

2 years ago

3.0.20

2 years ago

3.0.18

3 years ago

3.0.16

3 years ago

3.0.17

3 years ago

3.0.15

3 years ago

3.0.14

3 years ago

3.0.13

3 years ago

3.0.12

4 years ago

3.0.11

4 years ago

3.0.10

4 years ago

3.0.6

4 years ago

3.0.5

4 years ago

3.0.4

4 years ago

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago