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

futu-rx

v1.0.3

Published

Futu Open API rxjs client

Downloads

6

Readme

Futu Open API Rxjs Client

A Futu Open API client which implement the Futu Open API protocol and based on rx.js

Protocol

https://futunnopen.github.io/futu-api-doc/protocol/intro.html

Implemented Protocol

  • [x] 1001 InitConnect
  • [ ] 1002 GetGlobalState
  • [ ] 1003 Nofity
  • [x] 1004 KeepAlive
  • [x] 2001 Trd_GetAccList
  • [x] 2002 Trd_UnlockTrade
  • [ ] 2008 Trd_SubAccPush
  • [x] 2101 Trd_GetFunds
  • [ ] 2102 Trd_GetPositionList
  • [ ] 2111 Trd_GetMaxTrdQtys
  • [ ] 2201 Trd_GetOrderList
  • [x] 2202 Trd_PlaceOrder
  • [ ] 2205 Trd_ModifyOrder
  • [ ] 2208 Trd_UpdateOrder
  • [x] 2221 Trd_GetHisotryOrderList
  • [ ] 2222 Trd_GetHistoryOrderFillList
  • [ ] 2222 Trd_GetHistoryOrderFillList
  • [x] 3001 Qot_Sub
  • [x] 3002 Qot_RegQotPush
  • [x] 3003 QOt_GetSubInfo
  • [x] 3004 Qot_GetBasicQot
  • [ ] 3005 Qot_UpdateBasicQot
  • [x] 3006 Qot_GetKL
  • [ ] 3007 Qot_UpdateKL
  • [x] 3008 Qot_GetRT
  • [ ] 3009 Qot_UpdateRT
  • [ ] 3010 Qot_GetTicker
  • [ ] 3011 Qot_UpdateTicker
  • [ ] 3012 Qot_GetOrderBook
  • [ ] 3013 Qot_UpdateOrderBook
  • [x] 3103 Qot_RequestHistoryKL
  • [x] 3104 Qot_RequestHistoryKLQuota
  • [x] 3202 Qot_GetStaticInfo
  • [x] 3203 Qot_GetSecuritySnapshot

Prerequisite

Download and running Futu Opend https://futunnopen.github.io/futu-api-doc/intro/FutuOpenDGuide.html

Install

npm install futu-rx --save

Usage

const Futu = require('futu-rx');
const toArray = require('rxjs/operators').toArray;
const concatAll = require('rxjs/operators').concatAll;
const rxjs = require('rxjs');

const clientConfig = {
  host: "127.0.0.1",
  port: 11111,
  accountId: 12345678,
  pwdMD5: "25d55ad283aa400af464c76d713c07ad"
}

var futu = new Futu(clientConfig);

futu.connectionStatus().subscribe((connectionStatus) => console.log(connectionStatus));

rxjs
  .from([
    futu.initConnect(),
    futu.trdGetAccList(),
    futu.trdUnlockTrade(true),
    futu.trdGetFunds(Futu.Enum.TrdEnv.Real, Futu.Enum.TrdMarket.US),
    futu.trdGetFunds(Futu.Enum.TrdEnv.Real, Futu.Enum.TrdMarket.HK),
    futu.trdGetHistoryOrderList(Futu.Enum.TrdEnv.Real, Futu.Enum.TrdMarket.HK, Date.now() - 3600000 * 24 * 365, Date.now()),
    futu.qotGetStaticInfo([{
      market: Futu.Enum.QotTradeMarket.HK,
      code: "00700"
    }]),
    futu.qotGetSecuritySnapshot([{
      market: Futu.Enum.QotTradeMarket.HK,
      code: "00700"
    }]),
    futu.qotRequestHistoryKL({
      market: Futu.Enum.QotTradeMarket.HK,
      code: "00700"
    }, Futu.Enum.QotRehabType.None, Futu.Enum.QotKLType.Day, "2020-02-29", "2020-03-10"),
    futu.qotRequestHistoryKLQuota(true),
    futu.qotGetSubInfo(),
    futu.qotGetBasicQot([{
      market: Futu.Enum.QotTradeMarket.HK,
      code: "00700"
    }]),
    futu.qotSub([{
      market: Futu.Enum.QotTradeMarket.HK,
      code: "00700"
    }], [Futu.Enum.QotSubType.SubType_Basic], [Futu.Enum.QotRehabType.None], true, true, true),
    futu.qotRegQotPush([{
      market: Futu.Enum.QotTradeMarket.HK,
      code: "00700"
    }], [Futu.Enum.QotSubType.SubType_Basic], [Futu.Enum.QotRehabType.None], true, true),
    futu.qotGetKL(Futu.Enum.QotRehabType.Backward, Futu.Enum.QotKLType.Min_1, Futu.Enum.QotTradeMarket.HK, "00700", 10),
    futu.qotGetBasicQot([{
      market: Futu.Enum.QotTradeMarket.HK,
      code: "0700"
    }])
  ])
  .pipe(
    concatAll(),
    toArray()
  )
  .subscribe(
    (res) => {
      res.forEach((res) => console.log(JSON.stringify(res.response)))
      console.log('onNext');
    },
    (err) => console.error(err),
    () => console.log('completed')
  );