coinmarket

1.0.9 • Public • Published

return the ratio of the coinpair via Huobi.pro

install

npm install coinmarket -s

usage example:

  1. get btcusdt coinpair ratio
  
  
  (async ()=>{
  let res=await coinmarket.RatioCoinpair("btcusdt")
 
  
  })();
return ratio:
{ 
  open: 8231.63,
  close: 8164.16,
  low: 8076.06,
  high: 8277.12,
  amount: 10272.949423936838,
  count: 146588,
  vol: 84071659.2274929,
  symbol: 'btcusdt'
}

open =open price
close=latest price
low=lowest price
high=highest price
  1. get ethusdt coinpair ratio
  (async ()=>{
  let res=await coinmarket.RatioCoinpair("ethusdt")
 
  
  })();
  1. the input you can use like bchusdt, ltcusdt etc.

For China user:

Since the GFW block the huobi api url,so you can use below api to get the current price .

  1. get the btcusdt coinpair ratio:
    
    
    (async ()=>{
    let res=await coinmarket.RatioCoinpairBypassGFW("usdt-btc")
  
    
    })();
 

return the lastest ratio directly.

  1. you can get the bch,eth like the input format: usdt-bch, usdt-eth.

Readme

Keywords

Package Sidebar

Install

npm i coinmarket

Weekly Downloads

1

Version

1.0.9

License

ISC

Unpacked Size

3.04 kB

Total Files

6

Last publish

Collaborators

  • mydoors