snaptrade-typescript-sdk 5.0.0 → 6.0.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/.konfig/generate-id.txt +1 -1
- package/README.md +2 -2
- package/api/account-information-api.ts +136 -120
- package/api/api-disclaimer-api.ts +14 -19
- package/api/authentication-api.ts +37 -43
- package/api/connections-api.ts +46 -40
- package/api/error-logs-api.ts +12 -10
- package/api/options-api.ts +104 -108
- package/api/portfolio-management-api.ts +259 -253
- package/api/reference-data-api.ts +49 -53
- package/api/trading-api.ts +172 -185
- package/api/transactions-and-reporting-api.ts +64 -60
- package/client.ts +2 -0
- package/configuration.ts +1 -1
- package/dist/api/account-information-api.d.ts +112 -112
- package/dist/api/api-disclaimer-api.d.ts +10 -16
- package/dist/api/api-disclaimer-api.js +1 -1
- package/dist/api/authentication-api.d.ts +27 -40
- package/dist/api/authentication-api.js +2 -2
- package/dist/api/connections-api.d.ts +38 -38
- package/dist/api/error-logs-api.d.ts +10 -10
- package/dist/api/options-api.d.ts +82 -94
- package/dist/api/options-api.js +2 -2
- package/dist/api/portfolio-management-api.d.ts +214 -256
- package/dist/api/portfolio-management-api.js +7 -7
- package/dist/api/reference-data-api.d.ts +37 -50
- package/dist/api/reference-data-api.js +2 -2
- package/dist/api/trading-api.d.ts +131 -160
- package/dist/api/trading-api.js +10 -10
- package/dist/api/transactions-and-reporting-api.d.ts +52 -52
- package/dist/configuration.js +1 -1
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/dist/models/target-asset.d.ts +4 -2
- package/dist/models/trading-cancel-user-account-order-request.d.ts +24 -0
- package/dist/models/trading-cancel-user-account-order-request.js +15 -0
- package/docs/AccountInformationApi.md +72 -88
- package/docs/ApiDisclaimerApi.md +8 -12
- package/docs/ApiStatusApi.md +6 -7
- package/docs/AuthenticationApi.md +34 -48
- package/docs/ConnectionsApi.md +26 -32
- package/docs/ErrorLogsApi.md +8 -10
- package/docs/OptionsApi.md +55 -62
- package/docs/PortfolioManagementApi.md +229 -309
- package/docs/ReferenceDataApi.md +66 -93
- package/docs/TradingApi.md +88 -117
- package/docs/TransactionsAndReportingApi.md +26 -28
- package/index.test.ts +2 -4
- package/models/index.ts +1 -0
- package/models/target-asset.ts +2 -2
- package/models/trading-cancel-user-account-order-request.ts +29 -0
- package/package.json +1 -1
package/dist/api/trading-api.js
CHANGED
|
@@ -96,11 +96,11 @@ var TradingApiAxiosParamCreator = function (configuration) {
|
|
|
96
96
|
* @param {string} userId
|
|
97
97
|
* @param {string} userSecret
|
|
98
98
|
* @param {string} accountId The ID of the account get positions.
|
|
99
|
-
* @param {
|
|
99
|
+
* @param {TradingCancelUserAccountOrderRequest} tradingCancelUserAccountOrderRequest The Order ID to be canceled
|
|
100
100
|
* @param {*} [options] Override http request option.
|
|
101
101
|
* @throws {RequiredError}
|
|
102
102
|
*/
|
|
103
|
-
cancelUserAccountOrder: function (userId, userSecret, accountId,
|
|
103
|
+
cancelUserAccountOrder: function (userId, userSecret, accountId, tradingCancelUserAccountOrderRequest, options) {
|
|
104
104
|
if (options === void 0) { options = {}; }
|
|
105
105
|
return __awaiter(_this, void 0, void 0, function () {
|
|
106
106
|
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
@@ -113,8 +113,8 @@ var TradingApiAxiosParamCreator = function (configuration) {
|
|
|
113
113
|
(0, common_1.assertParamExists)('cancelUserAccountOrder', 'userSecret', userSecret);
|
|
114
114
|
// verify required parameter 'accountId' is not null or undefined
|
|
115
115
|
(0, common_1.assertParamExists)('cancelUserAccountOrder', 'accountId', accountId);
|
|
116
|
-
// verify required parameter '
|
|
117
|
-
(0, common_1.assertParamExists)('cancelUserAccountOrder', '
|
|
116
|
+
// verify required parameter 'tradingCancelUserAccountOrderRequest' is not null or undefined
|
|
117
|
+
(0, common_1.assertParamExists)('cancelUserAccountOrder', 'tradingCancelUserAccountOrderRequest', tradingCancelUserAccountOrderRequest);
|
|
118
118
|
localVarPath = "/accounts/{accountId}/orders/cancel"
|
|
119
119
|
.replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)));
|
|
120
120
|
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
@@ -152,7 +152,7 @@ var TradingApiAxiosParamCreator = function (configuration) {
|
|
|
152
152
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
153
153
|
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
154
154
|
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
155
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(
|
|
155
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(tradingCancelUserAccountOrderRequest, localVarRequestOptions, configuration);
|
|
156
156
|
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
157
157
|
queryParameters: localVarQueryParameter,
|
|
158
158
|
requestConfig: localVarRequestOptions,
|
|
@@ -839,7 +839,7 @@ var TradingApiFp = function (configuration) {
|
|
|
839
839
|
var localVarAxiosArgs;
|
|
840
840
|
return __generator(this, function (_a) {
|
|
841
841
|
switch (_a.label) {
|
|
842
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.cancelUserAccountOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters
|
|
842
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.cancelUserAccountOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters, options)];
|
|
843
843
|
case 1:
|
|
844
844
|
localVarAxiosArgs = _a.sent();
|
|
845
845
|
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
@@ -899,7 +899,7 @@ var TradingApiFp = function (configuration) {
|
|
|
899
899
|
var localVarAxiosArgs;
|
|
900
900
|
return __generator(this, function (_a) {
|
|
901
901
|
switch (_a.label) {
|
|
902
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.getOrderImpact(requestParameters.userId, requestParameters.userSecret, requestParameters
|
|
902
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.getOrderImpact(requestParameters.userId, requestParameters.userSecret, requestParameters, options)];
|
|
903
903
|
case 1:
|
|
904
904
|
localVarAxiosArgs = _a.sent();
|
|
905
905
|
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
@@ -939,7 +939,7 @@ var TradingApiFp = function (configuration) {
|
|
|
939
939
|
var localVarAxiosArgs;
|
|
940
940
|
return __generator(this, function (_a) {
|
|
941
941
|
switch (_a.label) {
|
|
942
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.modifyCalculatedTradeById(requestParameters.portfolioGroupId, requestParameters.calculatedTradeId, requestParameters.tradeId, requestParameters
|
|
942
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.modifyCalculatedTradeById(requestParameters.portfolioGroupId, requestParameters.calculatedTradeId, requestParameters.tradeId, requestParameters, options)];
|
|
943
943
|
case 1:
|
|
944
944
|
localVarAxiosArgs = _a.sent();
|
|
945
945
|
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
@@ -979,7 +979,7 @@ var TradingApiFp = function (configuration) {
|
|
|
979
979
|
var localVarAxiosArgs;
|
|
980
980
|
return __generator(this, function (_a) {
|
|
981
981
|
switch (_a.label) {
|
|
982
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.placeForceOrder(requestParameters.userId, requestParameters.userSecret, requestParameters
|
|
982
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.placeForceOrder(requestParameters.userId, requestParameters.userSecret, requestParameters, options)];
|
|
983
983
|
case 1:
|
|
984
984
|
localVarAxiosArgs = _a.sent();
|
|
985
985
|
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
@@ -999,7 +999,7 @@ var TradingApiFp = function (configuration) {
|
|
|
999
999
|
var localVarAxiosArgs;
|
|
1000
1000
|
return __generator(this, function (_a) {
|
|
1001
1001
|
switch (_a.label) {
|
|
1002
|
-
case 0: return [4 /*yield*/, localVarAxiosParamCreator.placeOCOOrder(requestParameters.userId, requestParameters.userSecret, requestParameters
|
|
1002
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.placeOCOOrder(requestParameters.userId, requestParameters.userSecret, requestParameters, options)];
|
|
1003
1003
|
case 1:
|
|
1004
1004
|
localVarAxiosArgs = _a.sent();
|
|
1005
1005
|
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
@@ -95,87 +95,87 @@ export declare const TransactionsAndReportingApiFactory: (configuration?: Config
|
|
|
95
95
|
* @export
|
|
96
96
|
* @interface TransactionsAndReportingApiGetActivitiesRequest
|
|
97
97
|
*/
|
|
98
|
-
export
|
|
98
|
+
export type TransactionsAndReportingApiGetActivitiesRequest = {
|
|
99
99
|
/**
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
*
|
|
101
|
+
* @type {string}
|
|
102
|
+
* @memberof TransactionsAndReportingApiGetActivities
|
|
103
|
+
*/
|
|
104
104
|
readonly userId: string;
|
|
105
105
|
/**
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
*
|
|
107
|
+
* @type {string}
|
|
108
|
+
* @memberof TransactionsAndReportingApiGetActivities
|
|
109
|
+
*/
|
|
110
110
|
readonly userSecret: string;
|
|
111
111
|
/**
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
*
|
|
113
|
+
* @type {string}
|
|
114
|
+
* @memberof TransactionsAndReportingApiGetActivities
|
|
115
|
+
*/
|
|
116
116
|
readonly startDate?: string;
|
|
117
117
|
/**
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
*
|
|
119
|
+
* @type {string}
|
|
120
|
+
* @memberof TransactionsAndReportingApiGetActivities
|
|
121
|
+
*/
|
|
122
122
|
readonly endDate?: string;
|
|
123
123
|
/**
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
* Optional comma seperated list of account IDs used to filter the request on specific accounts
|
|
125
|
+
* @type {string}
|
|
126
|
+
* @memberof TransactionsAndReportingApiGetActivities
|
|
127
|
+
*/
|
|
128
128
|
readonly accounts?: string;
|
|
129
|
-
}
|
|
129
|
+
};
|
|
130
130
|
/**
|
|
131
131
|
* Request parameters for getReportingCustomRange operation in TransactionsAndReportingApi.
|
|
132
132
|
* @export
|
|
133
133
|
* @interface TransactionsAndReportingApiGetReportingCustomRangeRequest
|
|
134
134
|
*/
|
|
135
|
-
export
|
|
135
|
+
export type TransactionsAndReportingApiGetReportingCustomRangeRequest = {
|
|
136
136
|
/**
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
*
|
|
138
|
+
* @type {string}
|
|
139
|
+
* @memberof TransactionsAndReportingApiGetReportingCustomRange
|
|
140
|
+
*/
|
|
141
141
|
readonly startDate: string;
|
|
142
142
|
/**
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
*
|
|
144
|
+
* @type {string}
|
|
145
|
+
* @memberof TransactionsAndReportingApiGetReportingCustomRange
|
|
146
|
+
*/
|
|
147
147
|
readonly endDate: string;
|
|
148
148
|
/**
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
149
|
+
*
|
|
150
|
+
* @type {string}
|
|
151
|
+
* @memberof TransactionsAndReportingApiGetReportingCustomRange
|
|
152
|
+
*/
|
|
153
153
|
readonly userId: string;
|
|
154
154
|
/**
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
*
|
|
156
|
+
* @type {string}
|
|
157
|
+
* @memberof TransactionsAndReportingApiGetReportingCustomRange
|
|
158
|
+
*/
|
|
159
159
|
readonly userSecret: string;
|
|
160
160
|
/**
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
* Optional comma seperated list of account IDs used to filter the request on specific accounts
|
|
162
|
+
* @type {string}
|
|
163
|
+
* @memberof TransactionsAndReportingApiGetReportingCustomRange
|
|
164
|
+
*/
|
|
165
165
|
readonly accounts?: string;
|
|
166
166
|
/**
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
167
|
+
* Optional, increases frequency of data points for the total value and contribution charts if set to true
|
|
168
|
+
* @type {boolean}
|
|
169
|
+
* @memberof TransactionsAndReportingApiGetReportingCustomRange
|
|
170
|
+
*/
|
|
171
171
|
readonly detailed?: boolean;
|
|
172
172
|
/**
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
* Optional frequency for the rate of return chart (defaults to monthly). Possible values are daily, weekly, monthly, quarterly, yearly.
|
|
174
|
+
* @type {string}
|
|
175
|
+
* @memberof TransactionsAndReportingApiGetReportingCustomRange
|
|
176
|
+
*/
|
|
177
177
|
readonly frequency?: string;
|
|
178
|
-
}
|
|
178
|
+
};
|
|
179
179
|
/**
|
|
180
180
|
* TransactionsAndReportingApi - object-oriented interface
|
|
181
181
|
* @export
|
package/dist/configuration.js
CHANGED
|
@@ -33,7 +33,7 @@ var Configuration = /** @class */ (function () {
|
|
|
33
33
|
this.accessToken = param.accessToken;
|
|
34
34
|
this.basePath = param.basePath;
|
|
35
35
|
this.baseOptions = param.baseOptions;
|
|
36
|
-
this.userAgent = param.userAgent === undefined ? "Konfig/
|
|
36
|
+
this.userAgent = param.userAgent === undefined ? "Konfig/6.0.0/typescript" : param.userAgent;
|
|
37
37
|
this.formDataCtor = param.formDataCtor;
|
|
38
38
|
}
|
|
39
39
|
/**
|
package/dist/models/index.d.ts
CHANGED
|
@@ -91,6 +91,7 @@ export * from './time-in-force';
|
|
|
91
91
|
export * from './trade';
|
|
92
92
|
export * from './trade-execution-status';
|
|
93
93
|
export * from './trade-impact';
|
|
94
|
+
export * from './trading-cancel-user-account-order-request';
|
|
94
95
|
export * from './trading-place-ocoorder-request';
|
|
95
96
|
export * from './usexchange';
|
|
96
97
|
export * from './underlying-symbol';
|
package/dist/models/index.js
CHANGED
|
@@ -107,6 +107,7 @@ __exportStar(require("./time-in-force"), exports);
|
|
|
107
107
|
__exportStar(require("./trade"), exports);
|
|
108
108
|
__exportStar(require("./trade-execution-status"), exports);
|
|
109
109
|
__exportStar(require("./trade-impact"), exports);
|
|
110
|
+
__exportStar(require("./trading-cancel-user-account-order-request"), exports);
|
|
110
111
|
__exportStar(require("./trading-place-ocoorder-request"), exports);
|
|
111
112
|
__exportStar(require("./usexchange"), exports);
|
|
112
113
|
__exportStar(require("./underlying-symbol"), exports);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SnapTrade
|
|
3
|
+
* Connect brokerage accounts to your app for live positions and trading
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: api@snaptrade.com
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This file is auto generated by Konfig (https://konfigthis.com).
|
|
9
|
+
* https://konfigthis.com
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface TradingCancelUserAccountOrderRequest
|
|
16
|
+
*/
|
|
17
|
+
export interface TradingCancelUserAccountOrderRequest {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof TradingCancelUserAccountOrderRequest
|
|
22
|
+
*/
|
|
23
|
+
'brokerage_order_id'?: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* SnapTrade
|
|
6
|
+
* Connect brokerage accounts to your app for live positions and trading
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
* Contact: api@snaptrade.com
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This file is auto generated by Konfig (https://konfigthis.com).
|
|
12
|
+
* https://konfigthis.com
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -15,7 +15,8 @@ Method | HTTP request | Description
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
# **getAllUserHoldings**
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
#### **GET** /holdings
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
### Example
|
|
@@ -31,12 +32,13 @@ const snaptrade = new Snaptrade({
|
|
|
31
32
|
clientId: "YOUR_CLIENT_ID",
|
|
32
33
|
})
|
|
33
34
|
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
})
|
|
39
|
-
|
|
35
|
+
const getAllUserHoldingsResponse = await snaptrade.accountInformation.getAllUserHoldings({
|
|
36
|
+
"userId": "John.doe@snaptrade.com",
|
|
37
|
+
"userSecret": "USERSECRET123",
|
|
38
|
+
"brokerageAuthorizations": "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
console.log(getAllUserHoldingsResponse)
|
|
40
42
|
|
|
41
43
|
```
|
|
42
44
|
|
|
@@ -54,10 +56,6 @@ Name | Type | Description | Notes
|
|
|
54
56
|
|
|
55
57
|
**Array<AccountHoldings>**
|
|
56
58
|
|
|
57
|
-
### Authorization
|
|
58
|
-
|
|
59
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
60
|
-
|
|
61
59
|
### HTTP request headers
|
|
62
60
|
|
|
63
61
|
- **Content-Type**: Not defined
|
|
@@ -75,7 +73,8 @@ Name | Type | Description | Notes
|
|
|
75
73
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
76
74
|
|
|
77
75
|
# **getUserAccountBalance**
|
|
78
|
-
|
|
76
|
+
|
|
77
|
+
#### **GET** /accounts/{accountId}/balances
|
|
79
78
|
|
|
80
79
|
|
|
81
80
|
### Example
|
|
@@ -91,12 +90,13 @@ const snaptrade = new Snaptrade({
|
|
|
91
90
|
clientId: "YOUR_CLIENT_ID",
|
|
92
91
|
})
|
|
93
92
|
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
})
|
|
99
|
-
|
|
93
|
+
const getUserAccountBalanceResponse = await snaptrade.accountInformation.getUserAccountBalance({
|
|
94
|
+
"userId": "John.doe@snaptrade.com",
|
|
95
|
+
"userSecret": "USERSECRET123",
|
|
96
|
+
"accountId": "accountId_example",
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
console.log(getUserAccountBalanceResponse)
|
|
100
100
|
|
|
101
101
|
```
|
|
102
102
|
|
|
@@ -114,10 +114,6 @@ Name | Type | Description | Notes
|
|
|
114
114
|
|
|
115
115
|
**Array<Balance>**
|
|
116
116
|
|
|
117
|
-
### Authorization
|
|
118
|
-
|
|
119
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
120
|
-
|
|
121
117
|
### HTTP request headers
|
|
122
118
|
|
|
123
119
|
- **Content-Type**: Not defined
|
|
@@ -133,7 +129,8 @@ Name | Type | Description | Notes
|
|
|
133
129
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
134
130
|
|
|
135
131
|
# **getUserAccountDetails**
|
|
136
|
-
|
|
132
|
+
|
|
133
|
+
#### **GET** /accounts/{accountId}
|
|
137
134
|
|
|
138
135
|
|
|
139
136
|
### Example
|
|
@@ -149,12 +146,13 @@ const snaptrade = new Snaptrade({
|
|
|
149
146
|
clientId: "YOUR_CLIENT_ID",
|
|
150
147
|
})
|
|
151
148
|
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
})
|
|
157
|
-
|
|
149
|
+
const getUserAccountDetailsResponse = await snaptrade.accountInformation.getUserAccountDetails({
|
|
150
|
+
"userId": "John.doe@snaptrade.com",
|
|
151
|
+
"userSecret": "USERSECRET123",
|
|
152
|
+
"accountId": "accountId_example",
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
console.log(getUserAccountDetailsResponse)
|
|
158
156
|
|
|
159
157
|
```
|
|
160
158
|
|
|
@@ -172,10 +170,6 @@ Name | Type | Description | Notes
|
|
|
172
170
|
|
|
173
171
|
**Array<Account>**
|
|
174
172
|
|
|
175
|
-
### Authorization
|
|
176
|
-
|
|
177
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
178
|
-
|
|
179
173
|
### HTTP request headers
|
|
180
174
|
|
|
181
175
|
- **Content-Type**: Not defined
|
|
@@ -191,7 +185,8 @@ Name | Type | Description | Notes
|
|
|
191
185
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
192
186
|
|
|
193
187
|
# **getUserAccountOrders**
|
|
194
|
-
|
|
188
|
+
|
|
189
|
+
#### **GET** /accounts/{accountId}/orders
|
|
195
190
|
|
|
196
191
|
|
|
197
192
|
### Example
|
|
@@ -207,13 +202,14 @@ const snaptrade = new Snaptrade({
|
|
|
207
202
|
clientId: "YOUR_CLIENT_ID",
|
|
208
203
|
})
|
|
209
204
|
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
})
|
|
216
|
-
|
|
205
|
+
const getUserAccountOrdersResponse = await snaptrade.accountInformation.getUserAccountOrders({
|
|
206
|
+
"userId": "John.doe@snaptrade.com",
|
|
207
|
+
"userSecret": "USERSECRET123",
|
|
208
|
+
"state": "all",
|
|
209
|
+
"accountId": "accountId_example",
|
|
210
|
+
})
|
|
211
|
+
|
|
212
|
+
console.log(getUserAccountOrdersResponse)
|
|
217
213
|
|
|
218
214
|
```
|
|
219
215
|
|
|
@@ -232,10 +228,6 @@ Name | Type | Description | Notes
|
|
|
232
228
|
|
|
233
229
|
**Array<AccountOrderRecord>**
|
|
234
230
|
|
|
235
|
-
### Authorization
|
|
236
|
-
|
|
237
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
238
|
-
|
|
239
231
|
### HTTP request headers
|
|
240
232
|
|
|
241
233
|
- **Content-Type**: Not defined
|
|
@@ -251,7 +243,8 @@ Name | Type | Description | Notes
|
|
|
251
243
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
252
244
|
|
|
253
245
|
# **getUserAccountPositions**
|
|
254
|
-
|
|
246
|
+
|
|
247
|
+
#### **GET** /accounts/{accountId}/positions
|
|
255
248
|
|
|
256
249
|
|
|
257
250
|
### Example
|
|
@@ -267,12 +260,13 @@ const snaptrade = new Snaptrade({
|
|
|
267
260
|
clientId: "YOUR_CLIENT_ID",
|
|
268
261
|
})
|
|
269
262
|
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
})
|
|
275
|
-
|
|
263
|
+
const getUserAccountPositionsResponse = await snaptrade.accountInformation.getUserAccountPositions({
|
|
264
|
+
"userId": "John.doe@snaptrade.com",
|
|
265
|
+
"userSecret": "USERSECRET123",
|
|
266
|
+
"accountId": "accountId_example",
|
|
267
|
+
})
|
|
268
|
+
|
|
269
|
+
console.log(getUserAccountPositionsResponse)
|
|
276
270
|
|
|
277
271
|
```
|
|
278
272
|
|
|
@@ -290,10 +284,6 @@ Name | Type | Description | Notes
|
|
|
290
284
|
|
|
291
285
|
**Array<Position>**
|
|
292
286
|
|
|
293
|
-
### Authorization
|
|
294
|
-
|
|
295
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
296
|
-
|
|
297
287
|
### HTTP request headers
|
|
298
288
|
|
|
299
289
|
- **Content-Type**: Not defined
|
|
@@ -309,7 +299,8 @@ Name | Type | Description | Notes
|
|
|
309
299
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
310
300
|
|
|
311
301
|
# **getUserHoldings**
|
|
312
|
-
|
|
302
|
+
|
|
303
|
+
#### **GET** /accounts/{accountId}/holdings
|
|
313
304
|
|
|
314
305
|
|
|
315
306
|
### Example
|
|
@@ -325,12 +316,13 @@ const snaptrade = new Snaptrade({
|
|
|
325
316
|
clientId: "YOUR_CLIENT_ID",
|
|
326
317
|
})
|
|
327
318
|
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
})
|
|
333
|
-
|
|
319
|
+
const getUserHoldingsResponse = await snaptrade.accountInformation.getUserHoldings({
|
|
320
|
+
"accountId": "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
321
|
+
"userId": "John.doe@snaptrade.com",
|
|
322
|
+
"userSecret": "USERSECRET123",
|
|
323
|
+
})
|
|
324
|
+
|
|
325
|
+
console.log(getUserHoldingsResponse)
|
|
334
326
|
|
|
335
327
|
```
|
|
336
328
|
|
|
@@ -348,10 +340,6 @@ Name | Type | Description | Notes
|
|
|
348
340
|
|
|
349
341
|
**AccountHoldings**
|
|
350
342
|
|
|
351
|
-
### Authorization
|
|
352
|
-
|
|
353
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
354
|
-
|
|
355
343
|
### HTTP request headers
|
|
356
344
|
|
|
357
345
|
- **Content-Type**: Not defined
|
|
@@ -369,7 +357,8 @@ Name | Type | Description | Notes
|
|
|
369
357
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
370
358
|
|
|
371
359
|
# **listUserAccounts**
|
|
372
|
-
|
|
360
|
+
|
|
361
|
+
#### **GET** /accounts
|
|
373
362
|
|
|
374
363
|
|
|
375
364
|
### Example
|
|
@@ -385,11 +374,12 @@ const snaptrade = new Snaptrade({
|
|
|
385
374
|
clientId: "YOUR_CLIENT_ID",
|
|
386
375
|
})
|
|
387
376
|
|
|
388
|
-
const
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
})
|
|
392
|
-
|
|
377
|
+
const listUserAccountsResponse = await snaptrade.accountInformation.listUserAccounts({
|
|
378
|
+
"userId": "John.doe@snaptrade.com",
|
|
379
|
+
"userSecret": "USERSECRET123",
|
|
380
|
+
})
|
|
381
|
+
|
|
382
|
+
console.log(listUserAccountsResponse)
|
|
393
383
|
|
|
394
384
|
```
|
|
395
385
|
|
|
@@ -406,10 +396,6 @@ Name | Type | Description | Notes
|
|
|
406
396
|
|
|
407
397
|
**Array<Account>**
|
|
408
398
|
|
|
409
|
-
### Authorization
|
|
410
|
-
|
|
411
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
412
|
-
|
|
413
399
|
### HTTP request headers
|
|
414
400
|
|
|
415
401
|
- **Content-Type**: Not defined
|
|
@@ -425,7 +411,8 @@ Name | Type | Description | Notes
|
|
|
425
411
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
426
412
|
|
|
427
413
|
# **updateUserAccount**
|
|
428
|
-
|
|
414
|
+
|
|
415
|
+
#### **PUT** /accounts/{accountId}
|
|
429
416
|
|
|
430
417
|
|
|
431
418
|
### Example
|
|
@@ -441,12 +428,13 @@ const snaptrade = new Snaptrade({
|
|
|
441
428
|
clientId: "YOUR_CLIENT_ID",
|
|
442
429
|
})
|
|
443
430
|
|
|
444
|
-
const
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
})
|
|
449
|
-
|
|
431
|
+
const updateUserAccountResponse = await snaptrade.accountInformation.updateUserAccount({
|
|
432
|
+
"userId": "John.doe@snaptrade.com",
|
|
433
|
+
"userSecret": "USERSECRET123",
|
|
434
|
+
"accountId": "accountId_example",
|
|
435
|
+
})
|
|
436
|
+
|
|
437
|
+
console.log(updateUserAccountResponse)
|
|
450
438
|
|
|
451
439
|
```
|
|
452
440
|
|
|
@@ -464,10 +452,6 @@ Name | Type | Description | Notes
|
|
|
464
452
|
|
|
465
453
|
**Array<Account>**
|
|
466
454
|
|
|
467
|
-
### Authorization
|
|
468
|
-
|
|
469
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
470
|
-
|
|
471
455
|
### HTTP request headers
|
|
472
456
|
|
|
473
457
|
- **Content-Type**: Not defined
|
package/docs/ApiDisclaimerApi.md
CHANGED
|
@@ -8,7 +8,8 @@ Method | HTTP request | Description
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
# **accept**
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
#### **POST** /snapTrade/acceptDisclaimer
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
### Example
|
|
@@ -24,13 +25,12 @@ const snaptrade = new Snaptrade({
|
|
|
24
25
|
clientId: "YOUR_CLIENT_ID",
|
|
25
26
|
})
|
|
26
27
|
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
console.log(response)
|
|
28
|
+
const acceptResponse = await snaptrade.apiDisclaimer.accept({
|
|
29
|
+
"userId": "John.doe@snaptrade.com",
|
|
30
|
+
"userSecret": "USERSECRET123",
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
console.log(acceptResponse)
|
|
34
34
|
|
|
35
35
|
```
|
|
36
36
|
|
|
@@ -48,10 +48,6 @@ Name | Type | Description | Notes
|
|
|
48
48
|
|
|
49
49
|
**SnapTradeAPIDisclaimerAcceptStatus**
|
|
50
50
|
|
|
51
|
-
### Authorization
|
|
52
|
-
|
|
53
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
54
|
-
|
|
55
51
|
### HTTP request headers
|
|
56
52
|
|
|
57
53
|
- **Content-Type**: application/json
|