@hitrading/ctp-node 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -5
- package/README.zh-CN.md +12 -5
- package/binding.gyp +13 -13
- package/{tradeapi/macos/thostmduserapi_se.framework/Versions/A/Headers → ctpsdk}/ThostFtdcMdApi.h +2 -1
- package/{tradeapi/macos/thosttraderapi_se.framework/Versions/A/Headers → ctpsdk}/ThostFtdcTraderApi.h +133 -6
- package/{tradeapi/macos/thostmduserapi_se.framework/Versions/A/Headers → ctpsdk}/ThostFtdcUserApiDataType.h +199 -3
- package/{tradeapi/macos/thosttraderapi_se.framework/Versions/A/Headers → ctpsdk}/ThostFtdcUserApiStruct.h +1574 -12
- package/{tradeapi → ctpsdk}/error.xml +56 -11
- package/ctpsdk/linux/thostmduserapi_se.so +0 -0
- package/{tradeapi → ctpsdk}/linux/thosttraderapi_se.so +0 -0
- package/{tradeapi → ctpsdk/macos/thostmduserapi_se.framework/Versions/A/Headers}/ThostFtdcMdApi.h +1 -1
- package/{tradeapi → ctpsdk/macos/thostmduserapi_se.framework/Versions/A/Headers}/ThostFtdcUserApiDataType.h +35 -2
- package/{tradeapi → ctpsdk/macos/thostmduserapi_se.framework/Versions/A/Headers}/ThostFtdcUserApiStruct.h +121 -11
- package/{tradeapi → ctpsdk}/macos/thostmduserapi_se.framework/Versions/A/Resources/Info.plist +46 -46
- package/{tradeapi → ctpsdk}/macos/thostmduserapi_se.framework/Versions/A/_CodeSignature/CodeResources +149 -149
- package/{tradeapi → ctpsdk}/macos/thostmduserapi_se.framework/Versions/A/thostmduserapi_se +0 -0
- package/{tradeapi → ctpsdk/macos/thosttraderapi_se.framework/Versions/A/Headers}/ThostFtdcTraderApi.h +14 -2
- package/{tradeapi → ctpsdk}/macos/thosttraderapi_se.framework/Versions/A/Headers/ThostFtdcUserApiDataType.h +2123 -2090
- package/{tradeapi/macos/thostmduserapi_se.framework → ctpsdk/macos/thosttraderapi_se.framework}/Versions/A/Headers/ThostFtdcUserApiStruct.h +5596 -5486
- package/{tradeapi → ctpsdk}/macos/thosttraderapi_se.framework/Versions/A/Resources/Info.plist +46 -46
- package/{tradeapi → ctpsdk}/macos/thosttraderapi_se.framework/Versions/A/_CodeSignature/CodeResources +149 -149
- package/{tradeapi → ctpsdk}/macos/thosttraderapi_se.framework/Versions/A/thosttraderapi_se +0 -0
- package/ctpsdk/windows/thostmduserapi_se.dll +0 -0
- package/ctpsdk/windows/thostmduserapi_se.lib +0 -0
- package/ctpsdk/windows/thosttraderapi_se.dll +0 -0
- package/ctpsdk/windows/thosttraderapi_se.lib +0 -0
- package/dist/client.d.ts +4 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +7 -0
- package/dist/client.js.map +1 -1
- package/dist/generated/enums.gen.d.ts +76 -6
- package/dist/generated/enums.gen.d.ts.map +1 -1
- package/dist/generated/enums.gen.js +78 -0
- package/dist/generated/enums.gen.js.map +1 -1
- package/dist/generated/structs.gen.d.ts +6271 -4816
- package/dist/generated/structs.gen.d.ts.map +1 -1
- package/dist/generated/structs.gen.js +131 -25
- package/dist/generated/structs.gen.js.map +1 -1
- package/dist/generated/trader.gen.d.ts +39 -1
- package/dist/generated/trader.gen.d.ts.map +1 -1
- package/dist/generated/trader.gen.js +315 -225
- package/dist/generated/trader.gen.js.map +1 -1
- package/dist/index.cjs +594 -296
- package/dist/market-data.d.ts +10 -0
- package/dist/market-data.d.ts.map +1 -1
- package/dist/market-data.js +20 -0
- package/dist/market-data.js.map +1 -1
- package/dist/native-binding.js +1 -1
- package/dist/native-binding.js.map +1 -1
- package/dist/trader.d.ts +38 -30
- package/dist/trader.d.ts.map +1 -1
- package/dist/trader.js +39 -45
- package/dist/trader.js.map +1 -1
- package/package.json +7 -3
- package/prebuilds/linux-x64/@hitrading+ctp-node.node +0 -0
- package/prebuilds/linux-x64/thostmduserapi_se.so +0 -0
- package/prebuilds/linux-x64/thosttraderapi_se.so +0 -0
- package/prebuilds/win32-x64/@hitrading+ctp-node.node +0 -0
- package/prebuilds/win32-x64/thostmduserapi_se.dll +0 -0
- package/prebuilds/win32-x64/thosttraderapi_se.dll +0 -0
- package/src/client.ts +8 -0
- package/src/generated/enums.gen.ts +78 -0
- package/src/generated/layout.gen.cc +794 -40
- package/src/generated/structids.gen.h +54 -1
- package/src/generated/structs.gen.ts +6455 -4841
- package/src/generated/trader.gen.ts +315 -225
- package/src/generated/traderreq.gen.cc +84 -0
- package/src/generated/traderreq.gen.h +89 -75
- package/src/generated/traderspi.gen.cc +102 -0
- package/src/generated/traderspi.gen.h +198 -150
- package/src/market-data.ts +23 -0
- package/src/native/mdapi.cc +49 -2
- package/src/native/mdspi.cc +5 -1
- package/src/native/mdspi.h +4 -0
- package/src/native/risk.cc +50 -21
- package/src/native/risk.h +48 -8
- package/src/native/snapshot.h +61 -0
- package/src/native/traderapi.cc +11 -61
- package/src/native-binding.ts +1 -1
- package/src/trader.ts +55 -58
- package/tradeapi/linux/thostmduserapi_se.so +0 -0
- package/tradeapi/windows/thostmduserapi_se.dll +0 -0
- package/tradeapi/windows/thostmduserapi_se.lib +0 -0
- package/tradeapi/windows/thosttraderapi_se.dll +0 -0
- package/tradeapi/windows/thosttraderapi_se.lib +0 -0
- /package/{tradeapi → ctpsdk}/error.dtd +0 -0
|
@@ -1,149 +1,149 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>files</key>
|
|
6
|
-
<dict>
|
|
7
|
-
<key>Resources/Info.plist</key>
|
|
8
|
-
<data>
|
|
9
|
-
|
|
10
|
-
</data>
|
|
11
|
-
</dict>
|
|
12
|
-
<key>files2</key>
|
|
13
|
-
<dict>
|
|
14
|
-
<key>Headers/ThostFtdcMdApi.h</key>
|
|
15
|
-
<dict>
|
|
16
|
-
<key>hash2</key>
|
|
17
|
-
<data>
|
|
18
|
-
|
|
19
|
-
</data>
|
|
20
|
-
</dict>
|
|
21
|
-
<key>Headers/ThostFtdcUserApiDataType.h</key>
|
|
22
|
-
<dict>
|
|
23
|
-
<key>hash2</key>
|
|
24
|
-
<data>
|
|
25
|
-
|
|
26
|
-
</data>
|
|
27
|
-
</dict>
|
|
28
|
-
<key>Headers/ThostFtdcUserApiStruct.h</key>
|
|
29
|
-
<dict>
|
|
30
|
-
<key>hash2</key>
|
|
31
|
-
<data>
|
|
32
|
-
|
|
33
|
-
</data>
|
|
34
|
-
</dict>
|
|
35
|
-
<key>Resources/Info.plist</key>
|
|
36
|
-
<dict>
|
|
37
|
-
<key>hash2</key>
|
|
38
|
-
<data>
|
|
39
|
-
|
|
40
|
-
</data>
|
|
41
|
-
</dict>
|
|
42
|
-
</dict>
|
|
43
|
-
<key>rules</key>
|
|
44
|
-
<dict>
|
|
45
|
-
<key>^Resources/</key>
|
|
46
|
-
<true/>
|
|
47
|
-
<key>^Resources/.*\.lproj/</key>
|
|
48
|
-
<dict>
|
|
49
|
-
<key>optional</key>
|
|
50
|
-
<true/>
|
|
51
|
-
<key>weight</key>
|
|
52
|
-
<real>1000</real>
|
|
53
|
-
</dict>
|
|
54
|
-
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
|
55
|
-
<dict>
|
|
56
|
-
<key>omit</key>
|
|
57
|
-
<true/>
|
|
58
|
-
<key>weight</key>
|
|
59
|
-
<real>1100</real>
|
|
60
|
-
</dict>
|
|
61
|
-
<key>^Resources/Base\.lproj/</key>
|
|
62
|
-
<dict>
|
|
63
|
-
<key>weight</key>
|
|
64
|
-
<real>1010</real>
|
|
65
|
-
</dict>
|
|
66
|
-
<key>^version.plist$</key>
|
|
67
|
-
<true/>
|
|
68
|
-
</dict>
|
|
69
|
-
<key>rules2</key>
|
|
70
|
-
<dict>
|
|
71
|
-
<key>.*\.dSYM($|/)</key>
|
|
72
|
-
<dict>
|
|
73
|
-
<key>weight</key>
|
|
74
|
-
<real>11</real>
|
|
75
|
-
</dict>
|
|
76
|
-
<key>^(.*/)?\.DS_Store$</key>
|
|
77
|
-
<dict>
|
|
78
|
-
<key>omit</key>
|
|
79
|
-
<true/>
|
|
80
|
-
<key>weight</key>
|
|
81
|
-
<real>2000</real>
|
|
82
|
-
</dict>
|
|
83
|
-
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
|
|
84
|
-
<dict>
|
|
85
|
-
<key>nested</key>
|
|
86
|
-
<true/>
|
|
87
|
-
<key>weight</key>
|
|
88
|
-
<real>10</real>
|
|
89
|
-
</dict>
|
|
90
|
-
<key>^.*</key>
|
|
91
|
-
<true/>
|
|
92
|
-
<key>^Info\.plist$</key>
|
|
93
|
-
<dict>
|
|
94
|
-
<key>omit</key>
|
|
95
|
-
<true/>
|
|
96
|
-
<key>weight</key>
|
|
97
|
-
<real>20</real>
|
|
98
|
-
</dict>
|
|
99
|
-
<key>^PkgInfo$</key>
|
|
100
|
-
<dict>
|
|
101
|
-
<key>omit</key>
|
|
102
|
-
<true/>
|
|
103
|
-
<key>weight</key>
|
|
104
|
-
<real>20</real>
|
|
105
|
-
</dict>
|
|
106
|
-
<key>^Resources/</key>
|
|
107
|
-
<dict>
|
|
108
|
-
<key>weight</key>
|
|
109
|
-
<real>20</real>
|
|
110
|
-
</dict>
|
|
111
|
-
<key>^Resources/.*\.lproj/</key>
|
|
112
|
-
<dict>
|
|
113
|
-
<key>optional</key>
|
|
114
|
-
<true/>
|
|
115
|
-
<key>weight</key>
|
|
116
|
-
<real>1000</real>
|
|
117
|
-
</dict>
|
|
118
|
-
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
|
119
|
-
<dict>
|
|
120
|
-
<key>omit</key>
|
|
121
|
-
<true/>
|
|
122
|
-
<key>weight</key>
|
|
123
|
-
<real>1100</real>
|
|
124
|
-
</dict>
|
|
125
|
-
<key>^Resources/Base\.lproj/</key>
|
|
126
|
-
<dict>
|
|
127
|
-
<key>weight</key>
|
|
128
|
-
<real>1010</real>
|
|
129
|
-
</dict>
|
|
130
|
-
<key>^[^/]+$</key>
|
|
131
|
-
<dict>
|
|
132
|
-
<key>nested</key>
|
|
133
|
-
<true/>
|
|
134
|
-
<key>weight</key>
|
|
135
|
-
<real>10</real>
|
|
136
|
-
</dict>
|
|
137
|
-
<key>^embedded\.provisionprofile$</key>
|
|
138
|
-
<dict>
|
|
139
|
-
<key>weight</key>
|
|
140
|
-
<real>20</real>
|
|
141
|
-
</dict>
|
|
142
|
-
<key>^version\.plist$</key>
|
|
143
|
-
<dict>
|
|
144
|
-
<key>weight</key>
|
|
145
|
-
<real>20</real>
|
|
146
|
-
</dict>
|
|
147
|
-
</dict>
|
|
148
|
-
</dict>
|
|
149
|
-
</plist>
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>files</key>
|
|
6
|
+
<dict>
|
|
7
|
+
<key>Resources/Info.plist</key>
|
|
8
|
+
<data>
|
|
9
|
+
TOE+h5cJeWlDwmJo/Xo5uQQLWvU=
|
|
10
|
+
</data>
|
|
11
|
+
</dict>
|
|
12
|
+
<key>files2</key>
|
|
13
|
+
<dict>
|
|
14
|
+
<key>Headers/ThostFtdcMdApi.h</key>
|
|
15
|
+
<dict>
|
|
16
|
+
<key>hash2</key>
|
|
17
|
+
<data>
|
|
18
|
+
dEtokAKLUmXyqR3WtDgh7HH7BRJ3Cm9ej7AQVvby1Og=
|
|
19
|
+
</data>
|
|
20
|
+
</dict>
|
|
21
|
+
<key>Headers/ThostFtdcUserApiDataType.h</key>
|
|
22
|
+
<dict>
|
|
23
|
+
<key>hash2</key>
|
|
24
|
+
<data>
|
|
25
|
+
jeG/TAar2HshrQ9+4jkob94MKMFWLoH4Xl/HcKjIgww=
|
|
26
|
+
</data>
|
|
27
|
+
</dict>
|
|
28
|
+
<key>Headers/ThostFtdcUserApiStruct.h</key>
|
|
29
|
+
<dict>
|
|
30
|
+
<key>hash2</key>
|
|
31
|
+
<data>
|
|
32
|
+
E0WAQNGnhA4Om36nesySUQiOWRpOfovob8bEQ0DXibU=
|
|
33
|
+
</data>
|
|
34
|
+
</dict>
|
|
35
|
+
<key>Resources/Info.plist</key>
|
|
36
|
+
<dict>
|
|
37
|
+
<key>hash2</key>
|
|
38
|
+
<data>
|
|
39
|
+
W+Y03he/s8YHwth//OW4ntlb03j3ayTRQRuR+s23cWk=
|
|
40
|
+
</data>
|
|
41
|
+
</dict>
|
|
42
|
+
</dict>
|
|
43
|
+
<key>rules</key>
|
|
44
|
+
<dict>
|
|
45
|
+
<key>^Resources/</key>
|
|
46
|
+
<true/>
|
|
47
|
+
<key>^Resources/.*\.lproj/</key>
|
|
48
|
+
<dict>
|
|
49
|
+
<key>optional</key>
|
|
50
|
+
<true/>
|
|
51
|
+
<key>weight</key>
|
|
52
|
+
<real>1000</real>
|
|
53
|
+
</dict>
|
|
54
|
+
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
|
55
|
+
<dict>
|
|
56
|
+
<key>omit</key>
|
|
57
|
+
<true/>
|
|
58
|
+
<key>weight</key>
|
|
59
|
+
<real>1100</real>
|
|
60
|
+
</dict>
|
|
61
|
+
<key>^Resources/Base\.lproj/</key>
|
|
62
|
+
<dict>
|
|
63
|
+
<key>weight</key>
|
|
64
|
+
<real>1010</real>
|
|
65
|
+
</dict>
|
|
66
|
+
<key>^version.plist$</key>
|
|
67
|
+
<true/>
|
|
68
|
+
</dict>
|
|
69
|
+
<key>rules2</key>
|
|
70
|
+
<dict>
|
|
71
|
+
<key>.*\.dSYM($|/)</key>
|
|
72
|
+
<dict>
|
|
73
|
+
<key>weight</key>
|
|
74
|
+
<real>11</real>
|
|
75
|
+
</dict>
|
|
76
|
+
<key>^(.*/)?\.DS_Store$</key>
|
|
77
|
+
<dict>
|
|
78
|
+
<key>omit</key>
|
|
79
|
+
<true/>
|
|
80
|
+
<key>weight</key>
|
|
81
|
+
<real>2000</real>
|
|
82
|
+
</dict>
|
|
83
|
+
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
|
|
84
|
+
<dict>
|
|
85
|
+
<key>nested</key>
|
|
86
|
+
<true/>
|
|
87
|
+
<key>weight</key>
|
|
88
|
+
<real>10</real>
|
|
89
|
+
</dict>
|
|
90
|
+
<key>^.*</key>
|
|
91
|
+
<true/>
|
|
92
|
+
<key>^Info\.plist$</key>
|
|
93
|
+
<dict>
|
|
94
|
+
<key>omit</key>
|
|
95
|
+
<true/>
|
|
96
|
+
<key>weight</key>
|
|
97
|
+
<real>20</real>
|
|
98
|
+
</dict>
|
|
99
|
+
<key>^PkgInfo$</key>
|
|
100
|
+
<dict>
|
|
101
|
+
<key>omit</key>
|
|
102
|
+
<true/>
|
|
103
|
+
<key>weight</key>
|
|
104
|
+
<real>20</real>
|
|
105
|
+
</dict>
|
|
106
|
+
<key>^Resources/</key>
|
|
107
|
+
<dict>
|
|
108
|
+
<key>weight</key>
|
|
109
|
+
<real>20</real>
|
|
110
|
+
</dict>
|
|
111
|
+
<key>^Resources/.*\.lproj/</key>
|
|
112
|
+
<dict>
|
|
113
|
+
<key>optional</key>
|
|
114
|
+
<true/>
|
|
115
|
+
<key>weight</key>
|
|
116
|
+
<real>1000</real>
|
|
117
|
+
</dict>
|
|
118
|
+
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
|
119
|
+
<dict>
|
|
120
|
+
<key>omit</key>
|
|
121
|
+
<true/>
|
|
122
|
+
<key>weight</key>
|
|
123
|
+
<real>1100</real>
|
|
124
|
+
</dict>
|
|
125
|
+
<key>^Resources/Base\.lproj/</key>
|
|
126
|
+
<dict>
|
|
127
|
+
<key>weight</key>
|
|
128
|
+
<real>1010</real>
|
|
129
|
+
</dict>
|
|
130
|
+
<key>^[^/]+$</key>
|
|
131
|
+
<dict>
|
|
132
|
+
<key>nested</key>
|
|
133
|
+
<true/>
|
|
134
|
+
<key>weight</key>
|
|
135
|
+
<real>10</real>
|
|
136
|
+
</dict>
|
|
137
|
+
<key>^embedded\.provisionprofile$</key>
|
|
138
|
+
<dict>
|
|
139
|
+
<key>weight</key>
|
|
140
|
+
<real>20</real>
|
|
141
|
+
</dict>
|
|
142
|
+
<key>^version\.plist$</key>
|
|
143
|
+
<dict>
|
|
144
|
+
<key>weight</key>
|
|
145
|
+
<real>20</real>
|
|
146
|
+
</dict>
|
|
147
|
+
</dict>
|
|
148
|
+
</dict>
|
|
149
|
+
</plist>
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/////////////////////////////////////////////////////////////////////////
|
|
2
2
|
///@system 新一代交易所系统
|
|
3
3
|
///@company 上海期货信息技术有限公司
|
|
4
4
|
///@file ThostFtdcTraderApi.h
|
|
@@ -498,6 +498,9 @@ public:
|
|
|
498
498
|
|
|
499
499
|
///投资者产品RULE保证金查询响应
|
|
500
500
|
virtual void OnRspQryInvestorProdRULEMargin(CThostFtdcInvestorProdRULEMarginField *pInvestorProdRULEMargin, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
|
|
501
|
+
|
|
502
|
+
///投资者投资者新组保设置查询响应
|
|
503
|
+
virtual void OnRspQryInvestorPortfSetting(CThostFtdcInvestorPortfSettingField *pInvestorPortfSetting, CThostFtdcRspInfoField *pRspInfo, int nRequestID, bool bIsLast) {};
|
|
501
504
|
};
|
|
502
505
|
|
|
503
506
|
class TRADER_API_EXPORT CThostFtdcTraderApi
|
|
@@ -529,6 +532,12 @@ public:
|
|
|
529
532
|
///@remark 只有登录成功后,才能得到正确的交易日
|
|
530
533
|
virtual const char *GetTradingDay() = 0;
|
|
531
534
|
|
|
535
|
+
///获取已连接的前置的信息
|
|
536
|
+
/// @param pFrontInfo:输入输出参数,用于存储获取到的前置信息,不能为空
|
|
537
|
+
/// @remark 连接成功后,可获取正确的前置地址信息
|
|
538
|
+
/// @remark 登录成功后,可获取正确的前置流控信息
|
|
539
|
+
virtual void GetFrontInfo(CThostFtdcFrontInfoField* pFrontInfo) =0;
|
|
540
|
+
|
|
532
541
|
///注册前置机网络地址
|
|
533
542
|
///@param pszFrontAddress:前置机网络地址。
|
|
534
543
|
///@remark 网络地址的格式为:“protocol://ipaddress:port”,如:”tcp://127.0.0.1:17001”。
|
|
@@ -579,7 +588,7 @@ public:
|
|
|
579
588
|
virtual int SubmitUserSystemInfo(CThostFtdcUserSystemInfoField *pUserSystemInfo) = 0;
|
|
580
589
|
|
|
581
590
|
///用户登录请求
|
|
582
|
-
virtual int ReqUserLogin(CThostFtdcReqUserLoginField *pReqUserLoginField, int nRequestID) = 0;
|
|
591
|
+
virtual int ReqUserLogin(CThostFtdcReqUserLoginField *pReqUserLoginField, int nRequestID, TThostFtdcSystemInfoLenType length, TThostFtdcClientSystemInfoType systemInfo) = 0;
|
|
583
592
|
|
|
584
593
|
///登出请求
|
|
585
594
|
virtual int ReqUserLogout(CThostFtdcUserLogoutField *pUserLogout, int nRequestID) = 0;
|
|
@@ -907,6 +916,9 @@ public:
|
|
|
907
916
|
|
|
908
917
|
///投资者产品RULE保证金查询
|
|
909
918
|
virtual int ReqQryInvestorProdRULEMargin(CThostFtdcQryInvestorProdRULEMarginField *pQryInvestorProdRULEMargin, int nRequestID) = 0;
|
|
919
|
+
|
|
920
|
+
///投资者投资者新组保设置查询
|
|
921
|
+
virtual int ReqQryInvestorPortfSetting(CThostFtdcQryInvestorPortfSettingField *pQryInvestorPortfSetting, int nRequestID) = 0;
|
|
910
922
|
protected:
|
|
911
923
|
~CThostFtdcTraderApi(){};
|
|
912
924
|
};
|