@stockfind/twelve-data 0.1.0 → 0.2.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/package.json +14 -8
- package/dist/index.cjs +0 -83
- package/dist/index.d.cts +0 -108
- package/dist/index.d.mts +0 -108
- package/dist/index.d.ts +0 -108
- package/dist/index.mjs +0 -80
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stockfind/twelve-data",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "TypeScript SDK for the Twelve Data financial API",
|
|
6
6
|
"author": "Ru Chern CHONG <ruchern.chong@stockfind.app>",
|
|
7
7
|
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/stockfind/twelve-data.git"
|
|
11
|
+
},
|
|
8
12
|
"main": "./dist/index.cjs",
|
|
9
13
|
"module": "./dist/index.mjs",
|
|
10
14
|
"types": "./dist/index.d.ts",
|
|
@@ -23,6 +27,13 @@
|
|
|
23
27
|
"files": [
|
|
24
28
|
"dist"
|
|
25
29
|
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "unbuild",
|
|
32
|
+
"check": "biome check",
|
|
33
|
+
"format": "biome check --write",
|
|
34
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
35
|
+
"prepare": "husky"
|
|
36
|
+
},
|
|
26
37
|
"devDependencies": {
|
|
27
38
|
"@biomejs/biome": "^2.4.6",
|
|
28
39
|
"@commitlint/cli": "^20.4.3",
|
|
@@ -40,10 +51,5 @@
|
|
|
40
51
|
"biome check --write --no-errors-on-unmatched"
|
|
41
52
|
]
|
|
42
53
|
},
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
"check": "biome check",
|
|
46
|
-
"format": "biome check --write",
|
|
47
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
54
|
+
"packageManager": "pnpm@10.30.3"
|
|
55
|
+
}
|
package/dist/index.cjs
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
class MarketDataEndpoints {
|
|
4
|
-
constructor(http) {
|
|
5
|
-
this.http = http;
|
|
6
|
-
}
|
|
7
|
-
timeSeries(params) {
|
|
8
|
-
return this.http.get("/time_series", params);
|
|
9
|
-
}
|
|
10
|
-
quote(params) {
|
|
11
|
-
return this.http.get("/quote", params);
|
|
12
|
-
}
|
|
13
|
-
price(params) {
|
|
14
|
-
return this.http.get("/price", params);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
class TwelveDataError extends Error {
|
|
19
|
-
code;
|
|
20
|
-
status;
|
|
21
|
-
constructor(message, code) {
|
|
22
|
-
super(message);
|
|
23
|
-
this.name = "TwelveDataError";
|
|
24
|
-
this.code = code;
|
|
25
|
-
this.status = "error";
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
class HttpClient {
|
|
30
|
-
baseUrl;
|
|
31
|
-
apiKey;
|
|
32
|
-
timeout;
|
|
33
|
-
constructor(apiKey, baseUrl, timeout) {
|
|
34
|
-
this.apiKey = apiKey;
|
|
35
|
-
this.baseUrl = baseUrl;
|
|
36
|
-
this.timeout = timeout;
|
|
37
|
-
}
|
|
38
|
-
async get(path, params = {}) {
|
|
39
|
-
const url = new URL(path, this.baseUrl);
|
|
40
|
-
for (const [key, value] of Object.entries(
|
|
41
|
-
params
|
|
42
|
-
)) {
|
|
43
|
-
if (value !== void 0) {
|
|
44
|
-
url.searchParams.set(key, String(value));
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
const controller = new AbortController();
|
|
48
|
-
const timer = setTimeout(() => controller.abort(), this.timeout);
|
|
49
|
-
let response;
|
|
50
|
-
try {
|
|
51
|
-
response = await fetch(url.toString(), {
|
|
52
|
-
headers: { Authorization: `apikey ${this.apiKey}` },
|
|
53
|
-
signal: controller.signal
|
|
54
|
-
});
|
|
55
|
-
} finally {
|
|
56
|
-
clearTimeout(timer);
|
|
57
|
-
}
|
|
58
|
-
const body = await response.json();
|
|
59
|
-
if (body.status === "error") {
|
|
60
|
-
throw new TwelveDataError(
|
|
61
|
-
body.message ?? "Unknown error",
|
|
62
|
-
body.code ?? response.status
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
return body;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
class TwelveData {
|
|
70
|
-
marketData;
|
|
71
|
-
http;
|
|
72
|
-
constructor(config) {
|
|
73
|
-
this.http = new HttpClient(
|
|
74
|
-
config.apiKey,
|
|
75
|
-
config.baseUrl ?? "https://api.twelvedata.com",
|
|
76
|
-
config.timeout ?? 3e4
|
|
77
|
-
);
|
|
78
|
-
this.marketData = new MarketDataEndpoints(this.http);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
exports.TwelveData = TwelveData;
|
|
83
|
-
exports.TwelveDataError = TwelveDataError;
|
package/dist/index.d.cts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
declare class HttpClient {
|
|
2
|
-
private baseUrl;
|
|
3
|
-
private apiKey;
|
|
4
|
-
private timeout;
|
|
5
|
-
constructor(apiKey: string, baseUrl: string, timeout: number);
|
|
6
|
-
get<T>(path: string, params?: object): Promise<T>;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
type Interval = "1min" | "5min" | "15min" | "30min" | "45min" | "1h" | "2h" | "4h" | "1day" | "1week" | "1month";
|
|
10
|
-
interface TwelveDataConfig {
|
|
11
|
-
apiKey: string;
|
|
12
|
-
baseUrl?: string;
|
|
13
|
-
timeout?: number;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface TimeSeriesParams {
|
|
17
|
-
symbol: string;
|
|
18
|
-
interval: Interval;
|
|
19
|
-
outputsize?: number;
|
|
20
|
-
start_date?: string;
|
|
21
|
-
end_date?: string;
|
|
22
|
-
timezone?: string;
|
|
23
|
-
format?: "JSON" | "CSV";
|
|
24
|
-
}
|
|
25
|
-
interface TimeSeriesValue {
|
|
26
|
-
datetime: string;
|
|
27
|
-
open: string;
|
|
28
|
-
high: string;
|
|
29
|
-
low: string;
|
|
30
|
-
close: string;
|
|
31
|
-
volume?: string;
|
|
32
|
-
}
|
|
33
|
-
interface TimeSeriesResponse {
|
|
34
|
-
meta: {
|
|
35
|
-
symbol: string;
|
|
36
|
-
interval: string;
|
|
37
|
-
currency: string;
|
|
38
|
-
exchange_timezone: string;
|
|
39
|
-
exchange: string;
|
|
40
|
-
mic_code: string;
|
|
41
|
-
type: string;
|
|
42
|
-
};
|
|
43
|
-
values: TimeSeriesValue[];
|
|
44
|
-
status: string;
|
|
45
|
-
}
|
|
46
|
-
interface QuoteParams {
|
|
47
|
-
symbol: string;
|
|
48
|
-
interval?: Interval;
|
|
49
|
-
eod?: boolean;
|
|
50
|
-
rolling_period?: number;
|
|
51
|
-
}
|
|
52
|
-
interface QuoteResponse {
|
|
53
|
-
symbol: string;
|
|
54
|
-
name: string;
|
|
55
|
-
exchange: string;
|
|
56
|
-
mic_code: string;
|
|
57
|
-
currency: string;
|
|
58
|
-
datetime: string;
|
|
59
|
-
timestamp: number;
|
|
60
|
-
open: string;
|
|
61
|
-
high: string;
|
|
62
|
-
low: string;
|
|
63
|
-
close: string;
|
|
64
|
-
volume: string;
|
|
65
|
-
previous_close: string;
|
|
66
|
-
change: string;
|
|
67
|
-
percent_change: string;
|
|
68
|
-
average_volume: string;
|
|
69
|
-
is_market_open: boolean;
|
|
70
|
-
fifty_two_week: {
|
|
71
|
-
low: string;
|
|
72
|
-
high: string;
|
|
73
|
-
low_change: string;
|
|
74
|
-
high_change: string;
|
|
75
|
-
low_change_percent: string;
|
|
76
|
-
high_change_percent: string;
|
|
77
|
-
range: string;
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
interface PriceParams {
|
|
81
|
-
symbol: string;
|
|
82
|
-
format?: "JSON" | "CSV";
|
|
83
|
-
}
|
|
84
|
-
interface PriceResponse {
|
|
85
|
-
price: string;
|
|
86
|
-
}
|
|
87
|
-
declare class MarketDataEndpoints {
|
|
88
|
-
private http;
|
|
89
|
-
constructor(http: HttpClient);
|
|
90
|
-
timeSeries(params: TimeSeriesParams): Promise<TimeSeriesResponse>;
|
|
91
|
-
quote(params: QuoteParams): Promise<QuoteResponse>;
|
|
92
|
-
price(params: PriceParams): Promise<PriceResponse>;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
declare class TwelveData {
|
|
96
|
-
readonly marketData: MarketDataEndpoints;
|
|
97
|
-
private http;
|
|
98
|
-
constructor(config: TwelveDataConfig);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
declare class TwelveDataError extends Error {
|
|
102
|
-
code: number;
|
|
103
|
-
status: "error";
|
|
104
|
-
constructor(message: string, code: number);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export { TwelveData, TwelveDataError };
|
|
108
|
-
export type { Interval, PriceParams, PriceResponse, QuoteParams, QuoteResponse, TimeSeriesParams, TimeSeriesResponse, TimeSeriesValue, TwelveDataConfig };
|
package/dist/index.d.mts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
declare class HttpClient {
|
|
2
|
-
private baseUrl;
|
|
3
|
-
private apiKey;
|
|
4
|
-
private timeout;
|
|
5
|
-
constructor(apiKey: string, baseUrl: string, timeout: number);
|
|
6
|
-
get<T>(path: string, params?: object): Promise<T>;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
type Interval = "1min" | "5min" | "15min" | "30min" | "45min" | "1h" | "2h" | "4h" | "1day" | "1week" | "1month";
|
|
10
|
-
interface TwelveDataConfig {
|
|
11
|
-
apiKey: string;
|
|
12
|
-
baseUrl?: string;
|
|
13
|
-
timeout?: number;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface TimeSeriesParams {
|
|
17
|
-
symbol: string;
|
|
18
|
-
interval: Interval;
|
|
19
|
-
outputsize?: number;
|
|
20
|
-
start_date?: string;
|
|
21
|
-
end_date?: string;
|
|
22
|
-
timezone?: string;
|
|
23
|
-
format?: "JSON" | "CSV";
|
|
24
|
-
}
|
|
25
|
-
interface TimeSeriesValue {
|
|
26
|
-
datetime: string;
|
|
27
|
-
open: string;
|
|
28
|
-
high: string;
|
|
29
|
-
low: string;
|
|
30
|
-
close: string;
|
|
31
|
-
volume?: string;
|
|
32
|
-
}
|
|
33
|
-
interface TimeSeriesResponse {
|
|
34
|
-
meta: {
|
|
35
|
-
symbol: string;
|
|
36
|
-
interval: string;
|
|
37
|
-
currency: string;
|
|
38
|
-
exchange_timezone: string;
|
|
39
|
-
exchange: string;
|
|
40
|
-
mic_code: string;
|
|
41
|
-
type: string;
|
|
42
|
-
};
|
|
43
|
-
values: TimeSeriesValue[];
|
|
44
|
-
status: string;
|
|
45
|
-
}
|
|
46
|
-
interface QuoteParams {
|
|
47
|
-
symbol: string;
|
|
48
|
-
interval?: Interval;
|
|
49
|
-
eod?: boolean;
|
|
50
|
-
rolling_period?: number;
|
|
51
|
-
}
|
|
52
|
-
interface QuoteResponse {
|
|
53
|
-
symbol: string;
|
|
54
|
-
name: string;
|
|
55
|
-
exchange: string;
|
|
56
|
-
mic_code: string;
|
|
57
|
-
currency: string;
|
|
58
|
-
datetime: string;
|
|
59
|
-
timestamp: number;
|
|
60
|
-
open: string;
|
|
61
|
-
high: string;
|
|
62
|
-
low: string;
|
|
63
|
-
close: string;
|
|
64
|
-
volume: string;
|
|
65
|
-
previous_close: string;
|
|
66
|
-
change: string;
|
|
67
|
-
percent_change: string;
|
|
68
|
-
average_volume: string;
|
|
69
|
-
is_market_open: boolean;
|
|
70
|
-
fifty_two_week: {
|
|
71
|
-
low: string;
|
|
72
|
-
high: string;
|
|
73
|
-
low_change: string;
|
|
74
|
-
high_change: string;
|
|
75
|
-
low_change_percent: string;
|
|
76
|
-
high_change_percent: string;
|
|
77
|
-
range: string;
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
interface PriceParams {
|
|
81
|
-
symbol: string;
|
|
82
|
-
format?: "JSON" | "CSV";
|
|
83
|
-
}
|
|
84
|
-
interface PriceResponse {
|
|
85
|
-
price: string;
|
|
86
|
-
}
|
|
87
|
-
declare class MarketDataEndpoints {
|
|
88
|
-
private http;
|
|
89
|
-
constructor(http: HttpClient);
|
|
90
|
-
timeSeries(params: TimeSeriesParams): Promise<TimeSeriesResponse>;
|
|
91
|
-
quote(params: QuoteParams): Promise<QuoteResponse>;
|
|
92
|
-
price(params: PriceParams): Promise<PriceResponse>;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
declare class TwelveData {
|
|
96
|
-
readonly marketData: MarketDataEndpoints;
|
|
97
|
-
private http;
|
|
98
|
-
constructor(config: TwelveDataConfig);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
declare class TwelveDataError extends Error {
|
|
102
|
-
code: number;
|
|
103
|
-
status: "error";
|
|
104
|
-
constructor(message: string, code: number);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export { TwelveData, TwelveDataError };
|
|
108
|
-
export type { Interval, PriceParams, PriceResponse, QuoteParams, QuoteResponse, TimeSeriesParams, TimeSeriesResponse, TimeSeriesValue, TwelveDataConfig };
|
package/dist/index.d.ts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
declare class HttpClient {
|
|
2
|
-
private baseUrl;
|
|
3
|
-
private apiKey;
|
|
4
|
-
private timeout;
|
|
5
|
-
constructor(apiKey: string, baseUrl: string, timeout: number);
|
|
6
|
-
get<T>(path: string, params?: object): Promise<T>;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
type Interval = "1min" | "5min" | "15min" | "30min" | "45min" | "1h" | "2h" | "4h" | "1day" | "1week" | "1month";
|
|
10
|
-
interface TwelveDataConfig {
|
|
11
|
-
apiKey: string;
|
|
12
|
-
baseUrl?: string;
|
|
13
|
-
timeout?: number;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface TimeSeriesParams {
|
|
17
|
-
symbol: string;
|
|
18
|
-
interval: Interval;
|
|
19
|
-
outputsize?: number;
|
|
20
|
-
start_date?: string;
|
|
21
|
-
end_date?: string;
|
|
22
|
-
timezone?: string;
|
|
23
|
-
format?: "JSON" | "CSV";
|
|
24
|
-
}
|
|
25
|
-
interface TimeSeriesValue {
|
|
26
|
-
datetime: string;
|
|
27
|
-
open: string;
|
|
28
|
-
high: string;
|
|
29
|
-
low: string;
|
|
30
|
-
close: string;
|
|
31
|
-
volume?: string;
|
|
32
|
-
}
|
|
33
|
-
interface TimeSeriesResponse {
|
|
34
|
-
meta: {
|
|
35
|
-
symbol: string;
|
|
36
|
-
interval: string;
|
|
37
|
-
currency: string;
|
|
38
|
-
exchange_timezone: string;
|
|
39
|
-
exchange: string;
|
|
40
|
-
mic_code: string;
|
|
41
|
-
type: string;
|
|
42
|
-
};
|
|
43
|
-
values: TimeSeriesValue[];
|
|
44
|
-
status: string;
|
|
45
|
-
}
|
|
46
|
-
interface QuoteParams {
|
|
47
|
-
symbol: string;
|
|
48
|
-
interval?: Interval;
|
|
49
|
-
eod?: boolean;
|
|
50
|
-
rolling_period?: number;
|
|
51
|
-
}
|
|
52
|
-
interface QuoteResponse {
|
|
53
|
-
symbol: string;
|
|
54
|
-
name: string;
|
|
55
|
-
exchange: string;
|
|
56
|
-
mic_code: string;
|
|
57
|
-
currency: string;
|
|
58
|
-
datetime: string;
|
|
59
|
-
timestamp: number;
|
|
60
|
-
open: string;
|
|
61
|
-
high: string;
|
|
62
|
-
low: string;
|
|
63
|
-
close: string;
|
|
64
|
-
volume: string;
|
|
65
|
-
previous_close: string;
|
|
66
|
-
change: string;
|
|
67
|
-
percent_change: string;
|
|
68
|
-
average_volume: string;
|
|
69
|
-
is_market_open: boolean;
|
|
70
|
-
fifty_two_week: {
|
|
71
|
-
low: string;
|
|
72
|
-
high: string;
|
|
73
|
-
low_change: string;
|
|
74
|
-
high_change: string;
|
|
75
|
-
low_change_percent: string;
|
|
76
|
-
high_change_percent: string;
|
|
77
|
-
range: string;
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
interface PriceParams {
|
|
81
|
-
symbol: string;
|
|
82
|
-
format?: "JSON" | "CSV";
|
|
83
|
-
}
|
|
84
|
-
interface PriceResponse {
|
|
85
|
-
price: string;
|
|
86
|
-
}
|
|
87
|
-
declare class MarketDataEndpoints {
|
|
88
|
-
private http;
|
|
89
|
-
constructor(http: HttpClient);
|
|
90
|
-
timeSeries(params: TimeSeriesParams): Promise<TimeSeriesResponse>;
|
|
91
|
-
quote(params: QuoteParams): Promise<QuoteResponse>;
|
|
92
|
-
price(params: PriceParams): Promise<PriceResponse>;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
declare class TwelveData {
|
|
96
|
-
readonly marketData: MarketDataEndpoints;
|
|
97
|
-
private http;
|
|
98
|
-
constructor(config: TwelveDataConfig);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
declare class TwelveDataError extends Error {
|
|
102
|
-
code: number;
|
|
103
|
-
status: "error";
|
|
104
|
-
constructor(message: string, code: number);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export { TwelveData, TwelveDataError };
|
|
108
|
-
export type { Interval, PriceParams, PriceResponse, QuoteParams, QuoteResponse, TimeSeriesParams, TimeSeriesResponse, TimeSeriesValue, TwelveDataConfig };
|
package/dist/index.mjs
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
class MarketDataEndpoints {
|
|
2
|
-
constructor(http) {
|
|
3
|
-
this.http = http;
|
|
4
|
-
}
|
|
5
|
-
timeSeries(params) {
|
|
6
|
-
return this.http.get("/time_series", params);
|
|
7
|
-
}
|
|
8
|
-
quote(params) {
|
|
9
|
-
return this.http.get("/quote", params);
|
|
10
|
-
}
|
|
11
|
-
price(params) {
|
|
12
|
-
return this.http.get("/price", params);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
class TwelveDataError extends Error {
|
|
17
|
-
code;
|
|
18
|
-
status;
|
|
19
|
-
constructor(message, code) {
|
|
20
|
-
super(message);
|
|
21
|
-
this.name = "TwelveDataError";
|
|
22
|
-
this.code = code;
|
|
23
|
-
this.status = "error";
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
class HttpClient {
|
|
28
|
-
baseUrl;
|
|
29
|
-
apiKey;
|
|
30
|
-
timeout;
|
|
31
|
-
constructor(apiKey, baseUrl, timeout) {
|
|
32
|
-
this.apiKey = apiKey;
|
|
33
|
-
this.baseUrl = baseUrl;
|
|
34
|
-
this.timeout = timeout;
|
|
35
|
-
}
|
|
36
|
-
async get(path, params = {}) {
|
|
37
|
-
const url = new URL(path, this.baseUrl);
|
|
38
|
-
for (const [key, value] of Object.entries(
|
|
39
|
-
params
|
|
40
|
-
)) {
|
|
41
|
-
if (value !== void 0) {
|
|
42
|
-
url.searchParams.set(key, String(value));
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
const controller = new AbortController();
|
|
46
|
-
const timer = setTimeout(() => controller.abort(), this.timeout);
|
|
47
|
-
let response;
|
|
48
|
-
try {
|
|
49
|
-
response = await fetch(url.toString(), {
|
|
50
|
-
headers: { Authorization: `apikey ${this.apiKey}` },
|
|
51
|
-
signal: controller.signal
|
|
52
|
-
});
|
|
53
|
-
} finally {
|
|
54
|
-
clearTimeout(timer);
|
|
55
|
-
}
|
|
56
|
-
const body = await response.json();
|
|
57
|
-
if (body.status === "error") {
|
|
58
|
-
throw new TwelveDataError(
|
|
59
|
-
body.message ?? "Unknown error",
|
|
60
|
-
body.code ?? response.status
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
return body;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
class TwelveData {
|
|
68
|
-
marketData;
|
|
69
|
-
http;
|
|
70
|
-
constructor(config) {
|
|
71
|
-
this.http = new HttpClient(
|
|
72
|
-
config.apiKey,
|
|
73
|
-
config.baseUrl ?? "https://api.twelvedata.com",
|
|
74
|
-
config.timeout ?? 3e4
|
|
75
|
-
);
|
|
76
|
-
this.marketData = new MarketDataEndpoints(this.http);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export { TwelveData, TwelveDataError };
|