snaptrade-typescript-sdk 9.0.174 → 9.0.176
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 +13 -11
- package/dist/api/options-api-generated.d.ts +18 -18
- package/dist/api/options-api-generated.js +18 -18
- package/dist/api/trading-api-generated.d.ts +4 -4
- package/dist/api/trading-api-generated.js +4 -4
- package/dist/browser.js +1 -1
- package/dist/configuration.js +1 -1
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/dist/models/option-quote-greeks.d.ts +32 -0
- package/dist/models/option-quote-greeks.js +2 -0
- package/dist/models/option-quote.d.ts +9 -50
- package/dist/models/order-updated-response-order.d.ts +146 -0
- package/dist/models/order-updated-response-order.js +2 -0
- package/dist/models/order-updated-response.d.ts +3 -3
- package/dist/models/position.d.ts +1 -1
- package/package.json +1 -1
package/dist/configuration.js
CHANGED
|
@@ -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.176/typescript" : param.userAgent;
|
|
36
36
|
this.formDataCtor = param.formDataCtor;
|
|
37
37
|
}
|
|
38
38
|
/**
|
package/dist/models/index.d.ts
CHANGED
|
@@ -96,6 +96,7 @@ export * from './option-chain-inner-chain-per-root-inner-chain-per-strike-price-
|
|
|
96
96
|
export * from './option-impact';
|
|
97
97
|
export * from './option-leg';
|
|
98
98
|
export * from './option-quote';
|
|
99
|
+
export * from './option-quote-greeks';
|
|
99
100
|
export * from './option-strategy';
|
|
100
101
|
export * from './option-strategy-legs-inner';
|
|
101
102
|
export * from './options-position';
|
|
@@ -103,6 +104,7 @@ export * from './options-position-currency';
|
|
|
103
104
|
export * from './options-symbol';
|
|
104
105
|
export * from './order-type-strict';
|
|
105
106
|
export * from './order-updated-response';
|
|
107
|
+
export * from './order-updated-response-order';
|
|
106
108
|
export * from './paginated-universal-activity';
|
|
107
109
|
export * from './pagination-details';
|
|
108
110
|
export * from './partner-data';
|
package/dist/models/index.js
CHANGED
|
@@ -112,6 +112,7 @@ __exportStar(require("./option-chain-inner-chain-per-root-inner-chain-per-strike
|
|
|
112
112
|
__exportStar(require("./option-impact"), exports);
|
|
113
113
|
__exportStar(require("./option-leg"), exports);
|
|
114
114
|
__exportStar(require("./option-quote"), exports);
|
|
115
|
+
__exportStar(require("./option-quote-greeks"), exports);
|
|
115
116
|
__exportStar(require("./option-strategy"), exports);
|
|
116
117
|
__exportStar(require("./option-strategy-legs-inner"), exports);
|
|
117
118
|
__exportStar(require("./options-position"), exports);
|
|
@@ -119,6 +120,7 @@ __exportStar(require("./options-position-currency"), exports);
|
|
|
119
120
|
__exportStar(require("./options-symbol"), exports);
|
|
120
121
|
__exportStar(require("./order-type-strict"), exports);
|
|
121
122
|
__exportStar(require("./order-updated-response"), exports);
|
|
123
|
+
__exportStar(require("./order-updated-response-order"), exports);
|
|
122
124
|
__exportStar(require("./paginated-universal-activity"), exports);
|
|
123
125
|
__exportStar(require("./pagination-details"), exports);
|
|
124
126
|
__exportStar(require("./partner-data"), exports);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Greeks for the option contract.
|
|
3
|
+
* @export
|
|
4
|
+
* @interface OptionQuoteGreeks
|
|
5
|
+
*/
|
|
6
|
+
export interface OptionQuoteGreeks {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
/**
|
|
9
|
+
* Delta represents the rate of change between the option\'s price and a $1 change in the underlying asset\'s price.
|
|
10
|
+
* @type {number}
|
|
11
|
+
* @memberof OptionQuoteGreeks
|
|
12
|
+
*/
|
|
13
|
+
'delta'?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Gamma represents the rate of change between an option\'s delta and the underlying asset\'s price.
|
|
16
|
+
* @type {number}
|
|
17
|
+
* @memberof OptionQuoteGreeks
|
|
18
|
+
*/
|
|
19
|
+
'gamma'?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Theta represents the rate of change between the option price and time, or time sensitivity - sometimes known as an option\'s time decay.
|
|
22
|
+
* @type {number}
|
|
23
|
+
* @memberof OptionQuoteGreeks
|
|
24
|
+
*/
|
|
25
|
+
'theta'?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Vega represents the rate of change between an option\'s value and the underlying asset\'s implied volatility.
|
|
28
|
+
* @type {number}
|
|
29
|
+
* @memberof OptionQuoteGreeks
|
|
30
|
+
*/
|
|
31
|
+
'vega'?: number;
|
|
32
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OptionQuoteGreeks } from './option-quote-greeks';
|
|
1
2
|
/**
|
|
2
3
|
* Real-time quote for a single option contract.
|
|
3
4
|
* @export
|
|
@@ -12,53 +13,11 @@ export interface OptionQuote {
|
|
|
12
13
|
*/
|
|
13
14
|
'symbol'?: string;
|
|
14
15
|
/**
|
|
15
|
-
* The
|
|
16
|
+
* The derived synthetic price of the contract.
|
|
16
17
|
* @type {number}
|
|
17
18
|
* @memberof OptionQuote
|
|
18
19
|
*/
|
|
19
|
-
'
|
|
20
|
-
/**
|
|
21
|
-
* The number of contracts available at the bid price.
|
|
22
|
-
* @type {number}
|
|
23
|
-
* @memberof OptionQuote
|
|
24
|
-
*/
|
|
25
|
-
'bid_size'?: number;
|
|
26
|
-
/**
|
|
27
|
-
* The best ask price for the option contract.
|
|
28
|
-
* @type {number}
|
|
29
|
-
* @memberof OptionQuote
|
|
30
|
-
*/
|
|
31
|
-
'ask_price'?: number;
|
|
32
|
-
/**
|
|
33
|
-
* The number of contracts available at the ask price.
|
|
34
|
-
* @type {number}
|
|
35
|
-
* @memberof OptionQuote
|
|
36
|
-
*/
|
|
37
|
-
'ask_size'?: number;
|
|
38
|
-
/**
|
|
39
|
-
* The price of the last trade for the option contract.
|
|
40
|
-
* @type {number}
|
|
41
|
-
* @memberof OptionQuote
|
|
42
|
-
*/
|
|
43
|
-
'last_price'?: number;
|
|
44
|
-
/**
|
|
45
|
-
* The number of contracts in the last trade.
|
|
46
|
-
* @type {number}
|
|
47
|
-
* @memberof OptionQuote
|
|
48
|
-
*/
|
|
49
|
-
'last_size'?: number;
|
|
50
|
-
/**
|
|
51
|
-
* The total number of outstanding contracts.
|
|
52
|
-
* @type {number}
|
|
53
|
-
* @memberof OptionQuote
|
|
54
|
-
*/
|
|
55
|
-
'open_interest'?: number;
|
|
56
|
-
/**
|
|
57
|
-
* The total number of contracts traded during the current session.
|
|
58
|
-
* @type {number}
|
|
59
|
-
* @memberof OptionQuote
|
|
60
|
-
*/
|
|
61
|
-
'volume'?: number;
|
|
20
|
+
'synthetic_price'?: number;
|
|
62
21
|
/**
|
|
63
22
|
* The implied volatility of the option contract.
|
|
64
23
|
* @type {number}
|
|
@@ -66,15 +25,15 @@ export interface OptionQuote {
|
|
|
66
25
|
*/
|
|
67
26
|
'implied_volatility'?: number;
|
|
68
27
|
/**
|
|
69
|
-
* The
|
|
70
|
-
* @type {
|
|
28
|
+
* The timestamp of the last update for the option quote.
|
|
29
|
+
* @type {string}
|
|
71
30
|
* @memberof OptionQuote
|
|
72
31
|
*/
|
|
73
|
-
'
|
|
32
|
+
'timestamp'?: string | null;
|
|
74
33
|
/**
|
|
75
|
-
*
|
|
76
|
-
* @type {
|
|
34
|
+
*
|
|
35
|
+
* @type {OptionQuoteGreeks}
|
|
77
36
|
* @memberof OptionQuote
|
|
78
37
|
*/
|
|
79
|
-
'
|
|
38
|
+
'greeks'?: OptionQuoteGreeks;
|
|
80
39
|
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { AccountOrderRecordChildBrokerageOrderIds } from './account-order-record-child-brokerage-order-ids';
|
|
2
|
+
import { AccountOrderRecordOptionSymbol } from './account-order-record-option-symbol';
|
|
3
|
+
import { AccountOrderRecordQuoteCurrency } from './account-order-record-quote-currency';
|
|
4
|
+
import { AccountOrderRecordQuoteUniversalSymbol } from './account-order-record-quote-universal-symbol';
|
|
5
|
+
import { AccountOrderRecordStatus } from './account-order-record-status';
|
|
6
|
+
import { AccountOrderRecordUniversalSymbol } from './account-order-record-universal-symbol';
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @export
|
|
10
|
+
* @interface OrderUpdatedResponseOrder
|
|
11
|
+
*/
|
|
12
|
+
export interface OrderUpdatedResponseOrder {
|
|
13
|
+
/**
|
|
14
|
+
* Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
|
|
15
|
+
* @type {string}
|
|
16
|
+
* @memberof OrderUpdatedResponseOrder
|
|
17
|
+
*/
|
|
18
|
+
'brokerage_order_id'?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Indicates the status of an order. SnapTrade does a best effort to map brokerage statuses to statuses in this enum. Possible values include: - NONE - PENDING - ACCEPTED - FAILED - REJECTED - CANCELED - PARTIAL_CANCELED - CANCEL_PENDING - EXECUTED - PARTIAL - REPLACE_PENDING - REPLACED - EXPIRED - QUEUED - TRIGGERED - ACTIVATED
|
|
21
|
+
* @type {AccountOrderRecordStatus}
|
|
22
|
+
* @memberof OrderUpdatedResponseOrder
|
|
23
|
+
*/
|
|
24
|
+
'status'?: AccountOrderRecordStatus;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @type {AccountOrderRecordUniversalSymbol}
|
|
28
|
+
* @memberof OrderUpdatedResponseOrder
|
|
29
|
+
*/
|
|
30
|
+
'universal_symbol'?: AccountOrderRecordUniversalSymbol;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @type {AccountOrderRecordOptionSymbol}
|
|
34
|
+
* @memberof OrderUpdatedResponseOrder
|
|
35
|
+
*/
|
|
36
|
+
'option_symbol'?: AccountOrderRecordOptionSymbol;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @type {AccountOrderRecordQuoteUniversalSymbol}
|
|
40
|
+
* @memberof OrderUpdatedResponseOrder
|
|
41
|
+
*/
|
|
42
|
+
'quote_universal_symbol'?: AccountOrderRecordQuoteUniversalSymbol;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @type {AccountOrderRecordQuoteCurrency}
|
|
46
|
+
* @memberof OrderUpdatedResponseOrder
|
|
47
|
+
*/
|
|
48
|
+
'quote_currency'?: AccountOrderRecordQuoteCurrency;
|
|
49
|
+
/**
|
|
50
|
+
* The action describes the intent or side of a trade. This is usually `BUY` or `SELL` but can include other potential values like the following depending on the specific brokerage. - BUY - SELL - BUY_COVER - SELL_SHORT - BUY_OPEN - BUY_CLOSE - SELL_OPEN - SELL_CLOSE
|
|
51
|
+
* @type {string}
|
|
52
|
+
* @memberof OrderUpdatedResponseOrder
|
|
53
|
+
*/
|
|
54
|
+
'action'?: string;
|
|
55
|
+
/**
|
|
56
|
+
* The total number of shares or contracts of the order. This should be the sum of the filled, canceled, and open quantities. Can be a decimal number for fractional shares.
|
|
57
|
+
* @type {string}
|
|
58
|
+
* @memberof OrderUpdatedResponseOrder
|
|
59
|
+
*/
|
|
60
|
+
'total_quantity'?: string | null;
|
|
61
|
+
/**
|
|
62
|
+
* The number of shares or contracts that are still open (waiting for execution). Can be a decimal number for fractional shares.
|
|
63
|
+
* @type {string}
|
|
64
|
+
* @memberof OrderUpdatedResponseOrder
|
|
65
|
+
*/
|
|
66
|
+
'open_quantity'?: string | null;
|
|
67
|
+
/**
|
|
68
|
+
* The number of shares or contracts that have been canceled. Can be a decimal number for fractional shares.
|
|
69
|
+
* @type {string}
|
|
70
|
+
* @memberof OrderUpdatedResponseOrder
|
|
71
|
+
*/
|
|
72
|
+
'canceled_quantity'?: string | null;
|
|
73
|
+
/**
|
|
74
|
+
* The number of shares or contracts that have been filled. Can be a decimal number for fractional shares.
|
|
75
|
+
* @type {string}
|
|
76
|
+
* @memberof OrderUpdatedResponseOrder
|
|
77
|
+
*/
|
|
78
|
+
'filled_quantity'?: string | null;
|
|
79
|
+
/**
|
|
80
|
+
* The price at which the order was executed.
|
|
81
|
+
* @type {number}
|
|
82
|
+
* @memberof OrderUpdatedResponseOrder
|
|
83
|
+
*/
|
|
84
|
+
'execution_price'?: number | null;
|
|
85
|
+
/**
|
|
86
|
+
* The limit price is maximum price one is willing to pay for a buy order or the minimum price one is willing to accept for a sell order. Should only apply to `Limit` and `StopLimit` orders.
|
|
87
|
+
* @type {number}
|
|
88
|
+
* @memberof OrderUpdatedResponseOrder
|
|
89
|
+
*/
|
|
90
|
+
'limit_price'?: number | null;
|
|
91
|
+
/**
|
|
92
|
+
* The stop price is the price at which a stop order is triggered. Should only apply to `Stop` and `StopLimit` orders.
|
|
93
|
+
* @type {number}
|
|
94
|
+
* @memberof OrderUpdatedResponseOrder
|
|
95
|
+
*/
|
|
96
|
+
'stop_price'?: number | null;
|
|
97
|
+
/**
|
|
98
|
+
* The type of order placed. The most common values are `Market`, `Limit`, `Stop`, and `StopLimit`. We try our best to map brokerage order types to these values. When mapping fails, we will return the brokerage\'s order type value.
|
|
99
|
+
* @type {string}
|
|
100
|
+
* @memberof OrderUpdatedResponseOrder
|
|
101
|
+
*/
|
|
102
|
+
'order_type'?: string | null;
|
|
103
|
+
/**
|
|
104
|
+
* The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. We try our best to map brokerage time in force values to the following. When mapping fails, we will return the brokerage\'s time in force value. - `Day` - Day. The order is valid only for the trading day on which it is placed. - `GTC` - Good Til Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or Kill. The order must be executed in its entirety immediately or be canceled completely. - `IOC` - Immediate Or Cancel. The order must be executed immediately. Any portion of the order that cannot be filled immediately will be canceled. - `GTD` - Good Til Date. The order is valid until the specified date. - `MOO` - Market On Open. The order is to be executed at the day\'s opening price. - `EHP` - Extended Hours P.M. The order is to be placed during extended hour trading, after markets close.
|
|
105
|
+
* @type {string}
|
|
106
|
+
* @memberof OrderUpdatedResponseOrder
|
|
107
|
+
*/
|
|
108
|
+
'time_in_force'?: string;
|
|
109
|
+
/**
|
|
110
|
+
* The time the order was placed. This is the time the order was submitted to the brokerage.
|
|
111
|
+
* @type {string}
|
|
112
|
+
* @memberof OrderUpdatedResponseOrder
|
|
113
|
+
*/
|
|
114
|
+
'time_placed'?: string;
|
|
115
|
+
/**
|
|
116
|
+
* The time the order was last updated in the brokerage system. This value is not always available from the brokerage.
|
|
117
|
+
* @type {string}
|
|
118
|
+
* @memberof OrderUpdatedResponseOrder
|
|
119
|
+
*/
|
|
120
|
+
'time_updated'?: string | null;
|
|
121
|
+
/**
|
|
122
|
+
* The time the order was executed in the brokerage system. This value is not always available from the brokerage.
|
|
123
|
+
* @type {string}
|
|
124
|
+
* @memberof OrderUpdatedResponseOrder
|
|
125
|
+
*/
|
|
126
|
+
'time_executed'?: string | null;
|
|
127
|
+
/**
|
|
128
|
+
* The time the order expires. This value is not always available from the brokerage.
|
|
129
|
+
* @type {string}
|
|
130
|
+
* @memberof OrderUpdatedResponseOrder
|
|
131
|
+
*/
|
|
132
|
+
'expiry_date'?: string | null;
|
|
133
|
+
/**
|
|
134
|
+
* A unique ID for the security within SnapTrade, scoped to the brokerage account that the security belongs to. This is a legacy field and should not be used. Do not rely on this being a stable ID as it can change.
|
|
135
|
+
* @type {string}
|
|
136
|
+
* @memberof OrderUpdatedResponseOrder
|
|
137
|
+
* @deprecated
|
|
138
|
+
*/
|
|
139
|
+
'symbol'?: string;
|
|
140
|
+
/**
|
|
141
|
+
*
|
|
142
|
+
* @type {AccountOrderRecordChildBrokerageOrderIds}
|
|
143
|
+
* @memberof OrderUpdatedResponseOrder
|
|
144
|
+
*/
|
|
145
|
+
'child_brokerage_order_ids'?: AccountOrderRecordChildBrokerageOrderIds | null;
|
|
146
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OrderUpdatedResponseOrder } from './order-updated-response-order';
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* @export
|
|
@@ -14,8 +14,8 @@ export interface OrderUpdatedResponse {
|
|
|
14
14
|
'brokerage_order_id': string;
|
|
15
15
|
/**
|
|
16
16
|
*
|
|
17
|
-
* @type {
|
|
17
|
+
* @type {OrderUpdatedResponseOrder}
|
|
18
18
|
* @memberof OrderUpdatedResponse
|
|
19
19
|
*/
|
|
20
|
-
'order'?:
|
|
20
|
+
'order'?: OrderUpdatedResponseOrder | null;
|
|
21
21
|
}
|
|
@@ -15,7 +15,7 @@ export interface Position {
|
|
|
15
15
|
*/
|
|
16
16
|
'symbol'?: PositionSymbol;
|
|
17
17
|
/**
|
|
18
|
-
* The number of shares of the position. This can be fractional or integer units.
|
|
18
|
+
* The number of shares of the position. This can be fractional or integer units. A positive number indicates a long position, while a negative number indicates a short position.
|
|
19
19
|
* @type {number}
|
|
20
20
|
* @memberof Position
|
|
21
21
|
*/
|