UNPKG

futu-api

Version:

Futu Websocket API for Node.js

2,117 lines (2,114 loc) 232 kB
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ "use strict"; var $protobuf = require("protobufjs/light"); var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $protobuf.Root())) .addJSON({ Common: { options: { java_package: "com.futu.openapi.pb", go_package: "github.com/futuopen/ftapi4go/pb/common" }, nested: { RetType: { values: { RetType_Succeed: 0, RetType_Failed: -1, RetType_TimeOut: -100, RetType_DisConnect: -200, RetType_Unknown: -400, RetType_Invalid: -500 } }, PacketEncAlgo: { values: { PacketEncAlgo_FTAES_ECB: 0, PacketEncAlgo_None: -1, PacketEncAlgo_AES_ECB: 1, PacketEncAlgo_AES_CBC: 2 } }, PacketID: { fields: { connID: { rule: "required", type: "uint64", id: 1 }, serialNo: { rule: "required", type: "uint32", id: 2 } } }, ProtoFmt: { values: { ProtoFmt_Protobuf: 0, ProtoFmt_Json: 1 } }, UserAttribution: { values: { UserAttribution_Unknown: 0, UserAttribution_NN: 1, UserAttribution_MM: 2, UserAttribution_SG: 3, UserAttribution_AU: 4, UserAttribution_JP: 5, UserAttribution_HK: 6 } }, ProgramStatusType: { values: { ProgramStatusType_None: 0, ProgramStatusType_Loaded: 1, ProgramStatusType_Loging: 2, ProgramStatusType_NeedPicVerifyCode: 3, ProgramStatusType_NeedPhoneVerifyCode: 4, ProgramStatusType_LoginFailed: 5, ProgramStatusType_ForceUpdate: 6, ProgramStatusType_NessaryDataPreparing: 7, ProgramStatusType_NessaryDataMissing: 8, ProgramStatusType_UnAgreeDisclaimer: 9, ProgramStatusType_Ready: 10, ProgramStatusType_ForceLogout: 11, ProgramStatusType_DisclaimerPullFailed: 12 } }, ProgramStatus: { fields: { type: { rule: "required", type: "ProgramStatusType", id: 1 }, strExtDesc: { type: "string", id: 2 } } }, Session: { values: { Session_NONE: 0, Session_RTH: 1, Session_ETH: 2, Session_ALL: 3, Session_OVERNIGHT: 4 } } } }, GetDelayStatistics: { options: { java_package: "com.futu.openapi.pb", go_package: "github.com/futuopen/ftapi4go/pb/getdelaystatistics" }, nested: { DelayStatisticsType: { values: { DelayStatisticsType_Unkonw: 0, DelayStatisticsType_QotPush: 1, DelayStatisticsType_ReqReply: 2, DelayStatisticsType_PlaceOrder: 3 } }, QotPushStage: { values: { QotPushStage_Unkonw: 0, QotPushStage_SR2SS: 1, QotPushStage_SS2CR: 2, QotPushStage_CR2CS: 3, QotPushStage_SS2CS: 4, QotPushStage_SR2CS: 5 } }, QotPushType: { values: { QotPushType_Unkonw: 0, QotPushType_Price: 1, QotPushType_Ticker: 2, QotPushType_OrderBook: 3, QotPushType_Broker: 4 } }, C2S: { fields: { typeList: { rule: "repeated", type: "int32", id: 1, options: { packed: false } }, qotPushStage: { type: "int32", id: 2 }, segmentList: { rule: "repeated", type: "int32", id: 3, options: { packed: false } } } }, DelayStatisticsItem: { fields: { begin: { rule: "required", type: "int32", id: 1 }, end: { rule: "required", type: "int32", id: 2 }, count: { rule: "required", type: "int32", id: 3 }, proportion: { rule: "required", type: "float", id: 4 }, cumulativeRatio: { rule: "required", type: "float", id: 5 } } }, DelayStatistics: { fields: { qotPushType: { rule: "required", type: "int32", id: 1 }, itemList: { rule: "repeated", type: "DelayStatisticsItem", id: 2 }, delayAvg: { rule: "required", type: "float", id: 3 }, count: { rule: "required", type: "int32", id: 4 } } }, ReqReplyStatisticsItem: { fields: { protoID: { rule: "required", type: "int32", id: 1 }, count: { rule: "required", type: "int32", id: 2 }, totalCostAvg: { rule: "required", type: "float", id: 3 }, openDCostAvg: { rule: "required", type: "float", id: 4 }, netDelayAvg: { rule: "required", type: "float", id: 5 }, isLocalReply: { rule: "required", type: "bool", id: 6 } } }, PlaceOrderStatisticsItem: { fields: { orderID: { rule: "required", type: "string", id: 1 }, totalCost: { rule: "required", type: "float", id: 2 }, openDCost: { rule: "required", type: "float", id: 3 }, netDelay: { rule: "required", type: "float", id: 4 }, updateCost: { rule: "required", type: "float", id: 5 } } }, S2C: { fields: { qotPushStatisticsList: { rule: "repeated", type: "DelayStatistics", id: 1 }, reqReplyStatisticsList: { rule: "repeated", type: "ReqReplyStatisticsItem", id: 2 }, placeOrderStatisticsList: { rule: "repeated", type: "PlaceOrderStatisticsItem", id: 3 } } }, Request: { fields: { c2s: { rule: "required", type: "C2S", id: 1 } } }, Response: { fields: { retType: { rule: "required", type: "int32", id: 1, options: { "default": -400 } }, retMsg: { type: "string", id: 2 }, errCode: { type: "int32", id: 3 }, s2c: { type: "S2C", id: 4 } } } } }, GetGlobalState: { options: { java_package: "com.futu.openapi.pb", go_package: "github.com/futuopen/ftapi4go/pb/getglobalstate" }, nested: { C2S: { fields: { userID: { rule: "required", type: "uint64", id: 1 } } }, S2C: { fields: { marketHK: { rule: "required", type: "int32", id: 1 }, marketUS: { rule: "required", type: "int32", id: 2 }, marketSH: { rule: "required", type: "int32", id: 3 }, marketSZ: { rule: "required", type: "int32", id: 4 }, marketHKFuture: { rule: "required", type: "int32", id: 5 }, marketUSFuture: { type: "int32", id: 15 }, marketSGFuture: { type: "int32", id: 17 }, marketJPFuture: { type: "int32", id: 18 }, qotLogined: { rule: "required", type: "bool", id: 6 }, trdLogined: { rule: "required", type: "bool", id: 7 }, serverVer: { rule: "required", type: "int32", id: 8 }, serverBuildNo: { rule: "required", type: "int32", id: 9 }, time: { rule: "required", type: "int64", id: 10 }, localTime: { type: "double", id: 11 }, programStatus: { type: "Common.ProgramStatus", id: 12 }, qotSvrIpAddr: { type: "string", id: 13 }, trdSvrIpAddr: { type: "string", id: 14 }, connID: { type: "uint64", id: 16 } } }, Request: { fields: { c2s: { rule: "required", type: "C2S", id: 1 } } }, Response: { fields: { retType: { rule: "required", type: "int32", id: 1, options: { "default": -400 } }, retMsg: { type: "string", id: 2 }, errCode: { type: "int32", id: 3 }, s2c: { type: "S2C", id: 4 } } } } }, Qot_Common: { options: { java_package: "com.futu.openapi.pb", go_package: "github.com/futuopen/ftapi4go/pb/qotcommon" }, nested: { QotMarket: { values: { QotMarket_Unknown: 0, QotMarket_HK_Security: 1, QotMarket_HK_Future: 2, QotMarket_US_Security: 11, QotMarket_CNSH_Security: 21, QotMarket_CNSZ_Security: 22, QotMarket_SG_Security: 31, QotMarket_JP_Security: 41, QotMarket_AU_Security: 51, QotMarket_MY_Security: 61, QotMarket_CA_Security: 71, QotMarket_FX_Security: 81 } }, SecurityType: { values: { SecurityType_Unknown: 0, SecurityType_Bond: 1, SecurityType_Bwrt: 2, SecurityType_Eqty: 3, SecurityType_Trust: 4, SecurityType_Warrant: 5, SecurityType_Index: 6, SecurityType_Plate: 7, SecurityType_Drvt: 8, SecurityType_PlateSet: 9, SecurityType_Future: 10 } }, PlateSetType: { values: { PlateSetType_All: 0, PlateSetType_Industry: 1, PlateSetType_Region: 2, PlateSetType_Concept: 3, PlateSetType_Other: 4 } }, WarrantType: { values: { WarrantType_Unknown: 0, WarrantType_Buy: 1, WarrantType_Sell: 2, WarrantType_Bull: 3, WarrantType_Bear: 4, WarrantType_InLine: 5 } }, OptionType: { values: { OptionType_Unknown: 0, OptionType_Call: 1, OptionType_Put: 2 } }, IndexOptionType: { values: { IndexOptionType_Unknown: 0, IndexOptionType_Normal: 1, IndexOptionType_Small: 2 } }, OptionAreaType: { values: { OptionAreaType_Unknown: 0, OptionAreaType_American: 1, OptionAreaType_European: 2, OptionAreaType_Bermuda: 3 } }, QotMarketState: { values: { QotMarketState_None: 0, QotMarketState_Auction: 1, QotMarketState_WaitingOpen: 2, QotMarketState_Morning: 3, QotMarketState_Rest: 4, QotMarketState_Afternoon: 5, QotMarketState_Closed: 6, QotMarketState_PreMarketBegin: 8, QotMarketState_PreMarketEnd: 9, QotMarketState_AfterHoursBegin: 10, QotMarketState_AfterHoursEnd: 11, QotMarketState_FUTU_SWITCH_DATE: 12, QotMarketState_NightOpen: 13, QotMarketState_NightEnd: 14, QotMarketState_FutureDayOpen: 15, QotMarketState_FutureDayBreak: 16, QotMarketState_FutureDayClose: 17, QotMarketState_FutureDayWaitForOpen: 18, QotMarketState_HkCas: 19, QotMarketState_FutureNightWait: 20, QotMarketState_FutureAfternoon: 21, QotMarketState_FutureSwitchDate: 22, QotMarketState_FutureOpen: 23, QotMarketState_FutureBreak: 24, QotMarketState_FutureBreakOver: 25, QotMarketState_FutureClose: 26, QotMarketState_StibAfterHoursWait: 27, QotMarketState_StibAfterHoursBegin: 28, QotMarketState_StibAfterHoursEnd: 29, QotMarketState_CLOSE_AUCTION: 30, QotMarketState_AFTERNOON_END: 31, QotMarketState_NIGHT: 32, QotMarketState_OVERNIGHT_BEGIN: 33, QotMarketState_OVERNIGHT_END: 34, QotMarketState_TRADE_AT_LAST: 35, QotMarketState_TRADE_AUCTION: 36, QotMarketState_OVERNIGHT: 37 } }, TradeDateMarket: { values: { TradeDateMarket_Unknown: 0, TradeDateMarket_HK: 1, TradeDateMarket_US: 2, TradeDateMarket_CN: 3, TradeDateMarket_NT: 4, TradeDateMarket_ST: 5, TradeDateMarket_JP_Future: 6, TradeDateMarket_SG_Future: 7 } }, TradeDateType: { values: { TradeDateType_Whole: 0, TradeDateType_Morning: 1, TradeDateType_Afternoon: 2 } }, RehabType: { values: { RehabType_None: 0, RehabType_Forward: 1, RehabType_Backward: 2 } }, KLType: { values: { KLType_Unknown: 0, KLType_1Min: 1, KLType_Day: 2, KLType_Week: 3, KLType_Month: 4, KLType_Year: 5, KLType_5Min: 6, KLType_15Min: 7, KLType_30Min: 8, KLType_60Min: 9, KLType_3Min: 10, KLType_Quarter: 11 } }, KLFields: { values: { KLFields_None: 0, KLFields_High: 1, KLFields_Open: 2, KLFields_Low: 4, KLFields_Close: 8, KLFields_LastClose: 16, KLFields_Volume: 32, KLFields_Turnover: 64, KLFields_TurnoverRate: 128, KLFields_PE: 256, KLFields_ChangeRate: 512 } }, SubType: { values: { SubType_None: 0, SubType_Basic: 1, SubType_OrderBook: 2, SubType_Ticker: 4, SubType_RT: 5, SubType_KL_Day: 6, SubType_KL_5Min: 7, SubType_KL_15Min: 8, SubType_KL_30Min: 9, SubType_KL_60Min: 10, SubType_KL_1Min: 11, SubType_KL_Week: 12, SubType_KL_Month: 13, SubType_Broker: 14, SubType_KL_Qurater: 15, SubType_KL_Year: 16, SubType_KL_3Min: 17 } }, TickerDirection: { values: { TickerDirection_Unknown: 0, TickerDirection_Bid: 1, TickerDirection_Ask: 2, TickerDirection_Neutral: 3 } }, TickerType: { values: { TickerType_Unknown: 0, TickerType_Automatch: 1, TickerType_Late: 2, TickerType_NoneAutomatch: 3, TickerType_InterAutomatch: 4, TickerType_InterNoneAutomatch: 5, TickerType_OddLot: 6, TickerType_Auction: 7, TickerType_Bulk: 8, TickerType_Crash: 9, TickerType_CrossMarket: 10, TickerType_BulkSold: 11, TickerType_FreeOnBoard: 12, TickerType_Rule127Or155: 13, TickerType_Delay: 14, TickerType_MarketCenterClosePrice: 15, TickerType_NextDay: 16, TickerType_MarketCenterOpening: 17, TickerType_PriorReferencePrice: 18, TickerType_MarketCenterOpenPrice: 19, TickerType_Seller: 20, TickerType_T: 21, TickerType_ExtendedTradingHours: 22, TickerType_Contingent: 23, TickerType_AvgPrice: 24, TickerType_OTCSold: 25, TickerType_OddLotCrossMarket: 26, TickerType_DerivativelyPriced: 27, TickerType_ReOpeningPriced: 28, TickerType_ClosingPriced: 29, TickerType_ComprehensiveDelayPrice: 30, TickerType_Overseas: 31 } }, DarkStatus: { values: { DarkStatus_None: 0, DarkStatus_Trading: 1, DarkStatus_End: 2 } }, SecurityStatus: { values: { SecurityStatus_Unknown: 0, SecurityStatus_Normal: 1, SecurityStatus_Listing: 2, SecurityStatus_Purchasing: 3, SecurityStatus_Subscribing: 4, SecurityStatus_BeforeDrakTradeOpening: 5, SecurityStatus_DrakTrading: 6, SecurityStatus_DrakTradeEnd: 7, SecurityStatus_ToBeOpen: 8, SecurityStatus_Suspended: 9, SecurityStatus_Called: 10, SecurityStatus_ExpiredLastTradingDate: 11, SecurityStatus_Expired: 12, SecurityStatus_Delisted: 13, SecurityStatus_ChangeToTemporaryCode: 14, SecurityStatus_TemporaryCodeTradeEnd: 15, SecurityStatus_ChangedPlateTradeEnd: 16, SecurityStatus_ChangedCodeTradeEnd: 17, SecurityStatus_RecoverableCircuitBreaker: 18, SecurityStatus_UnRecoverableCircuitBreaker: 19, SecurityStatus_AfterCombination: 20, SecurityStatus_AfterTransation: 21 } }, HolderCategory: { values: { HolderCategory_Unknow: 0, HolderCategory_Agency: 1, HolderCategory_Fund: 2, HolderCategory_SeniorManager: 3 } }, PushDataType: { values: { PushDataType_Unknow: 0, PushDataType_Realtime: 1, PushDataType_ByDisConn: 2, PushDataType_Cache: 3 } }, SortField: { values: { SortField_Unknow: 0, SortField_Code: 1, SortField_CurPrice: 2, SortField_PriceChangeVal: 3, SortField_ChangeRate: 4, SortField_Status: 5, SortField_BidPrice: 6, SortField_AskPrice: 7, SortField_BidVol: 8, SortField_AskVol: 9, SortField_Volume: 10, SortField_Turnover: 11, SortField_Amplitude: 30, SortField_Score: 12, SortField_Premium: 13, SortField_EffectiveLeverage: 14, SortField_Delta: 15, SortField_ImpliedVolatility: 16, SortField_Type: 17, SortField_StrikePrice: 18, SortField_BreakEvenPoint: 19, SortField_MaturityTime: 20, SortField_ListTime: 21, SortField_LastTradeTime: 22, SortField_Leverage: 23, SortField_InOutMoney: 24, SortField_RecoveryPrice: 25, SortField_ChangePrice: 26, SortField_Change: 27, SortField_StreetRate: 28, SortField_StreetVol: 29, SortField_WarrantName: 31, SortField_Issuer: 32, SortField_LotSize: 33, SortField_IssueSize: 34, SortField_UpperStrikePrice: 45, SortField_LowerStrikePrice: 46, SortField_InLinePriceStatus: 47, SortField_PreCurPrice: 35, SortField_AfterCurPrice: 36, SortField_PrePriceChangeVal: 37, SortField_AfterPriceChangeVal: 38, SortField_PreChangeRate: 39, SortField_AfterChangeRate: 40, SortField_PreAmplitude: 41, SortField_AfterAmplitude: 42, SortField_PreTurnover: 43, SortField_AfterTurnover: 44, SortField_LastSettlePrice: 48, SortField_Position: 49, SortField_PositionChange: 50 } }, Issuer: { values: { Issuer_Unknow: 0, Issuer_SG: 1, Issuer_BP: 2, Issuer_CS: 3, Issuer_CT: 4, Issuer_EA: 5, Issuer_GS: 6, Issuer_HS: 7, Issuer_JP: 8, Issuer_MB: 9, Issuer_SC: 10, Issuer_UB: 11, Issuer_BI: 12, Issuer_DB: 13, Issuer_DC: 14, Issuer_ML: 15, Issuer_NM: 16, Issuer_RB: 17, Issuer_RS: 18, Issuer_BC: 19, Issuer_HT: 20, Issuer_VT: 21, Issuer_KC: 22, Issuer_MS: 23, Issuer_GJ: 24, Issuer_XZ: 25, Issuer_HU: 26, Issuer_KS: 27, Issuer_CI: 28 } }, IpoPeriod: { values: { IpoPeriod_Unknow: 0, IpoPeriod_Today: 1, IpoPeriod_Tomorrow: 2, IpoPeriod_Nextweek: 3, IpoPeriod_Lastweek: 4, IpoPeriod_Lastmonth: 5 } }, PriceType: { values: { PriceType_Unknow: 0, PriceType_Outside: 1, PriceType_WithIn: 2 } }, WarrantStatus: { values: { WarrantStatus_Unknow: 0, WarrantStatus_Normal: 1, WarrantStatus_Suspend: 2, WarrantStatus_StopTrade: 3, WarrantStatus_PendingListing: 4 } }, CompanyAct: { values: { CompanyAct_None: 0, CompanyAct_Split: 1, CompanyAct_Join: 2, CompanyAct_Bonus: 4, CompanyAct_Transfer: 8, CompanyAct_Allot: 16, CompanyAct_Add: 32, CompanyAct_Dividend: 64, CompanyAct_SPDividend: 128, CompanyAct_SpinOff: 256 } }, QotRight: { values: { QotRight_Unknow: 0, QotRight_Bmp: 1, QotRight_Level1: 2, QotRight_Level2: 3, QotRight_SF: 4, QotRight_No: 5 } }, PriceReminderType: { values: { PriceReminderType_Unknown: 0, PriceReminderType_PriceUp: 1, PriceReminderType_PriceDown: 2, PriceReminderType_ChangeRateUp: 3, PriceReminderType_ChangeRateDown: 4, PriceReminderType_5MinChangeRateUp: 5, PriceReminderType_5MinChangeRateDown: 6, PriceReminderType_VolumeUp: 7, PriceReminderType_TurnoverUp: 8, PriceReminderType_TurnoverRateUp: 9, PriceReminderType_BidPriceUp: 10, PriceReminderType_AskPriceDown: 11, PriceReminderType_BidVolUp: 12, PriceReminderType_AskVolUp: 13, PriceReminderType_3MinChangeRateUp: 14, PriceReminderType_3MinChangeRateDown: 15 } }, PriceReminderFreq: { values: { PriceReminderFreq_Unknown: 0, PriceReminderFreq_Always: 1, PriceReminderFreq_OnceADay: 2, PriceReminderFreq_OnlyOnce: 3 } }, AssetClass: { values: { AssetClass_Unknow: 0, AssetClass_Stock: 1, AssetClass_Bond: 2, AssetClass_Commodity: 3, AssetClass_CurrencyMarket: 4, AssetClass_Future: 5, AssetClass_Swap: 6 } }, ExpirationCycle: { values: { ExpirationCycle_Unknown: 0, ExpirationCycle_Week: 1, ExpirationCycle_Month: 2, ExpirationCycle_MonthEnd: 3, ExpirationCycle_Quarter: 4, ExpirationCycle_WeekMon: 11, ExpirationCycle_WeekTue: 12, ExpirationCycle_WeekWed: 13, ExpirationCycle_WeekThu: 14, ExpirationCycle_WeekFri: 15 } }, OptionStandardType: { values: { OptionStandardType_Unknown: 0, OptionStandardType_Standard: 1, OptionStandardType_NonStandard: 2 } }, OptionSettlementMode: { values: { OptionSettlementMode_Unknown: 0, OptionSettlementMode_AM: 1, OptionSettlementMode_PM: 2 } }, ExchType: { values: { ExchType_Unknown: 0, ExchType_HK_MainBoard: 1, ExchType_HK_GEMBoard: 2, ExchType_HK_HKEX: 3, ExchType_US_NYSE: 4, ExchType_US_Nasdaq: 5, ExchType_US_Pink: 6, ExchType_US_AMEX: 7, ExchType_US_Option: 8, ExchType_US_NYMEX: 9, ExchType_US_COMEX: 10, ExchType_US_CBOT: 11, ExchType_US_CME: 12, ExchType_US_CBOE: 13, ExchType_CN_SH: 14, ExchType_CN_SZ: 15, ExchType_CN_STIB: 16, ExchType_SG_SGX: 17, ExchType_JP_OSE: 18 } }, PeriodType: { values: { PeriodType_Unknown: 0, PeriodType_INTRADAY: 1, PeriodType_DAY: 2, PeriodType_WEEK: 3, PeriodType_MONTH: 4 } }, PriceReminderMarketStatus: { values: { PriceReminderMarketStatus_Unknow: 0, PriceReminderMarketStatus_Open: 1, PriceReminderMarketStatus_USPre: 2, PriceReminderMarketStatus_USAfter: 3, PriceReminderMarketStatus_USOverNight: 4 } }, Security: { fields: { market: { rule: "required", type: "int32", id: 1 }, code: { rule: "required", type: "string", id: 2 } } }, KLine: { fields: { time: { rule: "required", type: "string", id: 1 }, isBlank: { rule: "required", type: "bool", id: 2 }, highPrice: { type: "double", id: 3 }, openPrice: { type: "double", id: 4 }, lowPrice: { type: "double", id: 5 }, closePrice: { type: "double", id: 6 }, lastClosePrice: { type: "double", id: 7 }, volume: { type: "int64", id: 8 }, turnover: { type: "double", id: 9 }, turnoverRate: { type: "double", id: 10 }, pe: { type: "double", id: 11 }, changeRate: { type: "double", id: 12 }, timestamp: { type: "double", id: 13 } } }, OptionBasicQotExData: { fields: { strikePrice: { rule: "required", type: "double", id: 1 }, contractSize: { rule: "required", type: "int32", id: 2 }, contractSizeFloat: { type: "double", id: 17 }, openInterest: { rule: "required", type: "int32", id: 3 }, impliedVolatility: { rule: "required", type: "double", id: 4 }, premium: { rule: "required", type: "double", id: 5 }, delta: { rule: "required", type: "double", id: 6 }, gamma: { rule: "required", type: "double", id: 7 }, vega: { rule: "required", type: "double", id: 8 }, theta: { rule: "required", type: "double", id: 9 }, rho: { rule: "required", type: "double", id: 10 }, netOpenInterest: { type: "int32", id: 11 }, expiryDateDistance: { type: "int32", id: 12 }, contractNominalValue: { type: "double", id: 13 }, ownerLotMultiplier: { type: "double", id: 14 }, optionAreaType: { type: "int32", id: 15 }, contractMultiplier: { type: "double", id: 16 }, indexOptionType: { type: "int32", id: 18 } } }, PreAfterMarketData: { fields: { price: { type: "double", id: 1 }, highPrice: { type: "double", id: 2 }, lowPrice: { type: "double", id: 3 }, volume: { type: "int64", id: 4 }, turnover: { type: "double", id: 5 }, changeVal: { type: "double", id: 6 }, changeRate: { type: "double", id: 7 }, amplitude: { type: "double", id: 8 } } }, FutureBasicQotExData: { fields: { lastSettlePrice: { rule: "required", type: "double", id: 1 }, position: { rule: "required", type: "int32", id: 2 }, positionChange: { rule: "required", type: "int32", id: 3 }, expiryDateDistance: { type: "int32", id: 4 } } }, WarrantBasicQotExData: { fields: { delta: { type: "double", id: 1 }, impliedVolatility: { type: "double", id: 2 }, premium: { rule: "required", type: "double", id: 3 } } }, BasicQot: { fields: { security: { rule: "required", type: "Security", id: 1 }, name: { type: "string", id: 24 }, isSuspended: { rule: "required", type: "bool", id: 2 }, listTime: { rule: "required", type: "string", id: 3 }, priceSpread: { rule: "required", type: "double", id: 4 }, updateTime: { rule: "required", type: "string", id: 5 }, highPrice: { rule: "required", type: "double", id: 6 }, openPrice: { rule: "required", type: "double", id: 7 }, lowPrice: { rule: "required", type: "double", id: 8 }, curPrice: { rule: "required", type: "double", id: 9 }, lastClosePrice: { rule: "required", type: "double", id: 10 }, volume: { rule: "required", type: "int64", id: 11 }, turnover: { rule: "required", type: "double", id: 12 }, turnoverRate: { rule: "required", type: "double", id: 13 }, amplitude: { rule: "required", type: "double", id: 14 }, darkStatus: { type: "int32", id: 15 }, optionExData: { type: "OptionBasicQotExData", id: 16 }, listTimestamp: { type: "double", id: 17 }, updateTimestamp: { type: "double", id: 18 }, preMarket: { type: "PreAfterMarketData", id: 19 }, afterMarket: { type: "PreAfterMarketData", id: 20 }, secStatus: { type: "int32", id: 21 }, futureExData: { type: "FutureBasicQotExData", id: 22 }, warrantExData: { type: "WarrantBasicQotExData", id: 23 }, overnight: { type: "PreAfterMarketData", id: 25 } } }, TimeShare: { fields: { time: { rule: "required", type: "string", id: 1 }, minute: { rule: "required", type: "int32", id: 2 }, isBlank: { rule: "required", type: "bool", id: 3 }, price: { type: "double", id: 4 }, lastClosePrice: { type: "double", id: 5 }, avgPrice: { type: "double", id: 6 }, volume: { type: "int64", id: 7 }, turnover: { type: "double", id: 8 }, timestamp: { type: "double", id: 9 } } }, SecurityStaticBasic: { fields: { security: { rule: "required", type: "Qot_Common.Security", id: 1 }, id: { rule: "required", type: "int64", id: 2 }, lotSize: { rule: "required", type: "int32", id: 3 }, secType: { rule: "required", type: "int32", id: 4 }, name: { rule: "required", type: "string", id: 5 }, listTime: { rule: "required", type: "string", id: 6 }, delisting: { type: "bool", id: 7 }, listTimestamp: { type: "double", id: 8 }, exchType: { type: "int32", id: 9 } } }, WarrantStaticExData: { fields: { type: { rule: "required", type: "int32", id: 1 }, owner: { rule: "required", type: "Qot_Common.Security", id: 2 } } }, OptionStaticExData: { fields: { type: { rule: "required", type: "int32", id: 1 }, owner: { rule: "required", type: "Qot_Common.Security", id: 2 }, strikeTime: { rule: "required", type: "string", id: 3 }, strikePrice: { rule: "required", type: "double", id: 4 }, suspend: { rule: "required", type: "bool", id: 5 }, market: { rule: "required", type: "string", id: 6 }, strikeTimestamp: { type: "double", id: 7 }, indexOptionType: { type: "int32", id: 8 }, expirationCycle: { type: "int32", id: 9 }, optionStandardType: { type: "int32", id: 10 }, optionSettlementMode: { type: "int32", id: 11 } } }, FutureStaticExData: { fields: { lastTradeTime: { rule: "required", type: "string", id: 1 }, lastTradeTimestamp: { type: "double", id: 2 }, isMainContract: { rule: "required", type: "bool", id: 3 } } }, SecurityStaticInfo: { fields: { basic: { rule: "required", type: "SecurityStaticBasic", id: 1 }, warrantExData: { type: "WarrantStaticExData", id: 2 }, optionExData: { type: "OptionStaticExData", id: 3 }, futureExData: { type: "FutureStaticExData", id: 4 } } }, Broker: { fields: { id: { rule: "required", type: "int64", id: 1 }, name: { rule: "required", type: "string", id: 2 }, pos: { rule: "required", type: "int32", id: 3 }, orderID: { type: "int64", id: 4 }, volume: { type: "int64", id: 5 } } }, Ticker: { fields: { time: { rule: "required", type: "string", id: 1 }, sequence: { rule: "required", type: "int64", id: 2 }, dir: { rule: "required", type: "int32", id: 3 }, price: { rule: "required", type: "double", id: 4 }, volume: { rule: "required", type: "int64", id: 5 }, turnover: { rule: "required", type: "double", id: 6 }, recvTime: { type: "double", id: 7 }, type: { type: "int32", id: 8 }, typeSign: { type: "int32", id: 9 }, pushDataType: { type: "int32", id: 10 }, timestamp: { type: "double", id: 11 } } }, OrderBookDetail: { fields: { orderID: { rule: "required", type: "int64", id: 1 }, volume: { rule: "required", type: "int64", id: 2 } } }, OrderBook: { fields: { price: { rule: "required", type: "double", id: 1 }, volume: { rule: "required", type: "int64", id: 2 }, orederCount: { rule: "required", type: "int32", id: 3 }, detailList: { rule: "repeated", type: "OrderBookDetail", id: 4 } } }, ShareHoldingChange: { fields: { holderName: { rule: "required", type: "string", id: 1 }, holdingQty: { rule: "required", type: "double", id: 2 }, holdingRatio: { rule: "required", type: "double", id: 3 }, changeQty: { rule: "required", type: "double", id: 4 }, changeRatio: { rule: "required", type: "double", id: 5 }, time: { rule: "required", type: "string", id: 6 }, timestamp: { type: "double", id: 7 } } }, SubInfo: { fields: { subType: { rule: "required", type: "int32", id: 1 }, securityList: { rule: "repeated", type: "Qot_Common.Security", id: 2 } } }, ConnSubInfo: { fields: { subInfoList: { rule: "repeated", type: "SubInfo", id: 1 }, usedQuota: { rule: "required", type: "int32", id: 2 }, isOwnConnData: { rule: "required", type: "bool", id: 3 } } }, PlateInfo: { fields: { plate: { rule: "required", type: "Qot_Common.Security", id: 1 }, name: { rule: "required", type: "string", id: 2 }, plateType: { type: "int32", id: 3 } } }, Rehab: { fields: { time: { rule: "required", type: "string", id: 1 }, companyActFlag: { rule: "required", type: "int64", id: 2 }, fwdFactorA: { rule: "required", type: "double", id: 3 }, fwdFactorB: { rule: "required", type: "double", id: 4 }, bwdFactorA: { rule: "required", type: "double", id: 5 }, bwdFactorB: { rule: "required", type: "double", id: 6 }, splitBase: { type: "int32", id: 7 }, splitErt: { type: "int32", id: 8 }, joinBase: { type: "int32", id: 9 }, joinErt: { type: "int32", id: 10 }, bonusBase: { type: "int32", id: 11 }, bonusErt: { type: "int32", id: 12 }, transferBase: { type: "int32", id: 13 }, transferErt: { type: "int32", id: 14 }, allotBase: { type: "int32", id: 15 }, allotErt: { type: "int32", id: 16 }, allotPrice: { type: "double", id: 17 }, addBase: { type: "int32", id: 18 }, addErt: { type: "int32", id: 19 }, addPrice: { type: "double", id: 20 }, dividend: { type: "double", id: 21 }, spDividend: { type: "double", id: 22 }, spinOffBase: { type: "double", id: 24 }, spinOffErt: { type: "double", id: 25 }, timestamp: { type: "double", id: 23 } } } } }, GetUserInfo: { options: { java_package: "com.futu.openapi.pb", go_package: "github.com/futuopen/ftapi4go/pb/getuserinfo" }, nested: { UpdateType: { values: { UpdateType_None: 0, UpdateType_Advice: 1, UpdateType_Force: 2 } }, UserInfoField: { values: { UserInfoField_Basic: 1, UserInfoField_API: 2, UserInfoField_QotRight: 4, UserInfoField_Disclaimer: 8, UserInfoField_Update: 16, UserInfoField_WebKey: 2048 } }, C2S: { fields: { flag: { type: "int32", id: 2 } } }, S2C: { fields: { nickName: { type: "string", id: 1 }, avatarUrl: { type: "string", id: 2 }, apiLevel: { type: "string", id: 3 }, hkQotRight: { type: "int32", id: 4 }, usQotRight: { type: "int32", id: 5 }, cnQotRight: { type: "int32", id: 6 }, isNeedAgreeDisclaimer: { type: "bool", id: 7 }, userID: { type: "int64", id: 8 }, updateType: { type: "int32", id: 9 }, webKey: { type: "string", id: 10 }, webJumpUrlHead: { type: "string", id: 18 }, hkOptionQotRight: { type: "int32", id: 11 }, hasUSOptionQotRight: { type: "bool", id: 12 }, hkFutureQotRight: { type: "int32", id: 13 }, subQuota: { type: "int32", id: 14 }, historyKLQuota: { type: "int32", id: 15 }, usFutureQotRight: { type: "int32", id: 16 }, usOptionQotRight: { type: "int32", id: 17 }, userAttribution: { type: "int32", id: 19 }, updateWhatsNew: { type: "string", id: 20 }, usIndexQotRight: { type: "int32", id: 21 }, usOtcQotRight: { type: "int32", id: 22 }, usCMEFutureQotRight: { type: "int32", id: 23 }, usCBOTFutureQotRight: { type: "int32", id: 24 }, usNYMEXFutureQotRight: { type: "int32", id: 25 }, usCOMEXFutureQotRight: { type: "int32", id: 26 }, usCBOEFutureQotRight: { type: "int32", id: 27 }, sgFutureQotRight: { type: "int32", id: 28 }, jpFutureQotRight: { type: "int32", id: 29 }, isAppNNOrMM: { type: "bool", id: 30 }, shQotRight: { type: "int32", id: 31 }, szQotRight: { type: "int32", id: 32 } } }, Request: { fields: { c2s: { rule: "required", type: "C2S", id: 1 } } }, Response: { fields: { retType: { rule: "required", type: "int32", id: 1, options: { "default": -400 } }, retMsg: { type: "string", id: 2 }, errCode: { type: "int32", id: 3 }, s2c: { type: "S2C", id: 4 } } } } }, InitConnect: { options: { java_package: "com.futu.openapi.pb", go_package: "github.com/futuopen/ftapi4go/pb/initconnect" }, nested: { C2S: { fields: { clientVer: { rule: "required", type: "int32", id: 1 }, clientID: { rule: "required", type: "string", id: 2 }, recvNotify: { type: "bool", id: 3 }, packetEncAlgo: { type: "int32", id: 4 }, pushProtoFmt: { type: "int32", id: 5 }, programmingLanguage: { type: "string", id: 6 } } }, S2C: { fields: { serverVer: { rule: "required", type: "int32", id: 1 }, loginUserID: { rule: "required", type: "uint64", id: 2 },