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.
@@ -7,6 +7,7 @@ import { ManualTradeForm } from '../models';
7
7
  import { SymbolsQuotesInner } from '../models';
8
8
  import { TradingCancelUserAccountOrderRequest } from '../models';
9
9
  import { TradingPlaceOCOOrderRequest } from '../models';
10
+ import { ValidatedTradeBody } from '../models';
10
11
  /**
11
12
  * TradingApi - axios parameter creator
12
13
  * @export
@@ -72,10 +73,11 @@ export declare const TradingApiAxiosParamCreator: (configuration?: Configuration
72
73
  * @param {string} tradeId The ID of trade object obtained from trade/impact endpoint
73
74
  * @param {string} userId
74
75
  * @param {string} userSecret
76
+ * @param {ValidatedTradeBody} [validatedTradeBody]
75
77
  * @param {*} [options] Override http request option.
76
78
  * @throws {RequiredError}
77
79
  */
78
- placeOrder: (tradeId: string, userId: string, userSecret: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
80
+ placeOrder: (tradeId: string, userId: string, userSecret: string, validatedTradeBody?: ValidatedTradeBody, options?: AxiosRequestConfig) => Promise<RequestArgs>;
79
81
  };
80
82
  /**
81
83
  * TradingApi - functional programming interface
@@ -330,7 +332,7 @@ export type TradingApiPlaceOrderRequest = {
330
332
  * @memberof TradingApiPlaceOrder
331
333
  */
332
334
  readonly userSecret: string;
333
- };
335
+ } & ValidatedTradeBody;
334
336
  /**
335
337
  * TradingApiGenerated - object-oriented interface
336
338
  * @export
@@ -66,11 +66,11 @@ const TradingApiAxiosParamCreator = function (configuration) {
66
66
  const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
67
67
  const localVarQueryParameter = {};
68
68
  // authentication PartnerClientId required
69
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
69
+ yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
70
70
  // authentication PartnerSignature required
71
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
71
+ yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
72
72
  // authentication PartnerTimestamp required
73
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
73
+ yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
74
74
  if (userId !== undefined) {
75
75
  localVarQueryParameter['userId'] = userId;
76
76
  }
@@ -121,11 +121,11 @@ const TradingApiAxiosParamCreator = function (configuration) {
121
121
  const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
122
122
  const localVarQueryParameter = {};
123
123
  // authentication PartnerClientId required
124
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
124
+ yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
125
125
  // authentication PartnerSignature required
126
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
126
+ yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
127
127
  // authentication PartnerTimestamp required
128
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
128
+ yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
129
129
  if (userId !== undefined) {
130
130
  localVarQueryParameter['userId'] = userId;
131
131
  }
@@ -181,11 +181,11 @@ const TradingApiAxiosParamCreator = function (configuration) {
181
181
  const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
182
182
  const localVarQueryParameter = {};
183
183
  // authentication PartnerClientId required
184
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
184
+ yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
185
185
  // authentication PartnerSignature required
186
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
186
+ yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
187
187
  // authentication PartnerTimestamp required
188
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
188
+ yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
189
189
  if (userId !== undefined) {
190
190
  localVarQueryParameter['userId'] = userId;
191
191
  }
@@ -239,11 +239,11 @@ const TradingApiAxiosParamCreator = function (configuration) {
239
239
  const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
240
240
  const localVarQueryParameter = {};
241
241
  // authentication PartnerClientId required
242
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
242
+ yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
243
243
  // authentication PartnerSignature required
244
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
244
+ yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
245
245
  // authentication PartnerTimestamp required
246
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
246
+ yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
247
247
  if (userId !== undefined) {
248
248
  localVarQueryParameter['userId'] = userId;
249
249
  }
@@ -295,11 +295,11 @@ const TradingApiAxiosParamCreator = function (configuration) {
295
295
  const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
296
296
  const localVarQueryParameter = {};
297
297
  // authentication PartnerClientId required
298
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
298
+ yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
299
299
  // authentication PartnerSignature required
300
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
300
+ yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
301
301
  // authentication PartnerTimestamp required
302
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
302
+ yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
303
303
  if (userId !== undefined) {
304
304
  localVarQueryParameter['userId'] = userId;
305
305
  }
@@ -329,10 +329,11 @@ const TradingApiAxiosParamCreator = function (configuration) {
329
329
  * @param {string} tradeId The ID of trade object obtained from trade/impact endpoint
330
330
  * @param {string} userId
331
331
  * @param {string} userSecret
332
+ * @param {ValidatedTradeBody} [validatedTradeBody]
332
333
  * @param {*} [options] Override http request option.
333
334
  * @throws {RequiredError}
334
335
  */
