futu-sdk
Version:
futu-api 的高性能精简易用版;基于*.proto静态编译,提供高性能的多层封装但层层开放的易用接口,获取最原始最完整的量化数据;相较于Python, nodejs更接近Web, 从而轻而易举搭建一个可视化交易站点,这是进行可控量化交易的不二选择。
1 lines • 1.28 MB
JavaScript
"use strict";var m=Object.create;var y=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var w=(c,n)=>{for(var t in n)y(c,t,{get:n[t],enumerable:!0})},f=(c,n,t,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of g(n))!O.call(c,r)&&r!==t&&y(c,r,{get:()=>n[r],enumerable:!(e=h(n,r))||e.enumerable});return c};var S=(c,n,t)=>(t=c!=null?m(b(c)):{},f(n||!c||!c.__esModule?y(t,"default",{value:c,enumerable:!0}):t,c)),P=c=>f(y({},"__esModule",{value:!0}),c);var Kt={};w(Kt,{Common:()=>T,GetDelayStatistics:()=>k,GetGlobalState:()=>L,GetUserInfo:()=>j,InitConnect:()=>_,InitWebSocket:()=>x,KeepAlive:()=>Q,Notify:()=>v,Qot_Common:()=>C,Qot_GetBasicQot:()=>R,Qot_GetBroker:()=>I,Qot_GetCapitalDistribution:()=>M,Qot_GetCapitalFlow:()=>D,Qot_GetCodeChange:()=>F,Qot_GetFutureInfo:()=>E,Qot_GetHistoryKL:()=>N,Qot_GetHistoryKLPoints:()=>G,Qot_GetHoldingChangeList:()=>A,Qot_GetIpoList:()=>q,Qot_GetKL:()=>B,Qot_GetMarketState:()=>U,Qot_GetOptionChain:()=>V,Qot_GetOptionExpirationDate:()=>J,Qot_GetOrderBook:()=>K,Qot_GetOwnerPlate:()=>H,Qot_GetPlateSecurity:()=>z,Qot_GetPlateSet:()=>W,Qot_GetPriceReminder:()=>Y,Qot_GetRT:()=>X,Qot_GetReference:()=>Z,Qot_GetRehab:()=>$,Qot_GetSecuritySnapshot:()=>tt,Qot_GetStaticInfo:()=>et,Qot_GetSubInfo:()=>rt,Qot_GetSuspend:()=>nt,Qot_GetTicker:()=>ot,Qot_GetUserSecurity:()=>it,Qot_GetUserSecurityGroup:()=>st,Qot_GetWarrant:()=>lt,Qot_ModifyUserSecurity:()=>ut,Qot_RegQotPush:()=>ct,Qot_RequestHistoryKL:()=>at,Qot_RequestHistoryKLQuota:()=>pt,Qot_RequestRehab:()=>dt,Qot_RequestTradeDate:()=>yt,Qot_SetPriceReminder:()=>ft,Qot_StockFilter:()=>mt,Qot_Sub:()=>ht,Qot_UpdateBasicQot:()=>gt,Qot_UpdateBroker:()=>bt,Qot_UpdateKL:()=>Ot,Qot_UpdateOrderBook:()=>wt,Qot_UpdatePriceReminder:()=>St,Qot_UpdateRT:()=>Pt,Qot_UpdateTicker:()=>Tt,TestCmd:()=>kt,Trd_Common:()=>Lt,Trd_GetAccList:()=>Ct,Trd_GetFunds:()=>jt,Trd_GetHistoryOrderFillList:()=>_t,Trd_GetHistoryOrderList:()=>xt,Trd_GetMarginRatio:()=>Qt,Trd_GetMaxTrdQtys:()=>vt,Trd_GetOrderFee:()=>Rt,Trd_GetOrderFillList:()=>It,Trd_GetOrderList:()=>Mt,Trd_GetPositionList:()=>Dt,Trd_ModifyOrder:()=>Ft,Trd_Notify:()=>Et,Trd_PlaceOrder:()=>Nt,Trd_ReconfirmOrder:()=>Gt,Trd_SubAccPush:()=>At,Trd_UnlockTrade:()=>qt,Trd_UpdateOrder:()=>Bt,Trd_UpdateOrderFill:()=>Ut,UsedQuota:()=>Vt,Verification:()=>Jt,default:()=>i});module.exports=P(Kt);var a=S(require("protobufjs/minimal"),1),l=a.Reader,p=a.Writer,s=a.util,i=a.roots.default||(a.roots.default={}),T=i.Common=(()=>{let c={};return c.RetType=function(){let n={},t=Object.create(n);return t[n[0]="RetType_Succeed"]=0,t[n[-1]="RetType_Failed"]=-1,t[n[-100]="RetType_TimeOut"]=-100,t[n[-200]="RetType_DisConnect"]=-200,t[n[-400]="RetType_Unknown"]=-400,t[n[-500]="RetType_Invalid"]=-500,t}(),c.PacketEncAlgo=function(){let n={},t=Object.create(n);return t[n[0]="PacketEncAlgo_FTAES_ECB"]=0,t[n[-1]="PacketEncAlgo_None"]=-1,t[n[1]="PacketEncAlgo_AES_ECB"]=1,t[n[2]="PacketEncAlgo_AES_CBC"]=2,t}(),c.PacketID=function(){function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.connID=s.Long?s.Long.fromBits(0,0,!0):0,n.prototype.serialNo=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=p.create()),e.uint32(8).uint64(t.connID),e.uint32(16).uint32(t.serialNo),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof l||(t=l.create(t));let r=e===void 0?t.len:t.pos+e,o=new i.Common.PacketID;for(;t.pos<r;){let u=t.uint32();switch(u>>>3){case 1:{o.connID=t.uint64();break}case 2:{o.serialNo=t.uint32();break}default:t.skipType(u&7);break}}if(!o.hasOwnProperty("connID"))throw s.ProtocolError("missing required 'connID'",{instance:o});if(!o.hasOwnProperty("serialNo"))throw s.ProtocolError("missing required 'serialNo'",{instance:o});return o},n.decodeDelimited=function(t){return t instanceof l||(t=new l(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":!s.isInteger(t.connID)&&!(t.connID&&s.isInteger(t.connID.low)&&s.isInteger(t.connID.high))?"connID: integer|Long expected":s.isInteger(t.serialNo)?null:"serialNo: integer expected"},n.fromObject=function(t){if(t instanceof i.Common.PacketID)return t;let e=new i.Common.PacketID;return t.connID!=null&&(s.Long?(e.connID=s.Long.fromValue(t.connID)).unsigned=!0:typeof t.connID=="string"?e.connID=parseInt(t.connID,10):typeof t.connID=="number"?e.connID=t.connID:typeof t.connID=="object"&&(e.connID=new s.LongBits(t.connID.low>>>0,t.connID.high>>>0).toNumber(!0))),t.serialNo!=null&&(e.serialNo=t.serialNo>>>0),e},n.toObject=function(t,e){e||(e={});let r={};if(e.defaults){if(s.Long){let o=new s.Long(0,0,!0);r.connID=e.longs===String?o.toString():e.longs===Number?o.toNumber():o}else r.connID=e.longs===String?"0":0;r.serialNo=0}return t.connID!=null&&t.hasOwnProperty("connID")&&(typeof t.connID=="number"?r.connID=e.longs===String?String(t.connID):t.connID:r.connID=e.longs===String?s.Long.prototype.toString.call(t.connID):e.longs===Number?new s.LongBits(t.connID.low>>>0,t.connID.high>>>0).toNumber(!0):t.connID),t.serialNo!=null&&t.hasOwnProperty("serialNo")&&(r.serialNo=t.serialNo),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},n.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/Common.PacketID"},n}(),c.ProtoFmt=function(){let n={},t=Object.create(n);return t[n[0]="ProtoFmt_Protobuf"]=0,t[n[1]="ProtoFmt_Json"]=1,t}(),c.UserAttribution=function(){let n={},t=Object.create(n);return t[n[0]="UserAttribution_Unknown"]=0,t[n[1]="UserAttribution_NN"]=1,t[n[2]="UserAttribution_MM"]=2,t[n[3]="UserAttribution_SG"]=3,t[n[4]="UserAttribution_AU"]=4,t[n[5]="UserAttribution_JP"]=5,t[n[6]="UserAttribution_HK"]=6,t}(),c.ProgramStatusType=function(){let n={},t=Object.create(n);return t[n[0]="ProgramStatusType_None"]=0,t[n[1]="ProgramStatusType_Loaded"]=1,t[n[2]="ProgramStatusType_Loging"]=2,t[n[3]="ProgramStatusType_NeedPicVerifyCode"]=3,t[n[4]="ProgramStatusType_NeedPhoneVerifyCode"]=4,t[n[5]="ProgramStatusType_LoginFailed"]=5,t[n[6]="ProgramStatusType_ForceUpdate"]=6,t[n[7]="ProgramStatusType_NessaryDataPreparing"]=7,t[n[8]="ProgramStatusType_NessaryDataMissing"]=8,t[n[9]="ProgramStatusType_UnAgreeDisclaimer"]=9,t[n[10]="ProgramStatusType_Ready"]=10,t[n[11]="ProgramStatusType_ForceLogout"]=11,t[n[12]="ProgramStatusType_DisclaimerPullFailed"]=12,t}(),c.ProgramStatus=function(){function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.type=0,n.prototype.strExtDesc="",n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=p.create()),e.uint32(8).int32(t.type),t.strExtDesc!=null&&Object.hasOwnProperty.call(t,"strExtDesc")&&e.uint32(18).string(t.strExtDesc),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof l||(t=l.create(t));let r=e===void 0?t.len:t.pos+e,o=new i.Common.ProgramStatus;for(;t.pos<r;){let u=t.uint32();switch(u>>>3){case 1:{o.type=t.int32();break}case 2:{o.strExtDesc=t.string();break}default:t.skipType(u&7);break}}if(!o.hasOwnProperty("type"))throw s.ProtocolError("missing required 'type'",{instance:o});return o},n.decodeDelimited=function(t){return t instanceof l||(t=new l(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";switch(t.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:break}return t.strExtDesc!=null&&t.hasOwnProperty("strExtDesc")&&!s.isString(t.strExtDesc)?"strExtDesc: string expected":null},n.fromObject=function(t){if(t instanceof i.Common.ProgramStatus)return t;let e=new i.Common.ProgramStatus;switch(t.type){default:if(typeof t.type=="number"){e.type=t.type;break}break;case"ProgramStatusType_None":case 0:e.type=0;break;case"ProgramStatusType_Loaded":case 1:e.type=1;break;case"ProgramStatusType_Loging":case 2:e.type=2;break;case"ProgramStatusType_NeedPicVerifyCode":case 3:e.type=3;break;case"ProgramStatusType_NeedPhoneVerifyCode":case 4:e.type=4;break;case"ProgramStatusType_LoginFailed":case 5:e.type=5;break;case"ProgramStatusType_ForceUpdate":case 6:e.type=6;break;case"ProgramStatusType_NessaryDataPreparing":case 7:e.type=7;break;case"ProgramStatusType_NessaryDataMissing":case 8:e.type=8;break;case"ProgramStatusType_UnAgreeDisclaimer":case 9:e.type=9;break;case"ProgramStatusType_Ready":case 10:e.type=10;break;case"ProgramStatusType_ForceLogout":case 11:e.type=11;break;case"ProgramStatusType_DisclaimerPullFailed":case 12:e.type=12;break}return t.strExtDesc!=null&&(e.strExtDesc=String(t.strExtDesc)),e},n.toObject=function(t,e){e||(e={});let r={};return e.defaults&&(r.type=e.enums===String?"ProgramStatusType_None":0,r.strExtDesc=""),t.type!=null&&t.hasOwnProperty("type")&&(r.type=e.enums===String?i.Common.ProgramStatusType[t.type]===void 0?t.type:i.Common.ProgramStatusType[t.type]:t.type),t.strExtDesc!=null&&t.hasOwnProperty("strExtDesc")&&(r.strExtDesc=t.strExtDesc),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},n.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/Common.ProgramStatus"},n}(),c})(),k=i.GetDelayStatistics=(()=>{let c={};return c.DelayStatisticsType=function(){let n={},t=Object.create(n);return t[n[0]="DelayStatisticsType_Unkonw"]=0,t[n[1]="DelayStatisticsType_QotPush"]=1,t[n[2]="DelayStatisticsType_ReqReply"]=2,t[n[3]="DelayStatisticsType_PlaceOrder"]=3,t}(),c.QotPushStage=function(){let n={},t=Object.create(n);return t[n[0]="QotPushStage_Unkonw"]=0,t[n[1]="QotPushStage_SR2SS"]=1,t[n[2]="QotPushStage_SS2CR"]=2,t[n[3]="QotPushStage_CR2CS"]=3,t[n[4]="QotPushStage_SS2CS"]=4,t[n[5]="QotPushStage_SR2CS"]=5,t}(),c.QotPushType=function(){let n={},t=Object.create(n);return t[n[0]="QotPushType_Unkonw"]=0,t[n[1]="QotPushType_Price"]=1,t[n[2]="QotPushType_Ticker"]=2,t[n[3]="QotPushType_OrderBook"]=3,t[n[4]="QotPushType_Broker"]=4,t}(),c.C2S=function(){function n(t){if(this.typeList=[],this.segmentList=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.typeList=s.emptyArray,n.prototype.qotPushStage=0,n.prototype.segmentList=s.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=p.create()),t.typeList!=null&&t.typeList.length)for(let r=0;r<t.typeList.length;++r)e.uint32(8).int32(t.typeList[r]);if(t.qotPushStage!=null&&Object.hasOwnProperty.call(t,"qotPushStage")&&e.uint32(16).int32(t.qotPushStage),t.segmentList!=null&&t.segmentList.length)for(let r=0;r<t.segmentList.length;++r)e.uint32(24).int32(t.segmentList[r]);return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof l||(t=l.create(t));let r=e===void 0?t.len:t.pos+e,o=new i.GetDelayStatistics.C2S;for(;t.pos<r;){let u=t.uint32();switch(u>>>3){case 1:{if(o.typeList&&o.typeList.length||(o.typeList=[]),(u&7)===2){let d=t.uint32()+t.pos;for(;t.pos<d;)o.typeList.push(t.int32())}else o.typeList.push(t.int32());break}case 2:{o.qotPushStage=t.int32();break}case 3:{if(o.segmentList&&o.segmentList.length||(o.segmentList=[]),(u&7)===2){let d=t.uint32()+t.pos;for(;t.pos<d;)o.segmentList.push(t.int32())}else o.segmentList.push(t.int32());break}default:t.skipType(u&7);break}}return o},n.decodeDelimited=function(t){return t instanceof l||(t=new l(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.typeList!=null&&t.hasOwnProperty("typeList")){if(!Array.isArray(t.typeList))return"typeList: array expected";for(let e=0;e<t.typeList.length;++e)if(!s.isInteger(t.typeList[e]))return"typeList: integer[] expected"}if(t.qotPushStage!=null&&t.hasOwnProperty("qotPushStage")&&!s.isInteger(t.qotPushStage))return"qotPushStage: integer expected";if(t.segmentList!=null&&t.hasOwnProperty("segmentList")){if(!Array.isArray(t.segmentList))return"segmentList: array expected";for(let e=0;e<t.segmentList.length;++e)if(!s.isInteger(t.segmentList[e]))return"segmentList: integer[] expected"}return null},n.fromObject=function(t){if(t instanceof i.GetDelayStatistics.C2S)return t;let e=new i.GetDelayStatistics.C2S;if(t.typeList){if(!Array.isArray(t.typeList))throw TypeError(".GetDelayStatistics.C2S.typeList: array expected");e.typeList=[];for(let r=0;r<t.typeList.length;++r)e.typeList[r]=t.typeList[r]|0}if(t.qotPushStage!=null&&(e.qotPushStage=t.qotPushStage|0),t.segmentList){if(!Array.isArray(t.segmentList))throw TypeError(".GetDelayStatistics.C2S.segmentList: array expected");e.segmentList=[];for(let r=0;r<t.segmentList.length;++r)e.segmentList[r]=t.segmentList[r]|0}return e},n.toObject=function(t,e){e||(e={});let r={};if((e.arrays||e.defaults)&&(r.typeList=[],r.segmentList=[]),e.defaults&&(r.qotPushStage=0),t.typeList&&t.typeList.length){r.typeList=[];for(let o=0;o<t.typeList.length;++o)r.typeList[o]=t.typeList[o]}if(t.qotPushStage!=null&&t.hasOwnProperty("qotPushStage")&&(r.qotPushStage=t.qotPushStage),t.segmentList&&t.segmentList.length){r.segmentList=[];for(let o=0;o<t.segmentList.length;++o)r.segmentList[o]=t.segmentList[o]}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},n.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/GetDelayStatistics.C2S"},n}(),c.DelayStatisticsItem=function(){function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.begin=0,n.prototype.end=0,n.prototype.count=0,n.prototype.proportion=0,n.prototype.cumulativeRatio=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=p.create()),e.uint32(8).int32(t.begin),e.uint32(16).int32(t.end),e.uint32(24).int32(t.count),e.uint32(37).float(t.proportion),e.uint32(45).float(t.cumulativeRatio),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof l||(t=l.create(t));let r=e===void 0?t.len:t.pos+e,o=new i.GetDelayStatistics.DelayStatisticsItem;for(;t.pos<r;){let u=t.uint32();switch(u>>>3){case 1:{o.begin=t.int32();break}case 2:{o.end=t.int32();break}case 3:{o.count=t.int32();break}case 4:{o.proportion=t.float();break}case 5:{o.cumulativeRatio=t.float();break}default:t.skipType(u&7);break}}if(!o.hasOwnProperty("begin"))throw s.ProtocolError("missing required 'begin'",{instance:o});if(!o.hasOwnProperty("end"))throw s.ProtocolError("missing required 'end'",{instance:o});if(!o.hasOwnProperty("count"))throw s.ProtocolError("missing required 'count'",{instance:o});if(!o.hasOwnProperty("proportion"))throw s.ProtocolError("missing required 'proportion'",{instance:o});if(!o.hasOwnProperty("cumulativeRatio"))throw s.ProtocolError("missing required 'cumulativeRatio'",{instance:o});return o},n.decodeDelimited=function(t){return t instanceof l||(t=new l(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":s.isInteger(t.begin)?s.isInteger(t.end)?s.isInteger(t.count)?typeof t.proportion!="number"?"proportion: number expected":typeof t.cumulativeRatio!="number"?"cumulativeRatio: number expected":null:"count: integer expected":"end: integer expected":"begin: integer expected"},n.fromObject=function(t){if(t instanceof i.GetDelayStatistics.DelayStatisticsItem)return t;let e=new i.GetDelayStatistics.DelayStatisticsItem;return t.begin!=null&&(e.begin=t.begin|0),t.end!=null&&(e.end=t.end|0),t.count!=null&&(e.count=t.count|0),t.proportion!=null&&(e.proportion=Number(t.proportion)),t.cumulativeRatio!=null&&(e.cumulativeRatio=Number(t.cumulativeRatio)),e},n.toObject=function(t,e){e||(e={});let r={};return e.defaults&&(r.begin=0,r.end=0,r.count=0,r.proportion=0,r.cumulativeRatio=0),t.begin!=null&&t.hasOwnProperty("begin")&&(r.begin=t.begin),t.end!=null&&t.hasOwnProperty("end")&&(r.end=t.end),t.count!=null&&t.hasOwnProperty("count")&&(r.count=t.count),t.proportion!=null&&t.hasOwnProperty("proportion")&&(r.proportion=e.json&&!isFinite(t.proportion)?String(t.proportion):t.proportion),t.cumulativeRatio!=null&&t.hasOwnProperty("cumulativeRatio")&&(r.cumulativeRatio=e.json&&!isFinite(t.cumulativeRatio)?String(t.cumulativeRatio):t.cumulativeRatio),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},n.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/GetDelayStatistics.DelayStatisticsItem"},n}(),c.DelayStatistics=function(){function n(t){if(this.itemList=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.qotPushType=0,n.prototype.itemList=s.emptyArray,n.prototype.delayAvg=0,n.prototype.count=0,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=p.create()),e.uint32(8).int32(t.qotPushType),t.itemList!=null&&t.itemList.length)for(let r=0;r<t.itemList.length;++r)i.GetDelayStatistics.DelayStatisticsItem.encode(t.itemList[r],e.uint32(18).fork()).ldelim();return e.uint32(29).float(t.delayAvg),e.uint32(32).int32(t.count),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof l||(t=l.create(t));let r=e===void 0?t.len:t.pos+e,o=new i.GetDelayStatistics.DelayStatistics;for(;t.pos<r;){let u=t.uint32();switch(u>>>3){case 1:{o.qotPushType=t.int32();break}case 2:{o.itemList&&o.itemList.length||(o.itemList=[]),o.itemList.push(i.GetDelayStatistics.DelayStatisticsItem.decode(t,t.uint32()));break}case 3:{o.delayAvg=t.float();break}case 4:{o.count=t.int32();break}default:t.skipType(u&7);break}}if(!o.hasOwnProperty("qotPushType"))throw s.ProtocolError("missing required 'qotPushType'",{instance:o});if(!o.hasOwnProperty("delayAvg"))throw s.ProtocolError("missing required 'delayAvg'",{instance:o});if(!o.hasOwnProperty("count"))throw s.ProtocolError("missing required 'count'",{instance:o});return o},n.decodeDelimited=function(t){return t instanceof l||(t=new l(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!s.isInteger(t.qotPushType))return"qotPushType: integer expected";if(t.itemList!=null&&t.hasOwnProperty("itemList")){if(!Array.isArray(t.itemList))return"itemList: array expected";for(let e=0;e<t.itemList.length;++e){let r=i.GetDelayStatistics.DelayStatisticsItem.verify(t.itemList[e]);if(r)return"itemList."+r}}return typeof t.delayAvg!="number"?"delayAvg: number expected":s.isInteger(t.count)?null:"count: integer expected"},n.fromObject=function(t){if(t instanceof i.GetDelayStatistics.DelayStatistics)return t;let e=new i.GetDelayStatistics.DelayStatistics;if(t.qotPushType!=null&&(e.qotPushType=t.qotPushType|0),t.itemList){if(!Array.isArray(t.itemList))throw TypeError(".GetDelayStatistics.DelayStatistics.itemList: array expected");e.itemList=[];for(let r=0;r<t.itemList.length;++r){if(typeof t.itemList[r]!="object")throw TypeError(".GetDelayStatistics.DelayStatistics.itemList: object expected");e.itemList[r]=i.GetDelayStatistics.DelayStatisticsItem.fromObject(t.itemList[r])}}return t.delayAvg!=null&&(e.delayAvg=Number(t.delayAvg)),t.count!=null&&(e.count=t.count|0),e},n.toObject=function(t,e){e||(e={});let r={};if((e.arrays||e.defaults)&&(r.itemList=[]),e.defaults&&(r.qotPushType=0,r.delayAvg=0,r.count=0),t.qotPushType!=null&&t.hasOwnProperty("qotPushType")&&(r.qotPushType=t.qotPushType),t.itemList&&t.itemList.length){r.itemList=[];for(let o=0;o<t.itemList.length;++o)r.itemList[o]=i.GetDelayStatistics.DelayStatisticsItem.toObject(t.itemList[o],e)}return t.delayAvg!=null&&t.hasOwnProperty("delayAvg")&&(r.delayAvg=e.json&&!isFinite(t.delayAvg)?String(t.delayAvg):t.delayAvg),t.count!=null&&t.hasOwnProperty("count")&&(r.count=t.count),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},n.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/GetDelayStatistics.DelayStatistics"},n}(),c.ReqReplyStatisticsItem=function(){function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.protoID=0,n.prototype.count=0,n.prototype.totalCostAvg=0,n.prototype.openDCostAvg=0,n.prototype.netDelayAvg=0,n.prototype.isLocalReply=!1,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=p.create()),e.uint32(8).int32(t.protoID),e.uint32(16).int32(t.count),e.uint32(29).float(t.totalCostAvg),e.uint32(37).float(t.openDCostAvg),e.uint32(45).float(t.netDelayAvg),e.uint32(48).bool(t.isLocalReply),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof l||(t=l.create(t));let r=e===void 0?t.len:t.pos+e,o=new i.GetDelayStatistics.ReqReplyStatisticsItem;for(;t.pos<r;){let u=t.uint32();switch(u>>>3){case 1:{o.protoID=t.int32();break}case 2:{o.count=t.int32();break}case 3:{o.totalCostAvg=t.float();break}case 4:{o.openDCostAvg=t.float();break}case 5:{o.netDelayAvg=t.float();break}case 6:{o.isLocalReply=t.bool();break}default:t.skipType(u&7);break}}if(!o.hasOwnProperty("protoID"))throw s.ProtocolError("missing required 'protoID'",{instance:o});if(!o.hasOwnProperty("count"))throw s.ProtocolError("missing required 'count'",{instance:o});if(!o.hasOwnProperty("totalCostAvg"))throw s.ProtocolError("missing required 'totalCostAvg'",{instance:o});if(!o.hasOwnProperty("openDCostAvg"))throw s.ProtocolError("missing required 'openDCostAvg'",{instance:o});if(!o.hasOwnProperty("netDelayAvg"))throw s.ProtocolError("missing required 'netDelayAvg'",{instance:o});if(!o.hasOwnProperty("isLocalReply"))throw s.ProtocolError("missing required 'isLocalReply'",{instance:o});return o},n.decodeDelimited=function(t){return t instanceof l||(t=new l(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":s.isInteger(t.protoID)?s.isInteger(t.count)?typeof t.totalCostAvg!="number"?"totalCostAvg: number expected":typeof t.openDCostAvg!="number"?"openDCostAvg: number expected":typeof t.netDelayAvg!="number"?"netDelayAvg: number expected":typeof t.isLocalReply!="boolean"?"isLocalReply: boolean expected":null:"count: integer expected":"protoID: integer expected"},n.fromObject=function(t){if(t instanceof i.GetDelayStatistics.ReqReplyStatisticsItem)return t;let e=new i.GetDelayStatistics.ReqReplyStatisticsItem;return t.protoID!=null&&(e.protoID=t.protoID|0),t.count!=null&&(e.count=t.count|0),t.totalCostAvg!=null&&(e.totalCostAvg=Number(t.totalCostAvg)),t.openDCostAvg!=null&&(e.openDCostAvg=Number(t.openDCostAvg)),t.netDelayAvg!=null&&(e.netDelayAvg=Number(t.netDelayAvg)),t.isLocalReply!=null&&(e.isLocalReply=!!t.isLocalReply),e},n.toObject=function(t,e){e||(e={});let r={};return e.defaults&&(r.protoID=0,r.count=0,r.totalCostAvg=0,r.openDCostAvg=0,r.netDelayAvg=0,r.isLocalReply=!1),t.protoID!=null&&t.hasOwnProperty("protoID")&&(r.protoID=t.protoID),t.count!=null&&t.hasOwnProperty("count")&&(r.count=t.count),t.totalCostAvg!=null&&t.hasOwnProperty("totalCostAvg")&&(r.totalCostAvg=e.json&&!isFinite(t.totalCostAvg)?String(t.totalCostAvg):t.totalCostAvg),t.openDCostAvg!=null&&t.hasOwnProperty("openDCostAvg")&&(r.openDCostAvg=e.json&&!isFinite(t.openDCostAvg)?String(t.openDCostAvg):t.openDCostAvg),t.netDelayAvg!=null&&t.hasOwnProperty("netDelayAvg")&&(r.netDelayAvg=e.json&&!isFinite(t.netDelayAvg)?String(t.netDelayAvg):t.netDelayAvg),t.isLocalReply!=null&&t.hasOwnProperty("isLocalReply")&&(r.isLocalReply=t.isLocalReply),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},n.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/GetDelayStatistics.ReqReplyStatisticsItem"},n}(),c.PlaceOrderStatisticsItem=function(){function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.orderID="",n.prototype.totalCost=0,n.prototype.openDCost=0,n.prototype.netDelay=0,n.prototype.updateCost=0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=p.create()),e.uint32(10).string(t.orderID),e.uint32(21).float(t.totalCost),e.uint32(29).float(t.openDCost),e.uint32(37).float(t.netDelay),e.uint32(45).float(t.updateCost),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof l||(t=l.create(t));let r=e===void 0?t.len:t.pos+e,o=new i.GetDelayStatistics.PlaceOrderStatisticsItem;for(;t.pos<r;){let u=t.uint32();switch(u>>>3){case 1:{o.orderID=t.string();break}case 2:{o.totalCost=t.float();break}case 3:{o.openDCost=t.float();break}case 4:{o.netDelay=t.float();break}case 5:{o.updateCost=t.float();break}default:t.skipType(u&7);break}}if(!o.hasOwnProperty("orderID"))throw s.ProtocolError("missing required 'orderID'",{instance:o});if(!o.hasOwnProperty("totalCost"))throw s.ProtocolError("missing required 'totalCost'",{instance:o});if(!o.hasOwnProperty("openDCost"))throw s.ProtocolError("missing required 'openDCost'",{instance:o});if(!o.hasOwnProperty("netDelay"))throw s.ProtocolError("missing required 'netDelay'",{instance:o});if(!o.hasOwnProperty("updateCost"))throw s.ProtocolError("missing required 'updateCost'",{instance:o});return o},n.decodeDelimited=function(t){return t instanceof l||(t=new l(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":s.isString(t.orderID)?typeof t.totalCost!="number"?"totalCost: number expected":typeof t.openDCost!="number"?"openDCost: number expected":typeof t.netDelay!="number"?"netDelay: number expected":typeof t.updateCost!="number"?"updateCost: number expected":null:"orderID: string expected"},n.fromObject=function(t){if(t instanceof i.GetDelayStatistics.PlaceOrderStatisticsItem)return t;let e=new i.GetDelayStatistics.PlaceOrderStatisticsItem;return t.orderID!=null&&(e.orderID=String(t.orderID)),t.totalCost!=null&&(e.totalCost=Number(t.totalCost)),t.openDCost!=null&&(e.openDCost=Number(t.openDCost)),t.netDelay!=null&&(e.netDelay=Number(t.netDelay)),t.updateCost!=null&&(e.updateCost=Number(t.updateCost)),e},n.toObject=function(t,e){e||(e={});let r={};return e.defaults&&(r.orderID="",r.totalCost=0,r.openDCost=0,r.netDelay=0,r.updateCost=0),t.orderID!=null&&t.hasOwnProperty("orderID")&&(r.orderID=t.orderID),t.totalCost!=null&&t.hasOwnProperty("totalCost")&&(r.totalCost=e.json&&!isFinite(t.totalCost)?String(t.totalCost):t.totalCost),t.openDCost!=null&&t.hasOwnProperty("openDCost")&&(r.openDCost=e.json&&!isFinite(t.openDCost)?String(t.openDCost):t.openDCost),t.netDelay!=null&&t.hasOwnProperty("netDelay")&&(r.netDelay=e.json&&!isFinite(t.netDelay)?String(t.netDelay):t.netDelay),t.updateCost!=null&&t.hasOwnProperty("updateCost")&&(r.updateCost=e.json&&!isFinite(t.updateCost)?String(t.updateCost):t.updateCost),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},n.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/GetDelayStatistics.PlaceOrderStatisticsItem"},n}(),c.S2C=function(){function n(t){if(this.qotPushStatisticsList=[],this.reqReplyStatisticsList=[],this.placeOrderStatisticsList=[],t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.qotPushStatisticsList=s.emptyArray,n.prototype.reqReplyStatisticsList=s.emptyArray,n.prototype.placeOrderStatisticsList=s.emptyArray,n.create=function(t){return new n(t)},n.encode=function(t,e){if(e||(e=p.create()),t.qotPushStatisticsList!=null&&t.qotPushStatisticsList.length)for(let r=0;r<t.qotPushStatisticsList.length;++r)i.GetDelayStatistics.DelayStatistics.encode(t.qotPushStatisticsList[r],e.uint32(10).fork()).ldelim();if(t.reqReplyStatisticsList!=null&&t.reqReplyStatisticsList.length)for(let r=0;r<t.reqReplyStatisticsList.length;++r)i.GetDelayStatistics.ReqReplyStatisticsItem.encode(t.reqReplyStatisticsList[r],e.uint32(18).fork()).ldelim();if(t.placeOrderStatisticsList!=null&&t.placeOrderStatisticsList.length)for(let r=0;r<t.placeOrderStatisticsList.length;++r)i.GetDelayStatistics.PlaceOrderStatisticsItem.encode(t.placeOrderStatisticsList[r],e.uint32(26).fork()).ldelim();return e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof l||(t=l.create(t));let r=e===void 0?t.len:t.pos+e,o=new i.GetDelayStatistics.S2C;for(;t.pos<r;){let u=t.uint32();switch(u>>>3){case 1:{o.qotPushStatisticsList&&o.qotPushStatisticsList.length||(o.qotPushStatisticsList=[]),o.qotPushStatisticsList.push(i.GetDelayStatistics.DelayStatistics.decode(t,t.uint32()));break}case 2:{o.reqReplyStatisticsList&&o.reqReplyStatisticsList.length||(o.reqReplyStatisticsList=[]),o.reqReplyStatisticsList.push(i.GetDelayStatistics.ReqReplyStatisticsItem.decode(t,t.uint32()));break}case 3:{o.placeOrderStatisticsList&&o.placeOrderStatisticsList.length||(o.placeOrderStatisticsList=[]),o.placeOrderStatisticsList.push(i.GetDelayStatistics.PlaceOrderStatisticsItem.decode(t,t.uint32()));break}default:t.skipType(u&7);break}}return o},n.decodeDelimited=function(t){return t instanceof l||(t=new l(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.qotPushStatisticsList!=null&&t.hasOwnProperty("qotPushStatisticsList")){if(!Array.isArray(t.qotPushStatisticsList))return"qotPushStatisticsList: array expected";for(let e=0;e<t.qotPushStatisticsList.length;++e){let r=i.GetDelayStatistics.DelayStatistics.verify(t.qotPushStatisticsList[e]);if(r)return"qotPushStatisticsList."+r}}if(t.reqReplyStatisticsList!=null&&t.hasOwnProperty("reqReplyStatisticsList")){if(!Array.isArray(t.reqReplyStatisticsList))return"reqReplyStatisticsList: array expected";for(let e=0;e<t.reqReplyStatisticsList.length;++e){let r=i.GetDelayStatistics.ReqReplyStatisticsItem.verify(t.reqReplyStatisticsList[e]);if(r)return"reqReplyStatisticsList."+r}}if(t.placeOrderStatisticsList!=null&&t.hasOwnProperty("placeOrderStatisticsList")){if(!Array.isArray(t.placeOrderStatisticsList))return"placeOrderStatisticsList: array expected";for(let e=0;e<t.placeOrderStatisticsList.length;++e){let r=i.GetDelayStatistics.PlaceOrderStatisticsItem.verify(t.placeOrderStatisticsList[e]);if(r)return"placeOrderStatisticsList."+r}}return null},n.fromObject=function(t){if(t instanceof i.GetDelayStatistics.S2C)return t;let e=new i.GetDelayStatistics.S2C;if(t.qotPushStatisticsList){if(!Array.isArray(t.qotPushStatisticsList))throw TypeError(".GetDelayStatistics.S2C.qotPushStatisticsList: array expected");e.qotPushStatisticsList=[];for(let r=0;r<t.qotPushStatisticsList.length;++r){if(typeof t.qotPushStatisticsList[r]!="object")throw TypeError(".GetDelayStatistics.S2C.qotPushStatisticsList: object expected");e.qotPushStatisticsList[r]=i.GetDelayStatistics.DelayStatistics.fromObject(t.qotPushStatisticsList[r])}}if(t.reqReplyStatisticsList){if(!Array.isArray(t.reqReplyStatisticsList))throw TypeError(".GetDelayStatistics.S2C.reqReplyStatisticsList: array expected");e.reqReplyStatisticsList=[];for(let r=0;r<t.reqReplyStatisticsList.length;++r){if(typeof t.reqReplyStatisticsList[r]!="object")throw TypeError(".GetDelayStatistics.S2C.reqReplyStatisticsList: object expected");e.reqReplyStatisticsList[r]=i.GetDelayStatistics.ReqReplyStatisticsItem.fromObject(t.reqReplyStatisticsList[r])}}if(t.placeOrderStatisticsList){if(!Array.isArray(t.placeOrderStatisticsList))throw TypeError(".GetDelayStatistics.S2C.placeOrderStatisticsList: array expected");e.placeOrderStatisticsList=[];for(let r=0;r<t.placeOrderStatisticsList.length;++r){if(typeof t.placeOrderStatisticsList[r]!="object")throw TypeError(".GetDelayStatistics.S2C.placeOrderStatisticsList: object expected");e.placeOrderStatisticsList[r]=i.GetDelayStatistics.PlaceOrderStatisticsItem.fromObject(t.placeOrderStatisticsList[r])}}return e},n.toObject=function(t,e){e||(e={});let r={};if((e.arrays||e.defaults)&&(r.qotPushStatisticsList=[],r.reqReplyStatisticsList=[],r.placeOrderStatisticsList=[]),t.qotPushStatisticsList&&t.qotPushStatisticsList.length){r.qotPushStatisticsList=[];for(let o=0;o<t.qotPushStatisticsList.length;++o)r.qotPushStatisticsList[o]=i.GetDelayStatistics.DelayStatistics.toObject(t.qotPushStatisticsList[o],e)}if(t.reqReplyStatisticsList&&t.reqReplyStatisticsList.length){r.reqReplyStatisticsList=[];for(let o=0;o<t.reqReplyStatisticsList.length;++o)r.reqReplyStatisticsList[o]=i.GetDelayStatistics.ReqReplyStatisticsItem.toObject(t.reqReplyStatisticsList[o],e)}if(t.placeOrderStatisticsList&&t.placeOrderStatisticsList.length){r.placeOrderStatisticsList=[];for(let o=0;o<t.placeOrderStatisticsList.length;++o)r.placeOrderStatisticsList[o]=i.GetDelayStatistics.PlaceOrderStatisticsItem.toObject(t.placeOrderStatisticsList[o],e)}return r},n.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},n.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/GetDelayStatistics.S2C"},n}(),c.Request=function(){function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.c2s=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=p.create()),i.GetDelayStatistics.C2S.encode(t.c2s,e.uint32(10).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof l||(t=l.create(t));let r=e===void 0?t.len:t.pos+e,o=new i.GetDelayStatistics.Request;for(;t.pos<r;){let u=t.uint32();switch(u>>>3){case 1:{o.c2s=i.GetDelayStatistics.C2S.decode(t,t.uint32());break}default:t.skipType(u&7);break}}if(!o.hasOwnProperty("c2s"))throw s.ProtocolError("missing required 'c2s'",{instance:o});return o},n.decodeDelimited=function(t){return t instanceof l||(t=new l(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";{let e=i.GetDelayStatistics.C2S.verify(t.c2s);if(e)return"c2s."+e}return null},n.fromObject=function(t){if(t instanceof i.GetDelayStatistics.Request)return t;let e=new i.GetDelayStatistics.Request;if(t.c2s!=null){if(typeof t.c2s!="object")throw TypeError(".GetDelayStatistics.Request.c2s: object expected");e.c2s=i.GetDelayStatistics.C2S.fromObject(t.c2s)}return e},n.toObject=function(t,e){e||(e={});let r={};return e.defaults&&(r.c2s=null),t.c2s!=null&&t.hasOwnProperty("c2s")&&(r.c2s=i.GetDelayStatistics.C2S.toObject(t.c2s,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},n.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/GetDelayStatistics.Request"},n}(),c.Response=function(){function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.retType=-400,n.prototype.retMsg="",n.prototype.errCode=0,n.prototype.s2c=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=p.create()),e.uint32(8).int32(t.retType),t.retMsg!=null&&Object.hasOwnProperty.call(t,"retMsg")&&e.uint32(18).string(t.retMsg),t.errCode!=null&&Object.hasOwnProperty.call(t,"errCode")&&e.uint32(24).int32(t.errCode),t.s2c!=null&&Object.hasOwnProperty.call(t,"s2c")&&i.GetDelayStatistics.S2C.encode(t.s2c,e.uint32(34).fork()).ldelim(),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof l||(t=l.create(t));let r=e===void 0?t.len:t.pos+e,o=new i.GetDelayStatistics.Response;for(;t.pos<r;){let u=t.uint32();switch(u>>>3){case 1:{o.retType=t.int32();break}case 2:{o.retMsg=t.string();break}case 3:{o.errCode=t.int32();break}case 4:{o.s2c=i.GetDelayStatistics.S2C.decode(t,t.uint32());break}default:t.skipType(u&7);break}}if(!o.hasOwnProperty("retType"))throw s.ProtocolError("missing required 'retType'",{instance:o});return o},n.decodeDelimited=function(t){return t instanceof l||(t=new l(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!s.isInteger(t.retType))return"retType: integer expected";if(t.retMsg!=null&&t.hasOwnProperty("retMsg")&&!s.isString(t.retMsg))return"retMsg: string expected";if(t.errCode!=null&&t.hasOwnProperty("errCode")&&!s.isInteger(t.errCode))return"errCode: integer expected";if(t.s2c!=null&&t.hasOwnProperty("s2c")){let e=i.GetDelayStatistics.S2C.verify(t.s2c);if(e)return"s2c."+e}return null},n.fromObject=function(t){if(t instanceof i.GetDelayStatistics.Response)return t;let e=new i.GetDelayStatistics.Response;if(t.retType!=null&&(e.retType=t.retType|0),t.retMsg!=null&&(e.retMsg=String(t.retMsg)),t.errCode!=null&&(e.errCode=t.errCode|0),t.s2c!=null){if(typeof t.s2c!="object")throw TypeError(".GetDelayStatistics.Response.s2c: object expected");e.s2c=i.GetDelayStatistics.S2C.fromObject(t.s2c)}return e},n.toObject=function(t,e){e||(e={});let r={};return e.defaults&&(r.retType=-400,r.retMsg="",r.errCode=0,r.s2c=null),t.retType!=null&&t.hasOwnProperty("retType")&&(r.retType=t.retType),t.retMsg!=null&&t.hasOwnProperty("retMsg")&&(r.retMsg=t.retMsg),t.errCode!=null&&t.hasOwnProperty("errCode")&&(r.errCode=t.errCode),t.s2c!=null&&t.hasOwnProperty("s2c")&&(r.s2c=i.GetDelayStatistics.S2C.toObject(t.s2c,e)),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},n.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/GetDelayStatistics.Response"},n}(),c})(),L=i.GetGlobalState=(()=>{let c={};return c.C2S=function(){function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.userID=s.Long?s.Long.fromBits(0,0,!0):0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=p.create()),e.uint32(8).uint64(t.userID),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof l||(t=l.create(t));let r=e===void 0?t.len:t.pos+e,o=new i.GetGlobalState.C2S;for(;t.pos<r;){let u=t.uint32();switch(u>>>3){case 1:{o.userID=t.uint64();break}default:t.skipType(u&7);break}}if(!o.hasOwnProperty("userID"))throw s.ProtocolError("missing required 'userID'",{instance:o});return o},n.decodeDelimited=function(t){return t instanceof l||(t=new l(t)),this.decode(t,t.uint32())},n.verify=function(t){return typeof t!="object"||t===null?"object expected":!s.isInteger(t.userID)&&!(t.userID&&s.isInteger(t.userID.low)&&s.isInteger(t.userID.high))?"userID: integer|Long expected":null},n.fromObject=function(t){if(t instanceof i.GetGlobalState.C2S)return t;let e=new i.GetGlobalState.C2S;return t.userID!=null&&(s.Long?(e.userID=s.Long.fromValue(t.userID)).unsigned=!0:typeof t.userID=="string"?e.userID=parseInt(t.userID,10):typeof t.userID=="number"?e.userID=t.userID:typeof t.userID=="object"&&(e.userID=new s.LongBits(t.userID.low>>>0,t.userID.high>>>0).toNumber(!0))),e},n.toObject=function(t,e){e||(e={});let r={};if(e.defaults)if(s.Long){let o=new s.Long(0,0,!0);r.userID=e.longs===String?o.toString():e.longs===Number?o.toNumber():o}else r.userID=e.longs===String?"0":0;return t.userID!=null&&t.hasOwnProperty("userID")&&(typeof t.userID=="number"?r.userID=e.longs===String?String(t.userID):t.userID:r.userID=e.longs===String?s.Long.prototype.toString.call(t.userID):e.longs===Number?new s.LongBits(t.userID.low>>>0,t.userID.high>>>0).toNumber(!0):t.userID),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},n.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/GetGlobalState.C2S"},n}(),c.S2C=function(){function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.marketHK=0,n.prototype.marketUS=0,n.prototype.marketSH=0,n.prototype.marketSZ=0,n.prototype.marketHKFuture=0,n.prototype.marketUSFuture=0,n.prototype.marketSGFuture=0,n.prototype.marketJPFuture=0,n.prototype.qotLogined=!1,n.prototype.trdLogined=!1,n.prototype.serverVer=0,n.prototype.serverBuildNo=0,n.prototype.time=s.Long?s.Long.fromBits(0,0,!1):0,n.prototype.localTime=0,n.prototype.programStatus=null,n.prototype.qotSvrIpAddr="",n.prototype.trdSvrIpAddr="",n.prototype.connID=s.Long?s.Long.fromBits(0,0,!0):0,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=p.create()),e.uint32(8).int32(t.marketHK),e.uint32(16).int32(t.marketUS),e.uint32(24).int32(t.marketSH),e.uint32(32).int32(t.marketSZ),e.uint32(40).int32(t.marketHKFuture),e.uint32(48).bool(t.qotLogined),e.uint32(56).bool(t.trdLogined),e.uint32(64).int32(t.serverVer),e.uint32(72).int32(t.serverBuildNo),e.uint32(80).int64(t.time),t.localTime!=null&&Object.hasOwnProperty.call(t,"localTime")&&e.uint32(89).double(t.localTime),t.programStatus!=null&&Object.hasOwnProperty.call(t,"programStatus")&&i.Common.ProgramStatus.encode(t.programStatus,e.uint32(98).fork()).ldelim(),t.qotSvrIpAddr!=null&&Object.hasOwnProperty.call(t,"qotSvrIpAddr")&&e.uint32(106).string(t.qotSvrIpAddr),t.trdSvrIpAddr!=null&&Object.hasOwnProperty.call(t,"trdSvrIpAddr")&&e.uint32(114).string(t.trdSvrIpAddr),t.marketUSFuture!=null&&Object.hasOwnProperty.call(t,"marketUSFuture")&&e.uint32(120).int32(t.marketUSFuture),t.connID!=null&&Object.hasOwnProperty.call(t,"connID")&&e.uint32(128).uint64(t.connID),t.marketSGFuture!=null&&Object.hasOwnProperty.call(t,"marketSGFuture")&&e.uint32(136).int32(t.marketSGFuture),t.marketJPFuture!=null&&Object.hasOwnProperty.call(t,"marketJPFuture")&&e.uint32(144).int32(t.marketJPFuture),e},n.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},n.decode=function(t,e){t instanceof l||(t=l.create(t));let r=e===void 0?t.len:t.pos+e,o=new i.GetGlobalState.S2C;for(;t.pos<r;){let u=t.uint32();switch(u>>>3){case 1:{o.marketHK=t.int32();break}case 2:{o.marketUS=t.int32();break}case 3:{o.marketSH=t.int32();break}case 4:{o.marketSZ=t.int32();break}case 5:{o.marketHKFuture=t.int32();break}case 15:{o.marketUSFuture=t.int32();break}case 17:{o.marketSGFuture=t.int32();break}case 18:{o.marketJPFuture=t.int32();break}case 6:{o.qotLogined=t.bool();break}case 7:{o.trdLogined=t.bool();break}case 8:{o.serverVer=t.int32();break}case 9:{o.serverBuildNo=t.int32();break}case 10:{o.time=t.int64();break}case 11:{o.localTime=t.double();break}case 12:{o.programStatus=i.Common.ProgramStatus.decode(t,t.uint32());break}case 13:{o.qotSvrIpAddr=t.string();break}case 14:{o.trdSvrIpAddr=t.string();break}case 16:{o.connID=t.uint64();break}default:t.skipType(u&7);break}}if(!o.hasOwnProperty("marketHK"))throw s.ProtocolError("missing required 'marketHK'",{instance:o});if(!o.hasOwnProperty("marketUS"))throw s.ProtocolError("missing required 'marketUS'",{instance:o});if(!o.hasOwnProperty("marketSH"))throw s.ProtocolError("missing required 'marketSH'",{instance:o});if(!o.hasOwnProperty("marketSZ"))throw s.ProtocolError("missing required 'marketSZ'",{instance:o});if(!o.hasOwnProperty("marketHKFuture"))throw s.ProtocolError("missing required 'marketHKFuture'",{instance:o});if(!o.hasOwnProperty("qotLogined"))throw s.ProtocolError("missing required 'qotLogined'",{instance:o});if(!o.hasOwnProperty("trdLogined"))throw s.ProtocolError("missing required 'trdLogined'",{instance:o});if(!o.hasOwnProperty("serverVer"))throw s.ProtocolError("missing required 'serverVer'",{instance:o});if(!o.hasOwnProperty("serverBuildNo"))throw s.ProtocolError("missing required 'serverBuildNo'",{instance:o});if(!o.hasOwnProperty("time"))throw s.ProtocolError("missing required 'time'",{instance:o});return o},n.decodeDelimited=function(t){return t instanceof l||(t=new l(t)),this.decode(t,t.uint32())},n.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(!s.isInteger(t.marketHK))return"marketHK: integer expected";if(!s.isInteger(t.marketUS))return"marketUS: integer expected";if(!s.isInteger(t.marketSH))return"marketSH: integer expected";if(!s.isInteger(t.marketSZ))return"marketSZ: integer expected";if(!s.isInteger(t.marketHKFuture))return"marketHKFuture: integer expected";if(t.marketUSFuture!=null&&t.hasOwnProperty("marketUSFuture")&&!s.isInteger(t.marketUSFuture))return"marketUSFuture: integer expected";if(t.marketSGFuture!=null&&t.hasOwnProperty("marketSGFuture")&&!s.isInteger(t.marketSGFuture))return"marketSGFuture: integer expected";if(t.marketJPFuture!=null&&t.hasOwnProperty("marketJPFuture")&&!s.isInteger(t.marketJPFuture))return"marketJPFuture: integer expected";if(typeof t.qotLogined!="boolean")return"qotLogined: boolean expected";if(typeof t.trdLogined!="boolean")return"trdLogined: boolean expected";if(!s.isInteger(t.serverVer))return"serverVer: integer expected";if(!s.isInteger(t.serverBuildNo))return"serverBuildNo: integer expected";if(!s.isInteger(t.time)&&!(t.time&&s.isInteger(t.time.low)&&s.isInteger(t.time.high)))return"time: integer|Long expected";if(t.localTime!=null&&t.hasOwnProperty("localTime")&&typeof t.localTime!="number")return"localTime: number expected";if(t.programStatus!=null&&t.hasOwnProperty("programStatus")){let e=i.Common.ProgramStatus.verify(t.programStatus);if(e)return"programStatus."+e}return t.qotSvrIpAddr!=null&&t.hasOwnProperty("qotSvrIpAddr")&&!s.isString(t.qotSvrIpAddr)?"qotSvrIpAddr: string expected":t.trdSvrIpAddr!=null&&t.hasOwnProperty("trdSvrIpAddr")&&!s.isString(t.trdSvrIpAddr)?"trdSvrIpAddr: string expected":t.connID!=null&&t.hasOwnProperty("connID")&&!s.isInteger(t.connID)&&!(t.connID&&s.isInteger(t.connID.low)&&s.isInteger(t.connID.high))?"connID: integer|Long expected":null},n.fromObject=function(t){if(t instanceof i.GetGlobalState.S2C)return t;let e=new i.GetGlobalState.S2C;if(t.marketHK!=null&&(e.marketHK=t.marketHK|0),t.marketUS!=null&&(e.marketUS=t.marketUS|0),t.marketSH!=null&&(e.marketSH=t.marketSH|0),t.marketSZ!=null&&(e.marketSZ=t.marketSZ|0),t.marketHKFuture!=null&&(e.marketHKFuture=t.marketHKFuture|0),t.marketUSFuture!=null&&(e.marketUSFuture=t.marketUSFuture|0),t.marketSGFuture!=null&&(e.marketSGFuture=t.marketSGFuture|0),t.marketJPFuture!=null&&(e.marketJPFuture=t.marketJPFuture|0),t.qotLogined!=null&&(e.qotLogined=!!t.qotLogined),t.trdLogined!=null&&(e.trdLogined=!!t.trdLogined),t.serverVer!=null&&(e.serverVer=t.serverVer|0),t.serverBuildNo!=null&&(e.serverBuildNo=t.serverBuildNo|0),t.time!=null&&(s.Long?(e.time=s.Long.fromValue(t.time)).unsigned=!1:typeof t.time=="string"?e.time=parseInt(t.time,10):typeof t.time=="number"?e.time=t.time:typeof t.time=="object"&&(e.time=new s.LongBits(t.time.low>>>0,t.time.high>>>0).toNumber())),t.localTime!=null&&(e.localTime=Number(t.localTime)),t.programStatus!=null){if(typeof t.programStatus!="object")throw TypeError(".GetGlobalState.S2C.programStatus: object expected");e.programStatus=i.Common.ProgramStatus.fromObject(t.programStatus)}return t.qotSvrIpAddr!=null&&(e.qotSvrIpAddr=String(t.qotSvrIpAddr)),t.trdSvrIpAddr!=null&&(e.trdSvrIpAddr=String(t.trdSvrIpAddr)),t.connID!=null&&(s.Long?(e.connID=s.Long.fromValue(t.connID)).unsigned=!0:typeof t.connID=="string"?e.connID=parseInt(t.connID,10):typeof t.connID=="number"?e.connID=t.connID:typeof t.connID=="object"&&(e.connID=new s.LongBits(t.connID.low>>>0,t.connID.high>>>0).toNumber(!0))),e},n.toObject=function(t,e){e||(e={});let r={};if(e.defaults){if(r.marketHK=0,r.marketUS=0,r.marketSH=0,r.marketSZ=0,r.marketHKFuture=0,r.qotLogined=!1,r.trdLogined=!1,r.serverVer=0,r.serverBuildNo=0,s.Long){let o=new s.Long(0,0,!1);r.time=e.longs===String?o.toString():e.longs===Number?o.toNumber():o}else r.time=e.longs===String?"0":0;if(r.localTime=0,r.programStatus=null,r.qotSvrIpAddr="",r.trdSvrIpAddr="",r.marketUSFuture=0,s.Long){let o=new s.Long(0,0,!0);r.connID=e.longs===String?o.toString():e.longs===Number?o.toNumber():o}else r.connID=e.longs===String?"0":0;r.marketSGFuture=0,r.marketJPFuture=0}return t.marketHK!=null&&t.hasOwnProperty("marketHK")&&(r.marketHK=t.marketHK),t.marketUS!=null&&t.hasOwnProperty("marketUS")&&(r.marketUS=t.marketUS),t.marketSH!=null&&t.hasOwnProperty("marketSH")&&(r.marketSH=t.marketSH),t.marketSZ!=null&&t.hasOwnProperty("marketSZ")&&(r.marketSZ=t.marketSZ),t.marketHKFuture!=null&&t.hasOwnProperty("marketHKFuture")&&(r.marketHKFuture=t.marketHKFuture),t.qotLogined!=null&&t.hasOwnProperty("qotLogined")&&(r.qotLogined=t.qotLogined),t.trdLogined!=null&&t.hasOwnProperty("trdLogined")&&(r.trdLogined=t.trdLogined),t.serverVer!=null&&t.hasOwnProperty("serverVer")&&(r.serverVer=t.serverVer),t.serverBuildNo!=null&&t.hasOwnProperty("serverBuildNo")&&(r.serverBuildNo=t.serverBuildNo),t.time!=null&&t.hasOwnProperty("time")&&(typeof t.time=="number"?r.time=e.longs===String?String(t.time):t.time:r.time=e.longs===String?s.Long.prototype.toString.call(t.time):e.longs===Number?new s.LongBits(t.time.low>>>0,t.time.high>>>0).toNumber():t.time),t.localTime!=null&&t.hasOwnProperty("localTime")&&(r.localTime=e.json&&!isFinite(t.localTime)?String(t.localTime):t.localTime),t.programStatus!=null&&t.hasOwnProperty("programStatus")&&(r.programStatus=i.Common.ProgramStatus.toObject(t.programStatus,e)),t.qotSvrIpAddr!=null&&t.hasOwnProperty("qotSvrIpAddr")&&(r.qotSvrIpAddr=t.qotSvrIpAddr),t.trdSvrIpAddr!=null&&t.hasOwnProperty("trdSvrIpAddr")&&(r.trdSvrIpAddr=t.trdSvrIpAddr),t.marketUSFuture!=null&&t.hasOwnProperty("marketUSFuture")&&(r.marketUSFuture=t.marketUSFuture),t.connID!=null&&t.hasOwnProperty("connID")&&(typeof t.connID=="number"?r.connID=e.longs===String?String(t.connID):t.connID:r.connID=e.longs===String?s.Long.prototype.toString.call(t.connID):e.longs===Number?new s.LongBits(t.connID.low>>>0,t.connID.high>>>0).toNumber(!0):t.connID),t.marketSGFuture!=null&&t.hasOwnProperty("marketSGFuture")&&(r.marketSGFuture=t.marketSGFuture),t.marketJPFuture!=null&&t.hasOwnProperty("marketJPFuture")&&(r.marketJPFuture=t.marketJPFuture),r},n.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},n.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/GetGlobalState.S2C"},n}(),c.Request=function(){function n(t){if(t)for(let e=Object.keys(t),r=0;r<e.length;++r)t[e[r]]!=null&&(this[e[r]]=t[e[r]])}return n.prototype.c2s=null,n.create=function(t){return new n(t)},n.encode=function(t,e){return e||(e=p.create()),i.