@tigeropenapi/tigeropen 0.4.6 → 0.4.7

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.
@@ -30,6 +30,7 @@ const TIGER_PUBLIC_KEY = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDNF3G8SoEcCZh2rs
30
30
  const ENV_TIGER_ID = 'TIGEROPEN_TIGER_ID';
31
31
  const ENV_PRIVATE_KEY = 'TIGEROPEN_PRIVATE_KEY';
32
32
  const ENV_ACCOUNT = 'TIGEROPEN_ACCOUNT';
33
+ const ENV_SECRET_KEY = 'TIGEROPEN_SECRET_KEY';
33
34
  const ENV_TOKEN = 'TIGEROPEN_TOKEN';
34
35
  const ENV_TOKEN_FILE = 'TIGEROPEN_TOKEN_FILE';
35
36
  /**
@@ -128,6 +129,7 @@ function createClientConfig(options) {
128
129
  let tigerId = opts.tigerId || fileProps['tiger_id'] || '';
129
130
  let privateKey = opts.privateKey || resolvePrivateKey(fileProps) || '';
130
131
  let account = opts.account || fileProps['account'] || '';
132
+ let secretKey = opts.secretKey || fileProps['secret_key'] || undefined;
131
133
  let token = opts.token || fileProps['token'];
132
134
  const license = opts.license || fileProps['license'];
133
135
  const language = opts.language || fileProps['language'] || DEFAULT_LANGUAGE;
@@ -136,6 +138,7 @@ function createClientConfig(options) {
136
138
  const envTigerId = process.env[ENV_TIGER_ID];
137
139
  const envPrivateKey = process.env[ENV_PRIVATE_KEY];
138
140
  const envAccount = process.env[ENV_ACCOUNT];
141
+ const envSecretKey = process.env[ENV_SECRET_KEY];
139
142
  const envToken = process.env[ENV_TOKEN];
140
143
  if (envTigerId) {
141
144
  tigerId = envTigerId;
@@ -146,6 +149,9 @@ function createClientConfig(options) {
146
149
  if (envAccount) {
147
150
  account = envAccount;
148
151
  }
152
+ if (envSecretKey) {
153
+ secretKey = envSecretKey;
154
+ }
149
155
  if (envToken) {
150
156
  token = envToken;
151
157
  }
@@ -215,6 +221,7 @@ function createClientConfig(options) {
215
221
  tigerId,
216
222
  privateKey,
217
223
  account,
224
+ secretKey: secretKey || undefined,
218
225
  license,
219
226
  language,
220
227
  timezone,
@@ -26,6 +26,7 @@ const TIGER_PUBLIC_KEY = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDNF3G8SoEcCZh2rs
26
26
  const ENV_TIGER_ID = 'TIGEROPEN_TIGER_ID';
27
27
  const ENV_PRIVATE_KEY = 'TIGEROPEN_PRIVATE_KEY';
28
28
  const ENV_ACCOUNT = 'TIGEROPEN_ACCOUNT';
29
+ const ENV_SECRET_KEY = 'TIGEROPEN_SECRET_KEY';
29
30
  const ENV_TOKEN = 'TIGEROPEN_TOKEN';
30
31
  const ENV_TOKEN_FILE = 'TIGEROPEN_TOKEN_FILE';
31
32
  /**
@@ -124,6 +125,7 @@ export function createClientConfig(options) {
124
125
  let tigerId = opts.tigerId || fileProps['tiger_id'] || '';
125
126
  let privateKey = opts.privateKey || resolvePrivateKey(fileProps) || '';
126
127
  let account = opts.account || fileProps['account'] || '';
128
+ let secretKey = opts.secretKey || fileProps['secret_key'] || undefined;
127
129
  let token = opts.token || fileProps['token'];
128
130
  const license = opts.license || fileProps['license'];
129
131
  const language = opts.language || fileProps['language'] || DEFAULT_LANGUAGE;
@@ -132,6 +134,7 @@ export function createClientConfig(options) {
132
134
  const envTigerId = process.env[ENV_TIGER_ID];
133
135
  const envPrivateKey = process.env[ENV_PRIVATE_KEY];
134
136
  const envAccount = process.env[ENV_ACCOUNT];
137
+ const envSecretKey = process.env[ENV_SECRET_KEY];
135
138
  const envToken = process.env[ENV_TOKEN];
136
139
  if (envTigerId) {
137
140
  tigerId = envTigerId;
@@ -142,6 +145,9 @@ export function createClientConfig(options) {
142
145
  if (envAccount) {
143
146
  account = envAccount;
144
147
  }
148
+ if (envSecretKey) {
149
+ secretKey = envSecretKey;
150
+ }
145
151
  if (envToken) {
146
152
  token = envToken;
147
153
  }
@@ -211,6 +217,7 @@ export function createClientConfig(options) {
211
217
  tigerId,
212
218
  privateKey,
213
219
  account,
220
+ secretKey: secretKey || undefined,
214
221
  license,
215
222
  language,
216
223
  timezone,
@@ -3,6 +3,8 @@ export interface ClientConfig {
3
3
  tigerId: string;
4
4
  privateKey: string;
5
5
  account: string;
6
+ /** Institution secret key for trade authentication (institution accounts only) */
7
+ secretKey?: string;
6
8
  license?: string;
7
9
  language: string;
8
10
  timezone?: string;
@@ -27,6 +29,8 @@ export interface ClientConfigOptions {
27
29
  tigerId?: string;
28
30
  privateKey?: string;
29
31
  account?: string;
32
+ /** Institution secret key for trade authentication (institution accounts only) */
33
+ secretKey?: string;
30
34
  license?: string;
31
35
  language?: string;
32
36
  timezone?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tigeropenapi/tigeropen",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "Tiger Brokers OpenAPI TypeScript SDK for market data, trading, and real-time push",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",