@hitrading/ctp-node 4.1.3-rc.1 → 4.1.3
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/CHANGELOG.md +15 -0
- package/README.md +2 -2
- package/README.zh-CN.md +2 -2
- package/RELEASING.md +1 -3
- package/ctpsdk/macos/thostmduserapi_se.framework/Versions/A/Headers/ThostFtdcMdApi.h +2 -1
- package/ctpsdk/macos/thostmduserapi_se.framework/Versions/A/Headers/ThostFtdcUserApiDataType.h +170 -7
- package/ctpsdk/macos/thostmduserapi_se.framework/Versions/A/Headers/ThostFtdcUserApiStruct.h +1485 -33
- package/ctpsdk/macos/thostmduserapi_se.framework/Versions/A/Resources/demo.txt +58 -0
- package/ctpsdk/macos/thostmduserapi_se.framework/Versions/A/Resources/package.des +14 -0
- package/ctpsdk/macos/thostmduserapi_se.framework/Versions/A/Resources/readme.txt +2 -0
- package/ctpsdk/macos/thostmduserapi_se.framework/Versions/A/_CodeSignature/CodeResources +36 -3
- package/ctpsdk/macos/thostmduserapi_se.framework/Versions/A/thostmduserapi_se +0 -0
- package/ctpsdk/macos/thosttraderapi_se.framework/Versions/A/Headers/ThostFtdcTraderApi.h +121 -7
- package/ctpsdk/macos/thosttraderapi_se.framework/Versions/A/Headers/ThostFtdcUserApiDataType.h +170 -7
- package/ctpsdk/macos/thosttraderapi_se.framework/Versions/A/Headers/ThostFtdcUserApiStruct.h +1485 -33
- package/ctpsdk/macos/thosttraderapi_se.framework/Versions/A/Resources/demo.txt +58 -0
- package/ctpsdk/macos/thosttraderapi_se.framework/Versions/A/Resources/package.des +14 -0
- package/ctpsdk/macos/thosttraderapi_se.framework/Versions/A/Resources/readme.txt +2 -0
- package/ctpsdk/macos/thosttraderapi_se.framework/Versions/A/_CodeSignature/CodeResources +36 -3
- package/ctpsdk/macos/thosttraderapi_se.framework/Versions/A/thosttraderapi_se +0 -0
- package/docs/API.md +4 -5
- package/docs/API.zh-CN.md +3 -3
- package/docs/MIGRATION.md +6 -6
- package/docs/troubleshooting.md +2 -2
- package/docs/troubleshooting.zh-CN.md +2 -2
- package/package.json +1 -1
- package/prebuilds/win32-x64/@hitrading+ctp-node.node +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
int main(void)
|
|
2
|
+
{
|
|
3
|
+
unsigned char aucAesInPutData[273] = { 0 };
|
|
4
|
+
|
|
5
|
+
aucAesInPutData[0] = 1;
|
|
6
|
+
aucAesInPutData[1] = '0';
|
|
7
|
+
aucAesInPutData[2] = 3;
|
|
8
|
+
aucAesInPutData[3] = 4;
|
|
9
|
+
aucAesInPutData[4] = 5;
|
|
10
|
+
aucAesInPutData[5] = 6;
|
|
11
|
+
aucAesInPutData[7] = 9;
|
|
12
|
+
|
|
13
|
+
memcpy(aucAesInPutData + 8, "HDWDWADHAWNO@DHNAOIDAWOD@DADA", strlen("HDWDWADHAWNO@DHNAOIDAWOD@DADA"));
|
|
14
|
+
|
|
15
|
+
int reallen = 8 + strlen("HDWDWADHAWNO@DHNAOIDAWOD@DADA");
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
unsigned char aucAesEncodeData[273] = { 0 };
|
|
24
|
+
unsigned char aucAeskey[17] = { 0 };
|
|
25
|
+
GetComm128BitsAesKey(aucAeskey);
|
|
26
|
+
|
|
27
|
+
AES_KEY aes;
|
|
28
|
+
|
|
29
|
+
int result = AES_set_encrypt_key(aucAeskey, 128, &aes);//设置加密密钥
|
|
30
|
+
if (result < 0)//如果设置失败,退出
|
|
31
|
+
return -1;
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
reallen = (16 - reallen % 16) + reallen;
|
|
35
|
+
|
|
36
|
+
for (int i = 0; i < reallen / 16; ++i)
|
|
37
|
+
{
|
|
38
|
+
AES_ecb_encrypt((unsigned char*)(aucAesInPutData + 16 * i), aucAesEncodeData + 16 * i, &aes, AES_ENCRYPT);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
result = AES_set_decrypt_key(aucAeskey, 128, &aes);//设置加密密钥
|
|
44
|
+
if (result < 0)//如果设置失败,退出
|
|
45
|
+
return -1;
|
|
46
|
+
unsigned char aucAesOutData[273] = { 0 };
|
|
47
|
+
|
|
48
|
+
for (int i = 0; i < reallen / 16; ++i)
|
|
49
|
+
{
|
|
50
|
+
AES_ecb_encrypt((unsigned char*)(aucAesEncodeData + 16 * i), aucAesOutData + 16 * i, &aes, AES_DECRYPT);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
return 0;
|
|
58
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="gb2312"?>
|
|
2
|
+
<!DOCTYPE packageDefine SYSTEM "C:\amake\package.dtd">
|
|
3
|
+
<packageDefine name="CommAesKey" version="1" type="cpp" includedir="." platform="all">
|
|
4
|
+
<parameter/>
|
|
5
|
+
<depend>
|
|
6
|
+
</depend>
|
|
7
|
+
<cppfile>
|
|
8
|
+
<file name="CommAesKey.cpp"/>
|
|
9
|
+
</cppfile>
|
|
10
|
+
<headfile>
|
|
11
|
+
<file name="CommAesKey.h"/>
|
|
12
|
+
</headfile>
|
|
13
|
+
<command/>
|
|
14
|
+
</packageDefine>
|
|
@@ -8,6 +8,18 @@
|
|
|
8
8
|
<data>
|
|
9
9
|
VUxdF9Vsqsjm2nN6RDpWJxe/ttg=
|
|
10
10
|
</data>
|
|
11
|
+
<key>Resources/demo.txt</key>
|
|
12
|
+
<data>
|
|
13
|
+
6rxOq+3qQg1borsuR7Ac321LS+E=
|
|
14
|
+
</data>
|
|
15
|
+
<key>Resources/package.des</key>
|
|
16
|
+
<data>
|
|
17
|
+
jrbZMIOlX3HAhwEAlKH6eoboUTE=
|
|
18
|
+
</data>
|
|
19
|
+
<key>Resources/readme.txt</key>
|
|
20
|
+
<data>
|
|
21
|
+
87xms+eK0V0empcfgo58JvOJZrc=
|
|
22
|
+
</data>
|
|
11
23
|
</dict>
|
|
12
24
|
<key>files2</key>
|
|
13
25
|
<dict>
|
|
@@ -15,21 +27,21 @@
|
|
|
15
27
|
<dict>
|
|
16
28
|
<key>hash2</key>
|
|
17
29
|
<data>
|
|
18
|
-
|
|
30
|
+
CUGGj4827GSKJrXca19TmDIRtHKxo44v1+voQZPIqeo=
|
|
19
31
|
</data>
|
|
20
32
|
</dict>
|
|
21
33
|
<key>Headers/ThostFtdcUserApiDataType.h</key>
|
|
22
34
|
<dict>
|
|
23
35
|
<key>hash2</key>
|
|
24
36
|
<data>
|
|
25
|
-
|
|
37
|
+
g4JFK88Lt2FgJODNwoC7123C6Ak3xx9PwK3oCcvvY+c=
|
|
26
38
|
</data>
|
|
27
39
|
</dict>
|
|
28
40
|
<key>Headers/ThostFtdcUserApiStruct.h</key>
|
|
29
41
|
<dict>
|
|
30
42
|
<key>hash2</key>
|
|
31
43
|
<data>
|
|
32
|
-
|
|
44
|
+
VrO9rvXwzJ3b9d8xx+CJ+pklJVMSCofxkkFeS+Qua/c=
|
|
33
45
|
</data>
|
|
34
46
|
</dict>
|
|
35
47
|
<key>Resources/Info.plist</key>
|
|
@@ -39,6 +51,27 @@
|
|
|
39
51
|
WyUVnuil9tugvcHJcCw76ljlp1tONfIfxoKvod2ek+k=
|
|
40
52
|
</data>
|
|
41
53
|
</dict>
|
|
54
|
+
<key>Resources/demo.txt</key>
|
|
55
|
+
<dict>
|
|
56
|
+
<key>hash2</key>
|
|
57
|
+
<data>
|
|
58
|
+
Sv/7zVEvIJxPhI6ykmfoynT9luvqXVqastUUyaNWfdg=
|
|
59
|
+
</data>
|
|
60
|
+
</dict>
|
|
61
|
+
<key>Resources/package.des</key>
|
|
62
|
+
<dict>
|
|
63
|
+
<key>hash2</key>
|
|
64
|
+
<data>
|
|
65
|
+
JjdY5xqmxTc+E5YJvqbOVaT+iSdofhuurOan2GO5Eg8=
|
|
66
|
+
</data>
|
|
67
|
+
</dict>
|
|
68
|
+
<key>Resources/readme.txt</key>
|
|
69
|
+
<dict>
|
|
70
|
+
<key>hash2</key>
|
|
71
|
+
<data>
|
|
72
|
+
O9VEXNXxOJY5+eHYiEBPMYxtGDk0l/iJMVZqtSc/sK0=
|
|
73
|
+
</data>
|
|
74
|
+
</dict>
|
|
42
75
|
</dict>
|
|
43
76
|
<key>rules</key>
|
|
44
77
|
<dict>
|
|
Binary file
|
package/docs/API.md
CHANGED
|
@@ -37,11 +37,10 @@ npm install @hitrading/ctp-node
|
|
|
37
37
|
|
|
38
38
|
Supported Node.js release lines are `^22.22.2 || ^24.15.0 || >=26.0.0`, matching
|
|
39
39
|
the bundled node-gyp 13 requirement. Prebuilt binaries ship in the npm package
|
|
40
|
-
for win32-x64 and linux-x64. macOS
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
(a C++ toolchain + Python are required).
|
|
40
|
+
for win32-x64 and linux-x64. macOS and other platforms build from source on
|
|
41
|
+
install (a C++ toolchain + Python are required; on macOS, the Xcode Command Line
|
|
42
|
+
Tools). The bundled CTP macOS frameworks are the universal 6.7.13 build, the
|
|
43
|
+
same CTP version as the Windows/Linux libraries.
|
|
45
44
|
|
|
46
45
|
---
|
|
47
46
|
|
package/docs/API.zh-CN.md
CHANGED
|
@@ -34,9 +34,9 @@ npm install @hitrading/ctp-node
|
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
支持的 Node.js 版本线为 `^22.22.2 || ^24.15.0 || >=26.0.0`,与内置 node-gyp 13 的要求一致。
|
|
37
|
-
npm 包提供 win32-x64 与 linux-x64
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
npm 包提供 win32-x64 与 linux-x64 预编译二进制;macOS 及其他平台在安装时从源码编译,需要
|
|
38
|
+
C++ 工具链与 Python(macOS 上为 Xcode Command Line Tools)。随包的 CTP macOS 框架是 6.7.13 通用版,
|
|
39
|
+
与 Windows/Linux 库是同一 CTP 版本。
|
|
40
40
|
|
|
41
41
|
---
|
|
42
42
|
|
package/docs/MIGRATION.md
CHANGED
|
@@ -48,11 +48,11 @@ and margin schedule for an instrument have arrived (call `session()` or the
|
|
|
48
48
|
|
|
49
49
|
## Platform / toolchain
|
|
50
50
|
|
|
51
|
-
- **macOS** is no longer shipped as a prebuild
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
- **macOS** is no longer shipped as a prebuild — it builds from source on
|
|
52
|
+
install (Windows and Linux prebuilds are unchanged). Use a release that
|
|
53
|
+
bundles the 6.7.13 Mac frameworks (4.1.3-rc.2 or later): from 1.2.0 the
|
|
54
|
+
bundled CTP macOS frameworks were still 6.7.7 under the 6.7.13 headers, so a
|
|
55
|
+
macOS source build linked but crashed at runtime (4.1.3-rc.1 refused to build
|
|
56
|
+
instead).
|
|
57
57
|
- **Node `engines`** is restricted to the range required by `node-gyp` 13
|
|
58
58
|
(`^22.22.2 || ^24.15.0 || >=26.0.0`); Node 20 and older 22 lines are excluded.
|
package/docs/troubleshooting.md
CHANGED
|
@@ -218,8 +218,8 @@ CTP reconnects on its own — re-run your handshake **in place** on every
|
|
|
218
218
|
| `LNK1104: cannot open file ... ctp.node` | a wedged/zombie `node` process still holds the addon | find and `taskkill /F` the stray node process, then rebuild. |
|
|
219
219
|
| `fatal error LNK1103: 调试信息损坏` | stale/corrupt build object (e.g. interrupted/parallel build) | `npx node-gyp rebuild` (clean rebuild). |
|
|
220
220
|
| `MODULE_NOT_FOUND: node-addon-api` on a consumer install | source build with the build deps missing | fixed — `node-addon-api`/`node-gyp` are runtime `dependencies`; on an unshipped platform a C++ toolchain + Python are still required. |
|
|
221
|
-
| macOS install
|
|
222
|
-
| `.node` won't load on linux arm64 | no prebuild for that platform | it builds from source on install; ensure a toolchain is present. |
|
|
221
|
+
| macOS: segfault on the first API call (e.g. creating `MarketData`), or install stops with `ctp-node: refusing to build on macOS - CTP SDK version mismatch` | 1.2.0 through 4.1.3-rc.1 bundled CTP 6.7.7 macOS frameworks under the 6.7.13 headers; the build links (`-undefined dynamic_lookup`) but the factory functions and vtables don't match (4.1.3-rc.1 refuses to build instead) | upgrade to a release that bundles the 6.7.13 Mac frameworks (4.1.3-rc.2 or later) and reinstall so the addon is rebuilt. |
|
|
222
|
+
| `.node` won't load on macOS / linux arm64 | no prebuild for that platform | it builds from source on install; ensure a toolchain is present (macOS: Xcode Command Line Tools). |
|
|
223
223
|
| C4819 codepage warning during build | Chinese comments in `.cc` under a GBK code page | harmless; ignore. |
|
|
224
224
|
|
|
225
225
|
---
|
|
@@ -183,8 +183,8 @@ npm run bench:fullmarket
|
|
|
183
183
|
| `LNK1104: cannot open file ... ctp.node` | 一个卡死/僵尸 `node` 进程还占着该插件 | 找到并 `taskkill /F` 掉游离的 node 进程,再重新构建。 |
|
|
184
184
|
| `fatal error LNK1103: 调试信息损坏` | 陈旧/损坏的构建产物(如被中断/并行构建) | `npx node-gyp rebuild`(干净重建)。 |
|
|
185
185
|
| 使用方安装时 `MODULE_NOT_FOUND: node-addon-api` | 源码构建但缺构建依赖 | 已修复——`node-addon-api`/`node-gyp` 是运行时 `dependencies`;在未预编译的平台上仍需 C++ 工具链 + Python。 |
|
|
186
|
-
| macOS
|
|
187
|
-
| linux arm64 上 `.node` 加载失败 | 该平台无预编译 |
|
|
186
|
+
| macOS:首次调用 API(如创建 `MarketData`)就段错误,或安装时报 `ctp-node: refusing to build on macOS - CTP SDK version mismatch` | 1.2.0 至 4.1.3-rc.1 随包的是 CTP 6.7.7 macOS 框架,头文件却是 6.7.13;能链接(`-undefined dynamic_lookup`),但工厂函数和虚表对不上(4.1.3-rc.1 改为直接中止构建) | 升级到带 6.7.13 Mac 框架的版本(4.1.3-rc.2 及以后)并重新安装,让插件重新编译。 |
|
|
187
|
+
| macOS / linux arm64 上 `.node` 加载失败 | 该平台无预编译 | 安装时从源码构建;确保有工具链(macOS:Xcode Command Line Tools)。 |
|
|
188
188
|
| 构建时 C4819 代码页警告 | GBK 代码页下 `.cc` 里的中文注释 | 无害;忽略。 |
|
|
189
189
|
|
|
190
190
|
---
|
package/package.json
CHANGED
|
Binary file
|