snaptrade-typescript-sdk 9.0.166 → 9.0.168
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 +46 -3
- package/dist/api/account-information-api-generated.d.ts +4 -4
- package/dist/api/account-information-api-generated.js +4 -4
- package/dist/api/options-api-generated.d.ts +61 -0
- package/dist/api/options-api-generated.js +91 -0
- package/dist/browser.js +1 -1
- package/dist/configuration.js +1 -1
- package/dist/models/account-simple.d.ts +6 -0
- package/dist/models/account.d.ts +6 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/dist/models/option-quote.d.ts +80 -0
- package/dist/models/option-quote.js +2 -0
- package/dist/operationParameterMap.js +13 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Connect brokerage accounts to your app for live positions and trading
|
|
8
8
|
|
|
9
|
-
[](https://www.npmjs.com/package/snaptrade-typescript-sdk/v/9.0.168)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -46,6 +46,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
46
46
|
* [`snaptrade.experimentalEndpoints.getUserAccountOrderDetailV2`](#snaptradeexperimentalendpointsgetuseraccountorderdetailv2)
|
|
47
47
|
* [`snaptrade.experimentalEndpoints.getUserAccountOrdersV2`](#snaptradeexperimentalendpointsgetuseraccountordersv2)
|
|
48
48
|
* [`snaptrade.experimentalEndpoints.getUserAccountRecentOrdersV2`](#snaptradeexperimentalendpointsgetuseraccountrecentordersv2)
|
|
49
|
+
* [`snaptrade.options.getOptionQuote`](#snaptradeoptionsgetoptionquote)
|
|
49
50
|
* [`snaptrade.options.getOptionsChain`](#snaptradeoptionsgetoptionschain)
|
|
50
51
|
* [`snaptrade.options.listOptionHoldings`](#snaptradeoptionslistoptionholdings)
|
|
51
52
|
* [`snaptrade.referenceData.getCurrencyExchangeRatePair`](#snaptradereferencedatagetcurrencyexchangeratepair)
|
|
@@ -661,9 +662,11 @@ const getUserHoldingsResponse =
|
|
|
661
662
|
|
|
662
663
|
Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user.
|
|
663
664
|
|
|
665
|
+
Please note that this data is cached and only refreshed once a day.
|
|
666
|
+
|
|
664
667
|
Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access:
|
|
665
|
-
- If you do,
|
|
666
|
-
- If you don't, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization)
|
|
668
|
+
- If you do, real-time data can be fetched using the [update account details endpoint](/reference/Account%20Information/AccountInformation_getUserAccountDetails).
|
|
669
|
+
- If you don't, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
667
670
|
|
|
668
671
|
|
|
669
672
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
@@ -1360,6 +1363,46 @@ Defaults to true. Indicates if request should fetch only executed orders. Set to
|
|
|
1360
1363
|
---
|
|
1361
1364
|
|
|
1362
1365
|
|
|
1366
|
+
### `snaptrade.options.getOptionQuote`<a id="snaptradeoptionsgetoptionquote"></a>
|
|
1367
|
+
|
|
1368
|
+
Returns a real-time quote for a single option contract. The option contract is specified using an OCC-formatted symbol.
|
|
1369
|
+
|
|
1370
|
+
OCC format: `AAPL 251219C00150000` (underlying padded to 6 characters with spaces, followed by date, put/call, and strike).
|
|
1371
|
+
|
|
1372
|
+
|
|
1373
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1374
|
+
|
|
1375
|
+
```typescript
|
|
1376
|
+
const getOptionQuoteResponse = await snaptrade.options.getOptionQuote({
|
|
1377
|
+
userId: "snaptrade-user-123",
|
|
1378
|
+
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1379
|
+
symbol: "AAPL 251219C00150000",
|
|
1380
|
+
});
|
|
1381
|
+
```
|
|
1382
|
+
|
|
1383
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1384
|
+
|
|
1385
|
+
##### userId: `string`<a id="userid-string"></a>
|
|
1386
|
+
|
|
1387
|
+
##### userSecret: `string`<a id="usersecret-string"></a>
|
|
1388
|
+
|
|
1389
|
+
##### symbol: `string`<a id="symbol-string"></a>
|
|
1390
|
+
|
|
1391
|
+
The OCC-formatted option symbol.
|
|
1392
|
+
|
|
1393
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
1394
|
+
|
|
1395
|
+
[OptionQuote](./models/option-quote.ts)
|
|
1396
|
+
|
|
1397
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1398
|
+
|
|
1399
|
+
`/marketData/options/quotes` `GET`
|
|
1400
|
+
|
|
1401
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1402
|
+
|
|
1403
|
+
---
|
|
1404
|
+
|
|
1405
|
+
|
|
1363
1406
|
### `snaptrade.options.getOptionsChain`<a id="snaptradeoptionsgetoptionschain"></a>
|
|
1364
1407
|
|
|
1365
1408
|
Returns the option chain for the specified symbol in the specified account.
|
|
@@ -127,7 +127,7 @@ export declare const AccountInformationApiAxiosParamCreator: (configuration?: Co
|
|
|
127
127
|
*/
|
|
128
128
|
getUserHoldings: (accountId: string, userId: string, userSecret: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
129
129
|
/**
|
|
130
|
-
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do,
|
|
130
|
+
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Please note that this data is cached and only refreshed once a day. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, real-time data can be fetched using the [update account details endpoint](/reference/Account%20Information/AccountInformation_getUserAccountDetails). - If you don\'t, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
131
131
|
* @summary List accounts
|
|
132
132
|
* @param {string} userId
|
|
133
133
|
* @param {string} userSecret
|
|
@@ -233,7 +233,7 @@ export declare const AccountInformationApiFp: (configuration?: Configuration) =>
|
|
|
233
233
|
*/
|
|
234
234
|
getUserHoldings(requestParameters: AccountInformationApiGetUserHoldingsRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AccountHoldingsAccount>>;
|
|
235
235
|
/**
|
|
236
|
-
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do,
|
|
236
|
+
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Please note that this data is cached and only refreshed once a day. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, real-time data can be fetched using the [update account details endpoint](/reference/Account%20Information/AccountInformation_getUserAccountDetails). - If you don\'t, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
237
237
|
* @summary List accounts
|
|
238
238
|
* @param {AccountInformationApiListUserAccountsRequest} requestParameters Request parameters.
|
|
239
239
|
* @param {*} [options] Override http request option.
|
|
@@ -336,7 +336,7 @@ export declare const AccountInformationApiFactory: (configuration?: Configuratio
|
|
|
336
336
|
*/
|
|
337
337
|
getUserHoldings(requestParameters: AccountInformationApiGetUserHoldingsRequest, options?: AxiosRequestConfig): AxiosPromise<AccountHoldingsAccount>;
|
|
338
338
|
/**
|
|
339
|
-
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do,
|
|
339
|
+
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Please note that this data is cached and only refreshed once a day. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, real-time data can be fetched using the [update account details endpoint](/reference/Account%20Information/AccountInformation_getUserAccountDetails). - If you don\'t, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
340
340
|
* @summary List accounts
|
|
341
341
|
* @param {AccountInformationApiListUserAccountsRequest} requestParameters Request parameters.
|
|
342
342
|
* @param {*} [options] Override http request option.
|
|
@@ -793,7 +793,7 @@ export declare class AccountInformationApiGenerated extends BaseAPI {
|
|
|
793
793
|
*/
|
|
794
794
|
getUserHoldings(requestParameters: AccountInformationApiGetUserHoldingsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<AccountHoldingsAccount, any>>;
|
|
795
795
|
/**
|
|
796
|
-
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do,
|
|
796
|
+
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Please note that this data is cached and only refreshed once a day. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, real-time data can be fetched using the [update account details endpoint](/reference/Account%20Information/AccountInformation_getUserAccountDetails). - If you don\'t, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
797
797
|
* @summary List accounts
|
|
798
798
|
* @param {AccountInformationApiListUserAccountsRequest} requestParameters Request parameters.
|
|
799
799
|
* @param {*} [options] Override http request option.
|
|
@@ -629,7 +629,7 @@ const AccountInformationApiAxiosParamCreator = function (configuration) {
|
|
|
629
629
|
};
|
|
630
630
|
}),
|
|
631
631
|
/**
|
|
632
|
-
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do,
|
|
632
|
+
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Please note that this data is cached and only refreshed once a day. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, real-time data can be fetched using the [update account details endpoint](/reference/Account%20Information/AccountInformation_getUserAccountDetails). - If you don\'t, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
633
633
|
* @summary List accounts
|
|
634
634
|
* @param {string} userId
|
|
635
635
|
* @param {string} userSecret
|
|
@@ -879,7 +879,7 @@ const AccountInformationApiFp = function (configuration) {
|
|
|
879
879
|
});
|
|
880
880
|
},
|
|
881
881
|
/**
|
|
882
|
-
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do,
|
|
882
|
+
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Please note that this data is cached and only refreshed once a day. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, real-time data can be fetched using the [update account details endpoint](/reference/Account%20Information/AccountInformation_getUserAccountDetails). - If you don\'t, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
883
883
|
* @summary List accounts
|
|
884
884
|
* @param {AccountInformationApiListUserAccountsRequest} requestParameters Request parameters.
|
|
885
885
|
* @param {*} [options] Override http request option.
|
|
@@ -1016,7 +1016,7 @@ const AccountInformationApiFactory = function (configuration, basePath, axios) {
|
|
|
1016
1016
|
return localVarFp.getUserHoldings(requestParameters, options).then((request) => request(axios, basePath));
|
|
1017
1017
|
},
|
|
1018
1018
|
/**
|
|
1019
|
-
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do,
|
|
1019
|
+
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Please note that this data is cached and only refreshed once a day. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, real-time data can be fetched using the [update account details endpoint](/reference/Account%20Information/AccountInformation_getUserAccountDetails). - If you don\'t, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
1020
1020
|
* @summary List accounts
|
|
1021
1021
|
* @param {AccountInformationApiListUserAccountsRequest} requestParameters Request parameters.
|
|
1022
1022
|
* @param {*} [options] Override http request option.
|
|
@@ -1157,7 +1157,7 @@ class AccountInformationApiGenerated extends base_1.BaseAPI {
|
|
|
1157
1157
|
return (0, exports.AccountInformationApiFp)(this.configuration).getUserHoldings(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1158
1158
|
}
|
|
1159
1159
|
/**
|
|
1160
|
-
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do,
|
|
1160
|
+
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. Please note that this data is cached and only refreshed once a day. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, real-time data can be fetched using the [update account details endpoint](/reference/Account%20Information/AccountInformation_getUserAccountDetails). - If you don\'t, the data is cached and refreshed once a day. If you need real-time, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
1161
1161
|
* @summary List accounts
|
|
1162
1162
|
* @param {AccountInformationApiListUserAccountsRequest} requestParameters Request parameters.
|
|
1163
1163
|
* @param {*} [options] Override http request option.
|
|
@@ -2,12 +2,23 @@ import { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
|
2
2
|
import { Configuration } from '../configuration';
|
|
3
3
|
import { RequestArgs, BaseAPI } from '../base';
|
|
4
4
|
import { OptionChainInner } from '../models';
|
|
5
|
+
import { OptionQuote } from '../models';
|
|
5
6
|
import { OptionsPosition } from '../models';
|
|
6
7
|
/**
|
|
7
8
|
* OptionsApi - axios parameter creator
|
|
8
9
|
* @export
|
|
9
10
|
*/
|
|
10
11
|
export declare const OptionsApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
12
|
+
/**
|
|
13
|
+
* Returns a real-time quote for a single option contract. The option contract is specified using an OCC-formatted symbol. OCC format: `AAPL 251219C00150000` (underlying padded to 6 characters with spaces, followed by date, put/call, and strike).
|
|
14
|
+
* @summary Get option quote
|
|
15
|
+
* @param {string} userId
|
|
16
|
+
* @param {string} userSecret
|
|
17
|
+
* @param {string} symbol The OCC-formatted option symbol.
|
|
18
|
+
* @param {*} [options] Override http request option.
|
|
19
|
+
* @throws {RequiredError}
|
|
20
|
+
*/
|
|
21
|
+
getOptionQuote: (userId: string, userSecret: string, symbol: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
11
22
|
/**
|
|
12
23
|
* Returns the option chain for the specified symbol in the specified account.
|
|
13
24
|
* @summary Get the options chain for a symbol
|
|
@@ -35,6 +46,14 @@ export declare const OptionsApiAxiosParamCreator: (configuration?: Configuration
|
|
|
35
46
|
* @export
|
|
36
47
|
*/
|
|
37
48
|
export declare const OptionsApiFp: (configuration?: Configuration) => {
|
|
49
|
+
/**
|
|
50
|
+
* Returns a real-time quote for a single option contract. The option contract is specified using an OCC-formatted symbol. OCC format: `AAPL 251219C00150000` (underlying padded to 6 characters with spaces, followed by date, put/call, and strike).
|
|
51
|
+
* @summary Get option quote
|
|
52
|
+
* @param {OptionsApiGetOptionQuoteRequest} requestParameters Request parameters.
|
|
53
|
+
* @param {*} [options] Override http request option.
|
|
54
|
+
* @throws {RequiredError}
|
|
55
|
+
*/
|
|
56
|
+
getOptionQuote(requestParameters: OptionsApiGetOptionQuoteRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<OptionQuote>>;
|
|
38
57
|
/**
|
|
39
58
|
* Returns the option chain for the specified symbol in the specified account.
|
|
40
59
|
* @summary Get the options chain for a symbol
|
|
@@ -57,6 +76,14 @@ export declare const OptionsApiFp: (configuration?: Configuration) => {
|
|
|
57
76
|
* @export
|
|
58
77
|
*/
|
|
59
78
|
export declare const OptionsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
79
|
+
/**
|
|
80
|
+
* Returns a real-time quote for a single option contract. The option contract is specified using an OCC-formatted symbol. OCC format: `AAPL 251219C00150000` (underlying padded to 6 characters with spaces, followed by date, put/call, and strike).
|
|
81
|
+
* @summary Get option quote
|
|
82
|
+
* @param {OptionsApiGetOptionQuoteRequest} requestParameters Request parameters.
|
|
83
|
+
* @param {*} [options] Override http request option.
|
|
84
|
+
* @throws {RequiredError}
|
|
85
|
+
*/
|
|
86
|
+
getOptionQuote(requestParameters: OptionsApiGetOptionQuoteRequest, options?: AxiosRequestConfig): AxiosPromise<OptionQuote>;
|
|
60
87
|
/**
|
|
61
88
|
* Returns the option chain for the specified symbol in the specified account.
|
|
62
89
|
* @summary Get the options chain for a symbol
|
|
@@ -74,6 +101,31 @@ export declare const OptionsApiFactory: (configuration?: Configuration, basePath
|
|
|
74
101
|
*/
|
|
75
102
|
listOptionHoldings(requestParameters: OptionsApiListOptionHoldingsRequest, options?: AxiosRequestConfig): AxiosPromise<Array<OptionsPosition>>;
|
|
76
103
|
};
|
|
104
|
+
/**
|
|
105
|
+
* Request parameters for getOptionQuote operation in OptionsApi.
|
|
106
|
+
* @export
|
|
107
|
+
* @interface OptionsApiGetOptionQuoteRequest
|
|
108
|
+
*/
|
|
109
|
+
export type OptionsApiGetOptionQuoteRequest = {
|
|
110
|
+
/**
|
|
111
|
+
*
|
|
112
|
+
* @type {string}
|
|
113
|
+
* @memberof OptionsApiGetOptionQuote
|
|
114
|
+
*/
|
|
115
|
+
readonly userId: string;
|
|
116
|
+
/**
|
|
117
|
+
*
|
|
118
|
+
* @type {string}
|
|
119
|
+
* @memberof OptionsApiGetOptionQuote
|
|
120
|
+
*/
|
|
121
|
+
readonly userSecret: string;
|
|
122
|
+
/**
|
|
123
|
+
* The OCC-formatted option symbol.
|
|
124
|
+
* @type {string}
|
|
125
|
+
* @memberof OptionsApiGetOptionQuote
|
|
126
|
+
*/
|
|
127
|
+
readonly symbol: string;
|
|
128
|
+
};
|
|
77
129
|
/**
|
|
78
130
|
* Request parameters for getOptionsChain operation in OptionsApi.
|
|
79
131
|
* @export
|
|
@@ -137,6 +189,15 @@ export type OptionsApiListOptionHoldingsRequest = {
|
|
|
137
189
|
* @extends {BaseAPI}
|
|
138
190
|
*/
|
|
139
191
|
export declare class OptionsApiGenerated extends BaseAPI {
|
|
192
|
+
/**
|
|
193
|
+
* Returns a real-time quote for a single option contract. The option contract is specified using an OCC-formatted symbol. OCC format: `AAPL 251219C00150000` (underlying padded to 6 characters with spaces, followed by date, put/call, and strike).
|
|
194
|
+
* @summary Get option quote
|
|
195
|
+
* @param {OptionsApiGetOptionQuoteRequest} requestParameters Request parameters.
|
|
196
|
+
* @param {*} [options] Override http request option.
|
|
197
|
+
* @throws {RequiredError}
|
|
198
|
+
* @memberof OptionsApiGenerated
|
|
199
|
+
*/
|
|
200
|
+
getOptionQuote(requestParameters: OptionsApiGetOptionQuoteRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<OptionQuote, any>>;
|
|
140
201
|
/**
|
|
141
202
|
* Returns the option chain for the specified symbol in the specified account.
|
|
142
203
|
* @summary Get the options chain for a symbol
|
|
@@ -35,6 +35,63 @@ const requestBeforeHook_1 = require("../requestBeforeHook");
|
|
|
35
35
|
*/
|
|
36
36
|
const OptionsApiAxiosParamCreator = function (configuration) {
|
|
37
37
|
return {
|
|
38
|
+
/**
|
|
39
|
+
* Returns a real-time quote for a single option contract. The option contract is specified using an OCC-formatted symbol. OCC format: `AAPL 251219C00150000` (underlying padded to 6 characters with spaces, followed by date, put/call, and strike).
|
|
40
|
+
* @summary Get option quote
|
|
41
|
+
* @param {string} userId
|
|
42
|
+
* @param {string} userSecret
|
|
43
|
+
* @param {string} symbol The OCC-formatted option symbol.
|
|
44
|
+
* @param {*} [options] Override http request option.
|
|
45
|
+
* @throws {RequiredError}
|
|
46
|
+
*/
|
|
47
|
+
getOptionQuote: (userId, userSecret, symbol, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
// verify required parameter 'userId' is not null or undefined
|
|
49
|
+
(0, common_1.assertParamExists)('getOptionQuote', 'userId', userId);
|
|
50
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
51
|
+
(0, common_1.assertParamExists)('getOptionQuote', 'userSecret', userSecret);
|
|
52
|
+
// verify required parameter 'symbol' is not null or undefined
|
|
53
|
+
(0, common_1.assertParamExists)('getOptionQuote', 'symbol', symbol);
|
|
54
|
+
const localVarPath = `/marketData/options/quotes`;
|
|
55
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
56
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
57
|
+
let baseOptions;
|
|
58
|
+
if (configuration) {
|
|
59
|
+
baseOptions = configuration.baseOptions;
|
|
60
|
+
}
|
|
61
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
62
|
+
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
63
|
+
const localVarQueryParameter = {};
|
|
64
|
+
// authentication PartnerClientId required
|
|
65
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
|
|
66
|
+
// authentication PartnerSignature required
|
|
67
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
|
|
68
|
+
// authentication PartnerTimestamp required
|
|
69
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
|
|
70
|
+
if (userId !== undefined) {
|
|
71
|
+
localVarQueryParameter['userId'] = userId;
|
|
72
|
+
}
|
|
73
|
+
if (userSecret !== undefined) {
|
|
74
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
75
|
+
}
|
|
76
|
+
if (symbol !== undefined) {
|
|
77
|
+
localVarQueryParameter['symbol'] = symbol;
|
|
78
|
+
}
|
|
79
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
80
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
81
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
82
|
+
queryParameters: localVarQueryParameter,
|
|
83
|
+
requestConfig: localVarRequestOptions,
|
|
84
|
+
path: localVarPath,
|
|
85
|
+
configuration,
|
|
86
|
+
pathTemplate: '/marketData/options/quotes',
|
|
87
|
+
httpMethod: 'GET'
|
|
88
|
+
});
|
|
89
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
90
|
+
return {
|
|
91
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
92
|
+
options: localVarRequestOptions,
|
|
93
|
+
};
|
|
94
|
+
}),
|
|
38
95
|
/**
|
|
39
96
|
* Returns the option chain for the specified symbol in the specified account.
|
|
40
97
|
* @summary Get the options chain for a symbol
|
|
@@ -161,6 +218,19 @@ exports.OptionsApiAxiosParamCreator = OptionsApiAxiosParamCreator;
|
|
|
161
218
|
const OptionsApiFp = function (configuration) {
|
|
162
219
|
const localVarAxiosParamCreator = (0, exports.OptionsApiAxiosParamCreator)(configuration);
|
|
163
220
|
return {
|
|
221
|
+
/**
|
|
222
|
+
* Returns a real-time quote for a single option contract. The option contract is specified using an OCC-formatted symbol. OCC format: `AAPL 251219C00150000` (underlying padded to 6 characters with spaces, followed by date, put/call, and strike).
|
|
223
|
+
* @summary Get option quote
|
|
224
|
+
* @param {OptionsApiGetOptionQuoteRequest} requestParameters Request parameters.
|
|
225
|
+
* @param {*} [options] Override http request option.
|
|
226
|
+
* @throws {RequiredError}
|
|
227
|
+
*/
|
|
228
|
+
getOptionQuote(requestParameters, options) {
|
|
229
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
230
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getOptionQuote(requestParameters.userId, requestParameters.userSecret, requestParameters.symbol, options);
|
|
231
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
232
|
+
});
|
|
233
|
+
},
|
|
164
234
|
/**
|
|
165
235
|
* Returns the option chain for the specified symbol in the specified account.
|
|
166
236
|
* @summary Get the options chain for a symbol
|
|
@@ -197,6 +267,16 @@ exports.OptionsApiFp = OptionsApiFp;
|
|
|
197
267
|
const OptionsApiFactory = function (configuration, basePath, axios) {
|
|
198
268
|
const localVarFp = (0, exports.OptionsApiFp)(configuration);
|
|
199
269
|
return {
|
|
270
|
+
/**
|
|
271
|
+
* Returns a real-time quote for a single option contract. The option contract is specified using an OCC-formatted symbol. OCC format: `AAPL 251219C00150000` (underlying padded to 6 characters with spaces, followed by date, put/call, and strike).
|
|
272
|
+
* @summary Get option quote
|
|
273
|
+
* @param {OptionsApiGetOptionQuoteRequest} requestParameters Request parameters.
|
|
274
|
+
* @param {*} [options] Override http request option.
|
|
275
|
+
* @throws {RequiredError}
|
|
276
|
+
*/
|
|
277
|
+
getOptionQuote(requestParameters, options) {
|
|
278
|
+
return localVarFp.getOptionQuote(requestParameters, options).then((request) => request(axios, basePath));
|
|
279
|
+
},
|
|
200
280
|
/**
|
|
201
281
|
* Returns the option chain for the specified symbol in the specified account.
|
|
202
282
|
* @summary Get the options chain for a symbol
|
|
@@ -227,6 +307,17 @@ exports.OptionsApiFactory = OptionsApiFactory;
|
|
|
227
307
|
* @extends {BaseAPI}
|
|
228
308
|
*/
|
|
229
309
|
class OptionsApiGenerated extends base_1.BaseAPI {
|
|
310
|
+
/**
|
|
311
|
+
* Returns a real-time quote for a single option contract. The option contract is specified using an OCC-formatted symbol. OCC format: `AAPL 251219C00150000` (underlying padded to 6 characters with spaces, followed by date, put/call, and strike).
|
|
312
|
+
* @summary Get option quote
|
|
313
|
+
* @param {OptionsApiGetOptionQuoteRequest} requestParameters Request parameters.
|
|
314
|
+
* @param {*} [options] Override http request option.
|
|
315
|
+
* @throws {RequiredError}
|
|
316
|
+
* @memberof OptionsApiGenerated
|
|
317
|
+
*/
|
|
318
|
+
getOptionQuote(requestParameters, options) {
|
|
319
|
+
return (0, exports.OptionsApiFp)(this.configuration).getOptionQuote(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
320
|
+
}
|
|
230
321
|
/**
|
|
231
322
|
* Returns the option chain for the specified symbol in the specified account.
|
|
232
323
|
* @summary Get the options chain for a symbol
|