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

huobi-trade

v1.0.5

Published

trade for huobi market marker

Readme

火币交易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

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