snaptrade-typescript-sdk 9.0.3 → 9.0.5
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 +9 -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 -2
- package/dist/api/trading-api-generated.js +24 -20
- 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/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/dist/models/validated-trade-body.d.ts +13 -0
- package/dist/models/validated-trade-body.js +2 -0
- 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.5/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/models/index.d.ts
CHANGED
package/dist/models/index.js
CHANGED
|
@@ -128,3 +128,4 @@ __exportStar(require("./universal-symbol"), exports);
|
|
|
128
128
|
__exportStar(require("./user-error-log"), exports);
|
|
129
129
|
__exportStar(require("./user-idand-secret"), exports);
|
|
130
130
|
__exportStar(require("./user-settings"), exports);
|
|
131
|
+
__exportStar(require("./validated-trade-body"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validated Trade Form
|
|
3
|
+
* @export
|
|
4
|
+
* @interface ValidatedTradeBody
|
|
5
|
+
*/
|
|
6
|
+
export interface ValidatedTradeBody {
|
|
7
|
+
/**
|
|
8
|
+
* Optional, defaults to true. Determines if a wait is performed to check on order status. If false, latency will be reduced but orders returned will be more likely to be of status PENDING as we will not wait to check on the status before responding to the request
|
|
9
|
+
* @type {boolean}
|
|
10
|
+
* @memberof ValidatedTradeBody
|
|
11
|
+
*/
|
|
12
|
+
'wait_to_confirm'?: boolean | null;
|
|
13
|
+
}
|
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.5",
|
|
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",
|