snaptrade-typescript-sdk 9.0.2 → 9.0.4
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 +4 -4
- package/dist/api/account-information-api-generated.js +24 -24
- package/dist/api/authentication-api-generated.js +18 -18
- package/dist/api/connections-api-generated.js +12 -12
- package/dist/api/error-logs-api-generated.js +3 -3
- package/dist/api/options-api-generated.js +15 -15
- package/dist/api/reference-data-api-generated.js +33 -33
- package/dist/api/trading-api-generated.d.ts +4 -0
- package/dist/api/trading-api-generated.js +22 -18
- package/dist/api/transactions-and-reporting-api-generated.js +6 -6
- package/dist/browser.js +1 -1
- package/dist/common.d.ts +4 -4
- package/dist/configuration.js +2 -2
- package/dist/error.d.ts +5 -5
- package/dist/error.js +5 -5
- package/dist/requestAfterHook.js +1 -1
- package/package.json +5 -2
package/dist/common.d.ts
CHANGED
|
@@ -18,11 +18,11 @@ export declare const assertParamExists: (functionName: string, paramName: string
|
|
|
18
18
|
*/
|
|
19
19
|
export declare const setApiKeyToObject: ({ object, key, type, keyParamName, configuration, prefix }: {
|
|
20
20
|
object: any;
|
|
21
|
-
key?: string;
|
|
22
|
-
type?: "Cookie";
|
|
21
|
+
key?: string | undefined;
|
|
22
|
+
type?: "Cookie" | undefined;
|
|
23
23
|
keyParamName: string;
|
|
24
|
-
configuration?: Configuration;
|
|
25
|
-
prefix?: string;
|
|
24
|
+
configuration?: Configuration | undefined;
|
|
25
|
+
prefix?: string | undefined;
|
|
26
26
|
}) => Promise<void>;
|
|
27
27
|
/**
|
|
28
28
|
*
|
package/dist/configuration.js
CHANGED
|
@@ -23,7 +23,7 @@ class Configuration {
|
|
|
23
23
|
if (param.clientId !== undefined)
|
|
24
24
|
this.apiKey["clientId"] = param.clientId;
|
|
25
25
|
if (param.signature !== undefined)
|
|
26
|
-
this.apiKey["
|
|
26
|
+
this.apiKey["signature"] = param.signature;
|
|
27
27
|
if (param.timestamp !== undefined)
|
|
28
28
|
this.apiKey["timestamp"] = param.timestamp;
|
|
29
29
|
}
|
|
@@ -32,7 +32,7 @@ class Configuration {
|
|
|
32
32
|
this.accessToken = param.accessToken;
|
|
33
33
|
this.basePath = param.basePath;
|
|
34
34
|
this.baseOptions = (_a = param.baseOptions) !== null && _a !== void 0 ? _a : {};
|
|
35
|
-
this.userAgent = param.userAgent === undefined ? "Konfig/9.0.
|
|
35
|
+
this.userAgent = param.userAgent === undefined ? "Konfig/9.0.4/typescript" : param.userAgent;
|
|
36
36
|
this.formDataCtor = param.formDataCtor;
|
|
37
37
|
}
|
|
38
38
|
/**
|
package/dist/error.d.ts
CHANGED
|
@@ -34,11 +34,11 @@ export declare class SnaptradeError extends Error {
|
|
|
34
34
|
toJSON(): {
|
|
35
35
|
name: string;
|
|
36
36
|
message: string;
|
|
37
|
-
method: string;
|
|
38
|
-
url: string;
|
|
39
|
-
code: string;
|
|
40
|
-
status: number;
|
|
41
|
-
statusText: string;
|
|
37
|
+
method: string | undefined;
|
|
38
|
+
url: string | undefined;
|
|
39
|
+
code: string | undefined;
|
|
40
|
+
status: number | undefined;
|
|
41
|
+
statusText: string | undefined;
|
|
42
42
|
responseBody: unknown;
|
|
43
43
|
};
|
|
44
44
|
}
|
package/dist/error.js
CHANGED
|
@@ -25,14 +25,14 @@ exports.parseIfJson = exports.readableStreamToString = exports.SnaptradeError =
|
|
|
25
25
|
*/
|
|
26
26
|
class SnaptradeError extends Error {
|
|
27
27
|
constructor(axiosError, responseBody) {
|
|
28
|
-
var _a, _b, _c;
|
|
28
|
+
var _a, _b, _c, _d, _e;
|
|
29
29
|
super(axiosError.message);
|
|
30
30
|
this.name = "SnaptradeError";
|
|
31
31
|
this.code = axiosError.code;
|
|
32
|
-
this.method = (_a = axiosError.config
|
|
33
|
-
this.url = axiosError.config.url;
|
|
34
|
-
this.status = (
|
|
35
|
-
this.statusText = (
|
|
32
|
+
this.method = (_b = (_a = axiosError.config) === null || _a === void 0 ? void 0 : _a.method) === null || _b === void 0 ? void 0 : _b.toUpperCase();
|
|
33
|
+
this.url = (_c = axiosError.config) === null || _c === void 0 ? void 0 : _c.url;
|
|
34
|
+
this.status = (_d = axiosError.response) === null || _d === void 0 ? void 0 : _d.status;
|
|
35
|
+
this.statusText = (_e = axiosError.response) === null || _e === void 0 ? void 0 : _e.statusText;
|
|
36
36
|
this.responseBody = responseBody;
|
|
37
37
|
}
|
|
38
38
|
toJSON() {
|
package/dist/requestAfterHook.js
CHANGED
|
@@ -31,7 +31,7 @@ function computeHmacSha256(message, key) {
|
|
|
31
31
|
const msgBuffer = encoder.encode(message);
|
|
32
32
|
const cryptoKey = yield window.crypto.subtle.importKey("raw", keyBuffer, { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
|
|
33
33
|
const signature = yield window.crypto.subtle.sign("HMAC", cryptoKey, msgBuffer);
|
|
34
|
-
const byteArray = new Uint8Array(signature);
|
|
34
|
+
const byteArray = Array.from(new Uint8Array(signature));
|
|
35
35
|
// Convert byte array to base64
|
|
36
36
|
const base64 = btoa(String.fromCharCode.apply(null, byteArray));
|
|
37
37
|
return base64;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snaptrade-typescript-sdk",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.4",
|
|
4
4
|
"description": "Client for SnapTrade",
|
|
5
5
|
"author": "Konfig",
|
|
6
6
|
"engines": {
|
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/passiv/snaptrade-sdks
|
|
11
|
+
"url": "https://github.com/passiv/snaptrade-sdks.git",
|
|
12
|
+
"directory": "sdks/typescript"
|
|
12
13
|
},
|
|
14
|
+
"homepage": "https://github.com/passiv/snaptrade-sdks/tree/HEAD/sdks/typescript#readme",
|
|
13
15
|
"keywords": [
|
|
14
16
|
"axios",
|
|
15
17
|
"typescript",
|
|
@@ -36,6 +38,7 @@
|
|
|
36
38
|
"@babel/traverse": "^7.23.2"
|
|
37
39
|
},
|
|
38
40
|
"devDependencies": {
|
|
41
|
+
"@jest/types": "^29.6.3",
|
|
39
42
|
"@types/jest": "^29.2.4",
|
|
40
43
|
"@types/node": "^18",
|
|
41
44
|
"jest": "^29.3.1",
|