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 🙏

© 2024 – Pkg Stats / Ryan Hefner

edonctp

v1.0.0

Published

ctp lib based on nodejs

Downloads

62

Readme

warning

目前仅支持linux64和win64平台(win32平台未测试,理论上支持)

支持的nodejs版本: 8.x.x, 如: 8.16.1 (8以上版本不被支持)

compile

windows平台需要安装编译工具:npm install --global --production windows-build-tools

执行脚本:

npm run rebuild 或 yarn rebuild

execute

run example

node ./example/ctpapp.js

Example

请参看example

version

适配看穿式监管库, 实配的库版本: 6.3.15_20190220、v6.3.15_P2_mdapi_se_20190403 (实现了ctp所有的接口, 其中包含客户端认证及组播接口)

可能遇到的报错问题

执行 yarn build 命令时可能会遇到node.lib文件损坏的情况, 此时可去官网下载node.lib文件替换, 下载地址:[https://nodejs.org/dist/latest-v8.x/win-x64/node.lib]

API

  WrapTd {}:
      - getApiVersion
      - init
      - release
      - dispose
      - createFtdcTraderApi
      - getTradingDay
      - registerFront
      - registerNameServer
      - registerFensUserInfo
      - subscribePrivateTopic
      - subscribePublicTopic
      - reqAuthenticate
      - reqUserLogin
      - reqUserLogout
      - reqUserPasswordUpdate
      - reqTradingAccountPasswordUpdate
      - reqOrderInsert
      - reqParkedOrderInsert
      - reqParkedOrderAction
      - reqOrderAction
      - reqQueryMaxOrderVolume
      - reqSettlementInfoConfirm
      - reqRemoveParkedOrder
      - reqRemoveParkedOrderAction
      - reqExecOrderInsert
      - reqExecOrderAction
      - reqForQuoteInsert
      - reqQuoteInsert
      - reqQuoteAction
      - reqBatchOrderAction
      - reqCombActionInsert
      - reqQryOrder
      - reqQryTrade
      - reqQryInvestorPosition
      - reqQryTradingAccount
      - reqQryInvestor
      - reqQryTradingCode
      - reqQryInstrumentMarginRate
      - reqQryInstrumentCommissionRate
      - reqQryExchange
      - reqQryProduct
      - reqQryInstrument
      - reqQryDepthMarketData
      - reqQrySettlementInfo
      - reqQryTransferBank
      - reqQryInvestorPositionDetail
      - reqQryNotice
      - reqQrySettlementInfoConfirm
      - reqQryCFMMCTradingAccountKey
      - reqQryEWarrantOffset
      - reqQryInvestorProductGroupMargin
      - reqQryExchangeMarginRate
      - reqQryExchangeMarginRateAdjust
      - reqQryExchangeRate
      - reqQrySecAgentACIDMap
      - reqQryProductExchRate
      - reqQryProductGroup
      - reqQryMMInstrumentCommissionRate
      - reqQryMMOptionInstrCommRate
      - reqQryInstrumentOrderCommRate
      - reqQryOptionInstrTradeCost
      - reqQryOptionInstrCommRate
      - reqQryExecOrder
      - reqQryForQuote
      - reqQryQuote
      - reqQryCombInstrumentGuard
      - reqQryCombAction
      - reqQryTransferSerial
      - reqQryAccountregister
      - reqQryContractBank
      - reqQryParkedOrder
      - reqQryParkedOrderAction
      - reqQryTradingNotice
      - reqQryBrokerTradingParams
      - reqQryBrokerTradingAlgos
      - reqQueryCFMMCTradingAccountToken
      - reqFromBankToFutureByFuture
      - reqFromFutureToBankByFuture
      - reqQueryBankAccountMoneyByFuture
      - reqQryInvestorPositionCombineDetail
      - registerUserSystemInfo
      - submitUserSystemInfo
      - reqUserAuthMethod
      - reqGenUserCaptcha
      - reqGenUserText
      - reqUserLoginWithCaptcha
      - reqUserLoginWithText
      - reqUserLoginWithOTP
      - reqQrySecAgentTradeInfo
      - reqQrySecAgentTradingAccount
      - reqQrySecAgentCheckMode
      - on
    
    callback events:
      - FrontConnected
      - FrontDisconnected
      - HeartBeatWarning
      - RspAuthenticate
      - RspUserLogin
      - RspUserLogout
      - RspUserPasswordUpdate
      - RspTradingAccountPasswordUpdate
      - RspOrderInsert
      - RspParkedOrderInsert
      - RspParkedOrderAction
      - RspOrderAction
      - RspQueryMaxOrderVolume
      - RspSettlementInfoConfirm
      - RspRemoveParkedOrder
      - RspRemoveParkedOrderAction
      - RspExecOrderInsert
      - RspExecOrderAction
      - RspForQuoteInsert
      - RspQuoteInsert
      - RspQuoteAction
      - RspBatchOrderAction
      - RspCombActionInsert
      - RspQryOrder
      - RspQryTrade
      - RspQryInvestorPosition
      - RspQryTradingAccount
      - RspQryInvestor
      - RspQryTradingCode
      - RspQryInstrumentMarginRate
      - RspQryInstrumentCommissionRate
      - RspQryExchange
      - RspQryProduct
      - RspQryInstrument
      - RspQryDepthMarketData
      - RspQrySettlementInfo
      - RspQryTransferBank
      - RspQryInvestorPositionDetail
      - RspQryNotice
      - RspQrySettlementInfoConfirm
      - RspQryInvestorPositionCombineDetail
      - RspQryCFMMCTradingAccountKey
      - RspQryEWarrantOffset
      - RspQryInvestorProductGroupMargin
      - RspQryExchangeMarginRate
      - RspQryExchangeMarginRateAdjust
      - RspQryExchangeRate
      - RspQrySecAgentACIDMap
      - RspQryProductExchRate
      - RspQryProductGroup
      - RspQryMMInstrumentCommissionRate
      - RspQryMMOptionInstrCommRate
      - RspQryInstrumentOrderCommRate
      - RspQryOptionInstrTradeCost
      - RspQryOptionInstrCommRate
      - RspQryExecOrder
      - RspQryForQuote
      - RspQryQuote
      - RspQryCombInstrumentGuard
      - RspQryCombAction
      - RspQryTransferSerial
      - RspQryAccountregister
      - RspError
      - RtnOrder
      - RtnTrade
      - ErrRtnOrderInsert
      - ErrRtnOrderAction
      - RtnInstrumentStatus
      - RtnBulletin
      - RtnTradingNotice
      - RtnErrorConditionalOrder
      - RtnExecOrder
      - ErrRtnExecOrderInsert
      - ErrRtnExecOrderAction
      - ErrRtnForQuoteInsert
      - RtnQuote
      - ErrRtnQuoteInsert
      - ErrRtnQuoteAction
      - RtnForQuoteRsp
      - RtnCFMMCTradingAccountToken
      - ErrRtnBatchOrderAction
      - RtnCombAction
      - ErrRtnCombActionInsert
      - RspQryContractBank
      - RspQryParkedOrder
      - RspQryParkedOrderAction
      - RspQryTradingNotice
      - RspQryBrokerTradingParams
      - RspQryBrokerTradingAlgos
      - RspQueryCFMMCTradingAccountToken
      - RtnFromBankToFutureByBank
      - RtnFromFutureToBankByBank
      - RtnRepealFromBankToFutureByBank
      - RtnRepealFromFutureToBankByBank
      - RtnFromBankToFutureByFuture
      - RtnFromFutureToBankByFuture
      - RtnRepealFromBankToFutureByFutureManual
      - RtnRepealFromFutureToBankByFutureManual
      - RtnQueryBankBalanceByFuture
      - ErrRtnBankToFutureByFuture
      - ErrRtnFutureToBankByFuture
      - ErrRtnRepealBankToFutureByFutureManual
      - ErrRtnRepealFutureToBankByFutureManual
      - ErrRtnQueryBankBalanceByFuture
      - RtnRepealFromBankToFutureByFuture
      - RtnRepealFromFutureToBankByFuture
      - RspFromBankToFutureByFuture
      - RspFromFutureToBankByFuture
      - RspQueryBankAccountMoneyByFuture
      - RtnOpenAccountByBank
      - RtnCancelAccountByBank
      - RtnChangeAccountByBank
      // 穿透式监管新增响应事件
      - RspUserAuthMethod
      - RspGenUserCaptcha
      - RspGenUserText
      - RspQrySecAgentTradeInfo
      - RspQrySecAgentTradingAccount
      - RspQrySecAgentCheckMode

  WrapMd {}:
      - init
      - release
      - dispose
      - createFtdcMdApi
      - getApiVersion
      - getTradingDay
      - registerFront
      - registerNameServer
      - registerFensUserInfo
      - reqUserLogin
      - reqUserLogout
      - subscribeMarketData
      - unSubscribeMarketData
      - subscribeForQuoteRsp
      - unSubscribeForQuoteRsp
      - reqQryMulticastInstrument
      - on
  
    callback events:
      - FrontConnected
      - FrontDisconnected
      - HeartBeatWarning
      - RspUserLogin
      - RspUserLogout
      - RspQryMulticastInstrument
      - RspError
      - RspSubMarketData
      - RspUnSubMarketData
      - RspSubForQuoteRsp
      - RspUnSubForQuoteRsp
      - RtnDepthMarketData
      - RtnForQuoteRsp

适配Nan

参考 https://github.com/octalmage/robotjs/pull/523/files