335
- placeOrder: (tradeId, userId, userSecret, options = {}) => __awaiter(this, void 0, void 0, function* () {
336
+ placeOrder: (tradeId, userId, userSecret, validatedTradeBody, options = {}) => __awaiter(this, void 0, void 0, function* () {
336
337
  // verify required parameter 'tradeId' is not null or undefined
337
338
  (0, common_1.assertParamExists)('placeOrder', 'tradeId', tradeId);
338
339
  // verify required parameter 'userId' is not null or undefined
@@ -351,25 +352,28 @@ const TradingApiAxiosParamCreator = function (configuration) {
351
352
  const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
352
353
  const localVarQueryParameter = {};
353
354
  // authentication PartnerClientId required
354
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
355
+ yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
355
356
  // authentication PartnerSignature required
356
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
357
+ yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
357
358
  // authentication PartnerTimestamp required
358
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
359
+ yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
359
360
  if (userId !== undefined) {
360
361
  localVarQueryParameter['userId'] = userId;
361
362
  }
362
363
  if (userSecret !== undefined) {
363
364
  localVarQueryParameter['userSecret'] = userSecret;
364
365
  }
366
+ localVarHeaderParameter['Content-Type'] = 'application/json';
365
367
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
366
368
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
367
369
  (0, requestBeforeHook_1.requestBeforeHook)({
370
+ requestBody: validatedTradeBody,
368
371
  queryParameters: localVarQueryParameter,
369
372
  requestConfig: localVarRequestOptions,
370
373
  path: localVarPath,
371
374
  configuration
372
375
  });
376
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(validatedTradeBody, localVarRequestOptions, configuration);
373
377
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
374
378
  return {
375
379
  url: (0, common_1.toPathString)(localVarUrlObj),
@@ -461,7 +465,7 @@ const TradingApiFp = function (configuration) {
461
465
  */
462
466
  placeOrder(requestParameters, options) {
463
467
  return __awaiter(this, void 0, void 0, function* () {
464
- const localVarAxiosArgs = yield localVarAxiosParamCreator.placeOrder(requestParameters.tradeId, requestParameters.userId, requestParameters.userSecret, options);
468
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.placeOrder(requestParameters.tradeId, requestParameters.userId, requestParameters.userSecret, requestParameters, options);
465
469
  return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
466
470
  });
467
471
  },
@@ -64,11 +64,11 @@ const TransactionsAndReportingApiAxiosParamCreator = function (configuration) {
64
64
  const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
65
65
  const localVarQueryParameter = {};
66
66
  // authentication PartnerClientId required
67
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
67
+ yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
68
68
  // authentication PartnerSignature required
69
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
69
+ yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
70
70
  // authentication PartnerTimestamp required
71
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
71
+ yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
72
72
  if (startDate !== undefined) {
73
73
  localVarQueryParameter['startDate'] = (startDate instanceof Date) ?
74
74
  startDate.toISOString().substr(0, 10) :
@@ -142,11 +142,11 @@ const TransactionsAndReportingApiAxiosParamCreator = function (configuration) {
142
142
  const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
143
143
  const localVarQueryParameter = {};
144
144
  // authentication PartnerClientId required
145
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
145
+ yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
146
146
  // authentication PartnerSignature required
147
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
147
+ yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
148
148
  // authentication PartnerTimestamp required
149
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
149
+ yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
150
150
  if (startDate !== undefined) {
151
151
  localVarQueryParameter['startDate'] = (startDate instanceof Date) ?
152
152
  startDate.toISOString().substr(0, 10) :