New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

huobi-trade

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

huobi-trade

trade for huobi market marker

latest
Source
npmnpm
Version
1.0.5
Version published
Maintainers
2
Created
Source

火币交易api

主要是HB_REST和HB_WS 对象

常用的WS

const HBOBJ = require('huobi-trade')
const {HB_REST , HB_WS} = HBOBJ
HB_WS.initWs(`{
    "sub": "market.btcusdt.kline.5min",
    "id": "id1"
  }`,function(data){
      console.log(data)
  })

常用的REST

async function test(){
const res =  await HB_REST.getCommonSymbols()
console.log(res)
}
test()

###CONFIG 需要写入CONFIG

  const config = {
    REST_URL:'http://api.huobi.pro',
    WS2_URL:'wss://api.huobi.pro/ws/v1',
    WS_URL:'wss://api.huobi.pro/ws',
    API_AK:'XXXXXX-XXXXXX-XXXXXX-XXXXXX',
    API_SK:'XXXXXX-XXXXXX-XXXXXX-XXXXXX',
    ACCOUNT_ID:'XXXXXX',
    DEFAULT_HEADERS : {
        "Content-Type": "application/json",
        "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36"
    }
}

NOW SUPPORT MORE RESTFULL API

APIDESCRIBTION
getCommonSymbols获取所有的交易对
getAllCurrencys获取所有币种
getCurrentTime获取当前系统时间
getHistoryKline获取历史kline数据
getTicker获取聚合行情数据
getAllTickers所有交易对的最新Tickers
getDepth指定交易对的当前市场深度数据
getLastestTrade指定交易对最新的一个交易记录
getHistoryTrade指定交易对近期的所有交易记录
get24hMarket最近24小时行情数据
getAccount获取accountInfo
getBalance查询指定账户的余额
postOrder下单
cancelOrder取消订单
getUndoneOrders查询已提交但是仍未完全成交或未被撤销的订单
cancelListOrders发送批量撤销订单
getOrderDetail查询已提交但是仍未完全成交或未被撤销的订单
getHistoryOrders接口基于搜索条件查询历史订单
get48hHistoryOrders口基于搜索条件查询最近48小时内历史订单

Keywords

huobi

FAQs

Package last updated on 11 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts