snaptrade 2.0.169 → 2.0.170
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +25 -23
- data/lib/snaptrade/api/options_api.rb +20 -16
- data/lib/snaptrade/api/trading_api.rb +28 -28
- data/lib/snaptrade/models/cash_change_direction.rb +39 -0
- data/lib/snaptrade/models/crypto_order_form.rb +4 -4
- data/lib/snaptrade/models/mleg_trade_form.rb +2 -2
- data/lib/snaptrade/models/option_impact.rb +27 -16
- data/lib/snaptrade/models/simple_order_form.rb +4 -4
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +1 -0
- data/spec/api/options_api_spec.rb +2 -1
- data/spec/api/trading_api_spec.rb +1 -1
- data/spec/models/cash_change_direction_spec.rb +23 -0
- data/spec/models/option_impact_spec.rb +8 -2
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cba7ac2910a591d8ceb393ac6c1450830c2d7cde69dc82fa0907330084fe4cd8
|
|
4
|
+
data.tar.gz: af955f64bc6f941a5fdf8ccad68d28d59a8ddbb0d82b68019ad4d1ecab7261ee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 62a57f7eb1345276c02a04b41d15295e5a7b567782fbb432ae300f62ce03e6e710ba9f804c962a51cc41744d8e9edbfad7c2bd87b326f152cac02e5126fd562d
|
|
7
|
+
data.tar.gz: c510aabcaa1e03e3c732a2cbceddf828b068270325c053ce288c74b0d44f79c87bfb689f001b89212f9f148f75cf21abcf7782d23f2c4cb3d98589159a72e9e7
|
data/Gemfile.lock
CHANGED
data/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://rubygems.org/gems/snaptrade/versions/2.0.170)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -87,7 +87,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
87
87
|
Add to Gemfile:
|
|
88
88
|
|
|
89
89
|
```ruby
|
|
90
|
-
gem 'snaptrade', '~> 2.0.
|
|
90
|
+
gem 'snaptrade', '~> 2.0.170'
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
## Getting Started<a id="getting-started"></a>
|
|
@@ -1336,9 +1336,7 @@ false to retrieve non executed orders as well
|
|
|
1336
1336
|
|
|
1337
1337
|
### `snaptrade.options.get_option_quote`<a id="snaptradeoptionsget_option_quote"></a>
|
|
1338
1338
|
|
|
1339
|
-
Returns a real-time quote for a single option contract. The option contract is specified using
|
|
1340
|
-
|
|
1341
|
-
OCC format: `AAPL 251219C00150000` (underlying padded to 6 characters with spaces, followed by date, put/call, and strike).
|
|
1339
|
+
Returns a real-time quote for a single option contract. The option contract is specified using in the 21 character OCC format. For example `AAPL 251114C00240000` represents a call option on AAPL expiring on 2025-11-14 with a strike price of $240. For more information on the OCC format, see [here](https://en.wikipedia.org/wiki/Option_symbol#OCC_format)
|
|
1342
1340
|
|
|
1343
1341
|
|
|
1344
1342
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
@@ -1347,6 +1345,7 @@ OCC format: `AAPL 251219C00150000` (underlying padded to 6 characters with spac
|
|
|
1347
1345
|
result = snaptrade.options.get_option_quote(
|
|
1348
1346
|
user_id: "snaptrade-user-123",
|
|
1349
1347
|
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1348
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1350
1349
|
symbol: "AAPL 251219C00150000",
|
|
1351
1350
|
)
|
|
1352
1351
|
p result
|
|
@@ -1356,6 +1355,7 @@ p result
|
|
|
1356
1355
|
|
|
1357
1356
|
##### user_id: `String`<a id="user_id-string"></a>
|
|
1358
1357
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
1358
|
+
##### account_id: `String`<a id="account_id-string"></a>
|
|
1359
1359
|
##### symbol: `String`<a id="symbol-string"></a>
|
|
1360
1360
|
The OCC-formatted option symbol.
|
|
1361
1361
|
|
|
@@ -1365,7 +1365,7 @@ The OCC-formatted option symbol.
|
|
|
1365
1365
|
|
|
1366
1366
|
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1367
1367
|
|
|
1368
|
-
`/
|
|
1368
|
+
`/accounts/{accountId}/quotes/options` `GET`
|
|
1369
1369
|
|
|
1370
1370
|
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1371
1371
|
|
|
@@ -1871,7 +1871,7 @@ p result
|
|
|
1871
1871
|
### `snaptrade.trading.get_option_impact`<a id="snaptradetradingget_option_impact"></a>
|
|
1872
1872
|
|
|
1873
1873
|
Simulates an option order with up to 4 legs and returns the estimated cost and transaction fees without placing it.
|
|
1874
|
-
Only supported for certain brokerages. Please refer to https://
|
|
1874
|
+
Only supported for certain brokerages. Please refer to the [brokerage trading support page](https://snaptrade.notion.site/brokerages) for more information on which brokerages support this endpoint.
|
|
1875
1875
|
|
|
1876
1876
|
|
|
1877
1877
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
@@ -1920,10 +1920,11 @@ immediately will be canceled.
|
|
|
1920
1920
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
1921
1921
|
##### account_id: `String`<a id="account_id-string"></a>
|
|
1922
1922
|
##### limit_price: `Float`<a id="limit_price-float"></a>
|
|
1923
|
-
The limit price. Required if the order type is LIMIT
|
|
1923
|
+
The limit price. Required if the order type is `LIMIT`, `STOP_LOSS_LIMIT`.
|
|
1924
1924
|
|
|
1925
1925
|
##### stop_price: `Float`<a id="stop_price-float"></a>
|
|
1926
|
-
The stop price. Required if the order type is STOP_LOSS_MARKET
|
|
1926
|
+
The stop price. Required if the order type is `STOP_LOSS_MARKET`,
|
|
1927
|
+
`STOP_LOSS_LIMIT`.
|
|
1927
1928
|
|
|
1928
1929
|
##### price_effect: [`MlegPriceEffectStrict`](./lib/snaptrade/models/mleg_price_effect_strict.rb)<a id="price_effect-mlegpriceeffectstrictlibsnaptrademodelsmleg_price_effect_strictrb"></a>
|
|
1929
1930
|
#### 🔄 Return<a id="🔄-return"></a>
|
|
@@ -2208,19 +2209,19 @@ The amount of the base currency to buy or sell.
|
|
|
2208
2209
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
2209
2210
|
##### account_id: `String`<a id="account_id-string"></a>
|
|
2210
2211
|
##### limit_price: `Float`<a id="limit_price-float"></a>
|
|
2211
|
-
The limit price. Required if the order type is LIMIT
|
|
2212
|
-
TAKE_PROFIT_LIMIT
|
|
2212
|
+
The limit price. Required if the order type is `LIMIT`, `STOP_LOSS_LIMIT` or
|
|
2213
|
+
`TAKE_PROFIT_LIMIT`.
|
|
2213
2214
|
|
|
2214
2215
|
##### stop_price: `Float`<a id="stop_price-float"></a>
|
|
2215
|
-
The stop price. Required if the order type is STOP_LOSS_MARKET
|
|
2216
|
-
TAKE_PROFIT_MARKET or TAKE_PROFIT_LIMIT
|
|
2216
|
+
The stop price. Required if the order type is `STOP_LOSS_MARKET`,
|
|
2217
|
+
`STOP_LOSS_LIMIT`, `TAKE_PROFIT_MARKET` or `TAKE_PROFIT_LIMIT`.
|
|
2217
2218
|
|
|
2218
2219
|
##### post_only: `Boolean`<a id="post_only-boolean"></a>
|
|
2219
|
-
Valid and required only for order type LIMIT
|
|
2220
|
+
Valid and required only for order type `LIMIT`. If true orders that would be
|
|
2220
2221
|
filled immediately are rejected to avoid incurring TAKER fees.
|
|
2221
2222
|
|
|
2222
2223
|
##### expiration_date: `Time`<a id="expiration_date-time"></a>
|
|
2223
|
-
The expiration date of the order. Required if the time_in_force is GTD
|
|
2224
|
+
The expiration date of the order. Required if the time_in_force is `GTD`.
|
|
2224
2225
|
|
|
2225
2226
|
#### 🔄 Return<a id="🔄-return"></a>
|
|
2226
2227
|
|
|
@@ -2384,10 +2385,11 @@ immediately will be canceled.
|
|
|
2384
2385
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
2385
2386
|
##### account_id: `String`<a id="account_id-string"></a>
|
|
2386
2387
|
##### limit_price: `Float`<a id="limit_price-float"></a>
|
|
2387
|
-
The limit price. Required if the order type is LIMIT
|
|
2388
|
+
The limit price. Required if the order type is `LIMIT`, `STOP_LOSS_LIMIT`.
|
|
2388
2389
|
|
|
2389
2390
|
##### stop_price: `Float`<a id="stop_price-float"></a>
|
|
2390
|
-
The stop price. Required if the order type is STOP_LOSS_MARKET
|
|
2391
|
+
The stop price. Required if the order type is `STOP_LOSS_MARKET`,
|
|
2392
|
+
`STOP_LOSS_LIMIT`.
|
|
2391
2393
|
|
|
2392
2394
|
##### price_effect: [`MlegPriceEffectStrict`](./lib/snaptrade/models/mleg_price_effect_strict.rb)<a id="price_effect-mlegpriceeffectstrictlibsnaptrademodelsmleg_price_effect_strictrb"></a>
|
|
2393
2395
|
#### 🔄 Return<a id="🔄-return"></a>
|
|
@@ -2503,19 +2505,19 @@ The amount of the base currency to buy or sell.
|
|
|
2503
2505
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
2504
2506
|
##### account_id: `String`<a id="account_id-string"></a>
|
|
2505
2507
|
##### limit_price: `Float`<a id="limit_price-float"></a>
|
|
2506
|
-
The limit price. Required if the order type is LIMIT
|
|
2507
|
-
TAKE_PROFIT_LIMIT
|
|
2508
|
+
The limit price. Required if the order type is `LIMIT`, `STOP_LOSS_LIMIT` or
|
|
2509
|
+
`TAKE_PROFIT_LIMIT`.
|
|
2508
2510
|
|
|
2509
2511
|
##### stop_price: `Float`<a id="stop_price-float"></a>
|
|
2510
|
-
The stop price. Required if the order type is STOP_LOSS_MARKET
|
|
2511
|
-
TAKE_PROFIT_MARKET or TAKE_PROFIT_LIMIT
|
|
2512
|
+
The stop price. Required if the order type is `STOP_LOSS_MARKET`,
|
|
2513
|
+
`STOP_LOSS_LIMIT`, `TAKE_PROFIT_MARKET` or `TAKE_PROFIT_LIMIT`.
|
|
2512
2514
|
|
|
2513
2515
|
##### post_only: `Boolean`<a id="post_only-boolean"></a>
|
|
2514
|
-
Valid and required only for order type LIMIT
|
|
2516
|
+
Valid and required only for order type `LIMIT`. If true orders that would be
|
|
2515
2517
|
filled immediately are rejected to avoid incurring TAKER fees.
|
|
2516
2518
|
|
|
2517
2519
|
##### expiration_date: `Time`<a id="expiration_date-time"></a>
|
|
2518
|
-
The expiration date of the order. Required if the time_in_force is GTD
|
|
2520
|
+
The expiration date of the order. Required if the time_in_force is `GTD`.
|
|
2519
2521
|
|
|
2520
2522
|
#### 🔄 Return<a id="🔄-return"></a>
|
|
2521
2523
|
|
|
@@ -19,53 +19,53 @@ module SnapTrade
|
|
|
19
19
|
|
|
20
20
|
# Get option quote
|
|
21
21
|
#
|
|
22
|
-
# Returns a real-time quote for a single option contract. The option contract is specified using
|
|
23
|
-
#
|
|
24
|
-
# OCC format: `AAPL 251219C00150000` (underlying padded to 6 characters with spaces, followed by date, put/call, and strike).
|
|
22
|
+
# Returns a real-time quote for a single option contract. The option contract is specified using in the 21 character OCC format. For example `AAPL 251114C00240000` represents a call option on AAPL expiring on 2025-11-14 with a strike price of $240. For more information on the OCC format, see [here](https://en.wikipedia.org/wiki/Option_symbol#OCC_format)
|
|
25
23
|
#
|
|
26
24
|
# @param user_id [String]
|
|
27
25
|
# @param user_secret [String]
|
|
26
|
+
# @param account_id [String]
|
|
28
27
|
# @param symbol [String] The OCC-formatted option symbol.
|
|
29
28
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
30
|
-
def get_option_quote(user_id:, user_secret:, symbol:, extra: {})
|
|
31
|
-
data, _status_code, _headers = get_option_quote_with_http_info_impl(user_id, user_secret, symbol, extra)
|
|
29
|
+
def get_option_quote(user_id:, user_secret:, account_id:, symbol:, extra: {})
|
|
30
|
+
data, _status_code, _headers = get_option_quote_with_http_info_impl(user_id, user_secret, account_id, symbol, extra)
|
|
32
31
|
data
|
|
33
32
|
end
|
|
34
33
|
|
|
35
34
|
# Get option quote
|
|
36
35
|
#
|
|
37
|
-
# Returns a real-time quote for a single option contract. The option contract is specified using
|
|
38
|
-
#
|
|
39
|
-
# OCC format: `AAPL 251219C00150000` (underlying padded to 6 characters with spaces, followed by date, put/call, and strike).
|
|
36
|
+
# Returns a real-time quote for a single option contract. The option contract is specified using in the 21 character OCC format. For example `AAPL 251114C00240000` represents a call option on AAPL expiring on 2025-11-14 with a strike price of $240. For more information on the OCC format, see [here](https://en.wikipedia.org/wiki/Option_symbol#OCC_format)
|
|
40
37
|
#
|
|
41
38
|
# @param user_id [String]
|
|
42
39
|
# @param user_secret [String]
|
|
40
|
+
# @param account_id [String]
|
|
43
41
|
# @param symbol [String] The OCC-formatted option symbol.
|
|
44
42
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
45
|
-
def get_option_quote_with_http_info(user_id:, user_secret:, symbol:, extra: {})
|
|
46
|
-
get_option_quote_with_http_info_impl(user_id, user_secret, symbol, extra)
|
|
43
|
+
def get_option_quote_with_http_info(user_id:, user_secret:, account_id:, symbol:, extra: {})
|
|
44
|
+
get_option_quote_with_http_info_impl(user_id, user_secret, account_id, symbol, extra)
|
|
47
45
|
end
|
|
48
46
|
|
|
49
47
|
# Get option quote
|
|
50
|
-
# Returns a real-time quote for a single option contract. The option contract is specified using
|
|
48
|
+
# Returns a real-time quote for a single option contract. The option contract is specified using in the 21 character OCC format. For example `AAPL 251114C00240000` represents a call option on AAPL expiring on 2025-11-14 with a strike price of $240. For more information on the OCC format, see [here](https://en.wikipedia.org/wiki/Option_symbol#OCC_format)
|
|
51
49
|
# @param user_id [String]
|
|
52
50
|
# @param user_secret [String]
|
|
51
|
+
# @param account_id [String]
|
|
53
52
|
# @param symbol [String] The OCC-formatted option symbol.
|
|
54
53
|
# @param [Hash] opts the optional parameters
|
|
55
54
|
# @return [OptionQuote]
|
|
56
|
-
private def get_option_quote_impl(user_id, user_secret, symbol, opts = {})
|
|
57
|
-
data, _status_code, _headers = get_option_quote_with_http_info(user_id, user_secret, symbol, opts)
|
|
55
|
+
private def get_option_quote_impl(user_id, user_secret, account_id, symbol, opts = {})
|
|
56
|
+
data, _status_code, _headers = get_option_quote_with_http_info(user_id, user_secret, account_id, symbol, opts)
|
|
58
57
|
data
|
|
59
58
|
end
|
|
60
59
|
|
|
61
60
|
# Get option quote
|
|
62
|
-
# Returns a real-time quote for a single option contract. The option contract is specified using
|
|
61
|
+
# Returns a real-time quote for a single option contract. The option contract is specified using in the 21 character OCC format. For example `AAPL 251114C00240000` represents a call option on AAPL expiring on 2025-11-14 with a strike price of $240. For more information on the OCC format, see [here](https://en.wikipedia.org/wiki/Option_symbol#OCC_format)
|
|
63
62
|
# @param user_id [String]
|
|
64
63
|
# @param user_secret [String]
|
|
64
|
+
# @param account_id [String]
|
|
65
65
|
# @param symbol [String] The OCC-formatted option symbol.
|
|
66
66
|
# @param [Hash] opts the optional parameters
|
|
67
67
|
# @return [Array<(OptionQuote, Integer, Hash)>] OptionQuote data, response status code and response headers
|
|
68
|
-
private def get_option_quote_with_http_info_impl(user_id, user_secret, symbol, opts = {})
|
|
68
|
+
private def get_option_quote_with_http_info_impl(user_id, user_secret, account_id, symbol, opts = {})
|
|
69
69
|
if @api_client.config.debugging
|
|
70
70
|
@api_client.config.logger.debug 'Calling API: OptionsApi.get_option_quote ...'
|
|
71
71
|
end
|
|
@@ -77,12 +77,16 @@ module SnapTrade
|
|
|
77
77
|
if @api_client.config.client_side_validation && user_secret.nil?
|
|
78
78
|
fail ArgumentError, "Missing the required parameter 'user_secret' when calling OptionsApi.get_option_quote"
|
|
79
79
|
end
|
|
80
|
+
# verify the required parameter 'account_id' is set
|
|
81
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
82
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling OptionsApi.get_option_quote"
|
|
83
|
+
end
|
|
80
84
|
# verify the required parameter 'symbol' is set
|
|
81
85
|
if @api_client.config.client_side_validation && symbol.nil?
|
|
82
86
|
fail ArgumentError, "Missing the required parameter 'symbol' when calling OptionsApi.get_option_quote"
|
|
83
87
|
end
|
|
84
88
|
# resource path
|
|
85
|
-
local_var_path = '/
|
|
89
|
+
local_var_path = '/accounts/{accountId}/quotes/options'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
|
|
86
90
|
|
|
87
91
|
# query parameters
|
|
88
92
|
query_params = opts[:query_params] || {}
|
|
@@ -381,7 +381,7 @@ module SnapTrade
|
|
|
381
381
|
# Get option order impact
|
|
382
382
|
#
|
|
383
383
|
# Simulates an option order with up to 4 legs and returns the estimated cost and transaction fees without placing it.
|
|
384
|
-
# Only supported for certain brokerages. Please refer to https://
|
|
384
|
+
# Only supported for certain brokerages. Please refer to the [brokerage trading support page](https://snaptrade.notion.site/brokerages) for more information on which brokerages support this endpoint.
|
|
385
385
|
#
|
|
386
386
|
# @param order_type [MlegOrderTypeStrict] The type of order to place.
|
|
387
387
|
# @param time_in_force [TimeInForceStrict] The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `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.
|
|
@@ -389,8 +389,8 @@ module SnapTrade
|
|
|
389
389
|
# @param user_id [String]
|
|
390
390
|
# @param user_secret [String]
|
|
391
391
|
# @param account_id [String]
|
|
392
|
-
# @param limit_price [Float] The limit price. Required if the order type is LIMIT
|
|
393
|
-
# @param stop_price [Float] The stop price. Required if the order type is STOP_LOSS_MARKET
|
|
392
|
+
# @param limit_price [Float] The limit price. Required if the order type is `LIMIT`, `STOP_LOSS_LIMIT`.
|
|
393
|
+
# @param stop_price [Float] The stop price. Required if the order type is `STOP_LOSS_MARKET`, `STOP_LOSS_LIMIT`.
|
|
394
394
|
# @param price_effect [MlegPriceEffectStrict]
|
|
395
395
|
# @param body [MlegTradeForm]
|
|
396
396
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
@@ -410,7 +410,7 @@ module SnapTrade
|
|
|
410
410
|
# Get option order impact
|
|
411
411
|
#
|
|
412
412
|
# Simulates an option order with up to 4 legs and returns the estimated cost and transaction fees without placing it.
|
|
413
|
-
# Only supported for certain brokerages. Please refer to https://
|
|
413
|
+
# Only supported for certain brokerages. Please refer to the [brokerage trading support page](https://snaptrade.notion.site/brokerages) for more information on which brokerages support this endpoint.
|
|
414
414
|
#
|
|
415
415
|
# @param order_type [MlegOrderTypeStrict] The type of order to place.
|
|
416
416
|
# @param time_in_force [TimeInForceStrict] The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `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.
|
|
@@ -418,8 +418,8 @@ module SnapTrade
|
|
|
418
418
|
# @param user_id [String]
|
|
419
419
|
# @param user_secret [String]
|
|
420
420
|
# @param account_id [String]
|
|
421
|
-
# @param limit_price [Float] The limit price. Required if the order type is LIMIT
|
|
422
|
-
# @param stop_price [Float] The stop price. Required if the order type is STOP_LOSS_MARKET
|
|
421
|
+
# @param limit_price [Float] The limit price. Required if the order type is `LIMIT`, `STOP_LOSS_LIMIT`.
|
|
422
|
+
# @param stop_price [Float] The stop price. Required if the order type is `STOP_LOSS_MARKET`, `STOP_LOSS_LIMIT`.
|
|
423
423
|
# @param price_effect [MlegPriceEffectStrict]
|
|
424
424
|
# @param body [MlegTradeForm]
|
|
425
425
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
@@ -436,7 +436,7 @@ module SnapTrade
|
|
|
436
436
|
end
|
|
437
437
|
|
|
438
438
|
# Get option order impact
|
|
439
|
-
# Simulates an option order with up to 4 legs and returns the estimated cost and transaction fees without placing it. Only supported for certain brokerages. Please refer to https://
|
|
439
|
+
# Simulates an option order with up to 4 legs and returns the estimated cost and transaction fees without placing it. Only supported for certain brokerages. Please refer to the [brokerage trading support page](https://snaptrade.notion.site/brokerages) for more information on which brokerages support this endpoint.
|
|
440
440
|
# @param user_id [String]
|
|
441
441
|
# @param user_secret [String]
|
|
442
442
|
# @param account_id [String]
|
|
@@ -449,7 +449,7 @@ module SnapTrade
|
|
|
449
449
|
end
|
|
450
450
|
|
|
451
451
|
# Get option order impact
|
|
452
|
-
# Simulates an option order with up to 4 legs and returns the estimated cost and transaction fees without placing it. Only supported for certain brokerages. Please refer to https://
|
|
452
|
+
# Simulates an option order with up to 4 legs and returns the estimated cost and transaction fees without placing it. Only supported for certain brokerages. Please refer to the [brokerage trading support page](https://snaptrade.notion.site/brokerages) for more information on which brokerages support this endpoint.
|
|
453
453
|
# @param user_id [String]
|
|
454
454
|
# @param user_secret [String]
|
|
455
455
|
# @param account_id [String]
|
|
@@ -978,10 +978,10 @@ module SnapTrade
|
|
|
978
978
|
# @param user_id [String]
|
|
979
979
|
# @param user_secret [String]
|
|
980
980
|
# @param account_id [String]
|
|
981
|
-
# @param limit_price [Float] The limit price. Required if the order type is LIMIT
|
|
982
|
-
# @param stop_price [Float] The stop price. Required if the order type is STOP_LOSS_MARKET
|
|
983
|
-
# @param post_only [Boolean] Valid and required only for order type LIMIT
|
|
984
|
-
# @param expiration_date [Time] The expiration date of the order. Required if the time_in_force is GTD
|
|
981
|
+
# @param limit_price [Float] The limit price. Required if the order type is `LIMIT`, `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT`.
|
|
982
|
+
# @param stop_price [Float] The stop price. Required if the order type is `STOP_LOSS_MARKET`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT_MARKET` or `TAKE_PROFIT_LIMIT`.
|
|
983
|
+
# @param post_only [Boolean] Valid and required only for order type `LIMIT`. If true orders that would be filled immediately are rejected to avoid incurring TAKER fees.
|
|
984
|
+
# @param expiration_date [Time] The expiration date of the order. Required if the time_in_force is `GTD`.
|
|
985
985
|
# @param body [CryptoOrderForm]
|
|
986
986
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
987
987
|
def place_crypto_order(instrument:, side:, type:, time_in_force:, amount:, user_id:, user_secret:, account_id:, limit_price: SENTINEL, stop_price: SENTINEL, post_only: SENTINEL, expiration_date: SENTINEL, extra: {})
|
|
@@ -1013,10 +1013,10 @@ module SnapTrade
|
|
|
1013
1013
|
# @param user_id [String]
|
|
1014
1014
|
# @param user_secret [String]
|
|
1015
1015
|
# @param account_id [String]
|
|
1016
|
-
# @param limit_price [Float] The limit price. Required if the order type is LIMIT
|
|
1017
|
-
# @param stop_price [Float] The stop price. Required if the order type is STOP_LOSS_MARKET
|
|
1018
|
-
# @param post_only [Boolean] Valid and required only for order type LIMIT
|
|
1019
|
-
# @param expiration_date [Time] The expiration date of the order. Required if the time_in_force is GTD
|
|
1016
|
+
# @param limit_price [Float] The limit price. Required if the order type is `LIMIT`, `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT`.
|
|
1017
|
+
# @param stop_price [Float] The stop price. Required if the order type is `STOP_LOSS_MARKET`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT_MARKET` or `TAKE_PROFIT_LIMIT`.
|
|
1018
|
+
# @param post_only [Boolean] Valid and required only for order type `LIMIT`. If true orders that would be filled immediately are rejected to avoid incurring TAKER fees.
|
|
1019
|
+
# @param expiration_date [Time] The expiration date of the order. Required if the time_in_force is `GTD`.
|
|
1020
1020
|
# @param body [CryptoOrderForm]
|
|
1021
1021
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
1022
1022
|
def place_crypto_order_with_http_info(instrument:, side:, type:, time_in_force:, amount:, user_id:, user_secret:, account_id:, limit_price: SENTINEL, stop_price: SENTINEL, post_only: SENTINEL, expiration_date: SENTINEL, extra: {})
|
|
@@ -1297,8 +1297,8 @@ module SnapTrade
|
|
|
1297
1297
|
# @param user_id [String]
|
|
1298
1298
|
# @param user_secret [String]
|
|
1299
1299
|
# @param account_id [String]
|
|
1300
|
-
# @param limit_price [Float] The limit price. Required if the order type is LIMIT
|
|
1301
|
-
# @param stop_price [Float] The stop price. Required if the order type is STOP_LOSS_MARKET
|
|
1300
|
+
# @param limit_price [Float] The limit price. Required if the order type is `LIMIT`, `STOP_LOSS_LIMIT`.
|
|
1301
|
+
# @param stop_price [Float] The stop price. Required if the order type is `STOP_LOSS_MARKET`, `STOP_LOSS_LIMIT`.
|
|
1302
1302
|
# @param price_effect [MlegPriceEffectStrict]
|
|
1303
1303
|
# @param body [MlegTradeForm]
|
|
1304
1304
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
@@ -1325,8 +1325,8 @@ module SnapTrade
|
|
|
1325
1325
|
# @param user_id [String]
|
|
1326
1326
|
# @param user_secret [String]
|
|
1327
1327
|
# @param account_id [String]
|
|
1328
|
-
# @param limit_price [Float] The limit price. Required if the order type is LIMIT
|
|
1329
|
-
# @param stop_price [Float] The stop price. Required if the order type is STOP_LOSS_MARKET
|
|
1328
|
+
# @param limit_price [Float] The limit price. Required if the order type is `LIMIT`, `STOP_LOSS_LIMIT`.
|
|
1329
|
+
# @param stop_price [Float] The stop price. Required if the order type is `STOP_LOSS_MARKET`, `STOP_LOSS_LIMIT`.
|
|
1330
1330
|
# @param price_effect [MlegPriceEffectStrict]
|
|
1331
1331
|
# @param body [MlegTradeForm]
|
|
1332
1332
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
@@ -1567,10 +1567,10 @@ module SnapTrade
|
|
|
1567
1567
|
# @param user_id [String]
|
|
1568
1568
|
# @param user_secret [String]
|
|
1569
1569
|
# @param account_id [String]
|
|
1570
|
-
# @param limit_price [Float] The limit price. Required if the order type is LIMIT
|
|
1571
|
-
# @param stop_price [Float] The stop price. Required if the order type is STOP_LOSS_MARKET
|
|
1572
|
-
# @param post_only [Boolean] Valid and required only for order type LIMIT
|
|
1573
|
-
# @param expiration_date [Time] The expiration date of the order. Required if the time_in_force is GTD
|
|
1570
|
+
# @param limit_price [Float] The limit price. Required if the order type is `LIMIT`, `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT`.
|
|
1571
|
+
# @param stop_price [Float] The stop price. Required if the order type is `STOP_LOSS_MARKET`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT_MARKET` or `TAKE_PROFIT_LIMIT`.
|
|
1572
|
+
# @param post_only [Boolean] Valid and required only for order type `LIMIT`. If true orders that would be filled immediately are rejected to avoid incurring TAKER fees.
|
|
1573
|
+
# @param expiration_date [Time] The expiration date of the order. Required if the time_in_force is `GTD`.
|
|
1574
1574
|
# @param body [CryptoOrderForm]
|
|
1575
1575
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
1576
1576
|
def preview_crypto_order(instrument:, side:, type:, time_in_force:, amount:, user_id:, user_secret:, account_id:, limit_price: SENTINEL, stop_price: SENTINEL, post_only: SENTINEL, expiration_date: SENTINEL, extra: {})
|
|
@@ -1601,10 +1601,10 @@ module SnapTrade
|
|
|
1601
1601
|
# @param user_id [String]
|
|
1602
1602
|
# @param user_secret [String]
|
|
1603
1603
|
# @param account_id [String]
|
|
1604
|
-
# @param limit_price [Float] The limit price. Required if the order type is LIMIT
|
|
1605
|
-
# @param stop_price [Float] The stop price. Required if the order type is STOP_LOSS_MARKET
|
|
1606
|
-
# @param post_only [Boolean] Valid and required only for order type LIMIT
|
|
1607
|
-
# @param expiration_date [Time] The expiration date of the order. Required if the time_in_force is GTD
|
|
1604
|
+
# @param limit_price [Float] The limit price. Required if the order type is `LIMIT`, `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT`.
|
|
1605
|
+
# @param stop_price [Float] The stop price. Required if the order type is `STOP_LOSS_MARKET`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT_MARKET` or `TAKE_PROFIT_LIMIT`.
|
|
1606
|
+
# @param post_only [Boolean] Valid and required only for order type `LIMIT`. If true orders that would be filled immediately are rejected to avoid incurring TAKER fees.
|
|
1607
|
+
# @param expiration_date [Time] The expiration date of the order. Required if the time_in_force is `GTD`.
|
|
1608
1608
|
# @param body [CryptoOrderForm]
|
|
1609
1609
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
1610
1610
|
def preview_crypto_order_with_http_info(instrument:, side:, type:, time_in_force:, amount:, user_id:, user_secret:, account_id:, limit_price: SENTINEL, stop_price: SENTINEL, post_only: SENTINEL, expiration_date: SENTINEL, extra: {})
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#SnapTrade
|
|
3
|
+
|
|
4
|
+
#Connect brokerage accounts to your app for live positions and trading
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: api@snaptrade.com
|
|
8
|
+
=end
|
|
9
|
+
|
|
10
|
+
require 'date'
|
|
11
|
+
require 'time'
|
|
12
|
+
|
|
13
|
+
module SnapTrade
|
|
14
|
+
class CashChangeDirection
|
|
15
|
+
CREDIT = "CREDIT".freeze
|
|
16
|
+
DEBIT = "DEBIT".freeze
|
|
17
|
+
EVEN = "EVEN".freeze
|
|
18
|
+
UNKNOWN = "UNKNOWN".freeze
|
|
19
|
+
|
|
20
|
+
def self.all_vars
|
|
21
|
+
@all_vars ||= [CREDIT, DEBIT, EVEN, UNKNOWN].freeze
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Builds the enum from string
|
|
25
|
+
# @param [String] The enum value in the form of the string
|
|
26
|
+
# @return [String] The enum value
|
|
27
|
+
def self.build_from_hash(value)
|
|
28
|
+
new.build_from_hash(value)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Builds the enum from string
|
|
32
|
+
# @param [String] The enum value in the form of the string
|
|
33
|
+
# @return [String] The enum value
|
|
34
|
+
def build_from_hash(value)
|
|
35
|
+
return value if CashChangeDirection.all_vars.include?(value)
|
|
36
|
+
raise "Invalid ENUM value #{value} for class #CashChangeDirection"
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -26,16 +26,16 @@ module SnapTrade
|
|
|
26
26
|
# The amount of the base currency to buy or sell.
|
|
27
27
|
attr_accessor :amount
|
|
28
28
|
|
|
29
|
-
# The limit price. Required if the order type is LIMIT
|
|
29
|
+
# The limit price. Required if the order type is `LIMIT`, `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT`.
|
|
30
30
|
attr_accessor :limit_price
|
|
31
31
|
|
|
32
|
-
# The stop price. Required if the order type is STOP_LOSS_MARKET
|
|
32
|
+
# The stop price. Required if the order type is `STOP_LOSS_MARKET`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT_MARKET` or `TAKE_PROFIT_LIMIT`.
|
|
33
33
|
attr_accessor :stop_price
|
|
34
34
|
|
|
35
|
-
# Valid and required only for order type LIMIT
|
|
35
|
+
# Valid and required only for order type `LIMIT`. If true orders that would be filled immediately are rejected to avoid incurring TAKER fees.
|
|
36
36
|
attr_accessor :post_only
|
|
37
37
|
|
|
38
|
-
# The expiration date of the order. Required if the time_in_force is GTD
|
|
38
|
+
# The expiration date of the order. Required if the time_in_force is `GTD`.
|
|
39
39
|
attr_accessor :expiration_date
|
|
40
40
|
|
|
41
41
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -19,10 +19,10 @@ module SnapTrade
|
|
|
19
19
|
# The Time in Force type for the order. This field indicates how long the order will remain active before it is executed or expires. Here are the supported values: - `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.
|
|
20
20
|
attr_accessor :time_in_force
|
|
21
21
|
|
|
22
|
-
# The limit price. Required if the order type is LIMIT
|
|
22
|
+
# The limit price. Required if the order type is `LIMIT`, `STOP_LOSS_LIMIT`.
|
|
23
23
|
attr_accessor :limit_price
|
|
24
24
|
|
|
25
|
-
# The stop price. Required if the order type is STOP_LOSS_MARKET
|
|
25
|
+
# The stop price. Required if the order type is `STOP_LOSS_MARKET`, `STOP_LOSS_LIMIT`.
|
|
26
26
|
attr_accessor :stop_price
|
|
27
27
|
|
|
28
28
|
attr_accessor :price_effect
|
|
@@ -11,19 +11,23 @@ require 'date'
|
|
|
11
11
|
require 'time'
|
|
12
12
|
|
|
13
13
|
module SnapTrade
|
|
14
|
-
# Estimated
|
|
14
|
+
# Estimated cash change and fees for an option order before it is placed.
|
|
15
15
|
class OptionImpact
|
|
16
|
-
# Estimated
|
|
17
|
-
attr_accessor :
|
|
16
|
+
# Estimated cash change for the order, before fees.
|
|
17
|
+
attr_accessor :estimated_cash_change
|
|
18
18
|
|
|
19
|
-
#
|
|
20
|
-
attr_accessor :
|
|
19
|
+
# Direction of the cash change. CREDIT means cash is received, DEBIT means cash is paid out, EVEN means no cash changes hands. UNKNOWN if the direction cannot be determined from the request.
|
|
20
|
+
attr_accessor :cash_change_direction
|
|
21
|
+
|
|
22
|
+
# Estimated total transaction fees and commissions for the order.
|
|
23
|
+
attr_accessor :estimated_fee_total
|
|
21
24
|
|
|
22
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
26
|
def self.attribute_map
|
|
24
27
|
{
|
|
25
|
-
:'
|
|
26
|
-
:'
|
|
28
|
+
:'estimated_cash_change' => :'estimated_cash_change',
|
|
29
|
+
:'cash_change_direction' => :'cash_change_direction',
|
|
30
|
+
:'estimated_fee_total' => :'estimated_fee_total'
|
|
27
31
|
}
|
|
28
32
|
end
|
|
29
33
|
|
|
@@ -35,14 +39,16 @@ module SnapTrade
|
|
|
35
39
|
# Attribute type mapping.
|
|
36
40
|
def self.openapi_types
|
|
37
41
|
{
|
|
38
|
-
:'
|
|
39
|
-
:'
|
|
42
|
+
:'estimated_cash_change' => :'String',
|
|
43
|
+
:'cash_change_direction' => :'CashChangeDirection',
|
|
44
|
+
:'estimated_fee_total' => :'String'
|
|
40
45
|
}
|
|
41
46
|
end
|
|
42
47
|
|
|
43
48
|
# List of attributes with nullable: true
|
|
44
49
|
def self.openapi_nullable
|
|
45
50
|
Set.new([
|
|
51
|
+
:'cash_change_direction',
|
|
46
52
|
])
|
|
47
53
|
end
|
|
48
54
|
|
|
@@ -61,12 +67,16 @@ module SnapTrade
|
|
|
61
67
|
h[k.to_sym] = v
|
|
62
68
|
}
|
|
63
69
|
|
|
64
|
-
if attributes.key?(:'
|
|
65
|
-
self.
|
|
70
|
+
if attributes.key?(:'estimated_cash_change')
|
|
71
|
+
self.estimated_cash_change = attributes[:'estimated_cash_change']
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
if attributes.key?(:'cash_change_direction')
|
|
75
|
+
self.cash_change_direction = attributes[:'cash_change_direction']
|
|
66
76
|
end
|
|
67
77
|
|
|
68
|
-
if attributes.key?(:'
|
|
69
|
-
self.
|
|
78
|
+
if attributes.key?(:'estimated_fee_total')
|
|
79
|
+
self.estimated_fee_total = attributes[:'estimated_fee_total']
|
|
70
80
|
end
|
|
71
81
|
end
|
|
72
82
|
|
|
@@ -88,8 +98,9 @@ module SnapTrade
|
|
|
88
98
|
def ==(o)
|
|
89
99
|
return true if self.equal?(o)
|
|
90
100
|
self.class == o.class &&
|
|
91
|
-
|
|
92
|
-
|
|
101
|
+
estimated_cash_change == o.estimated_cash_change &&
|
|
102
|
+
cash_change_direction == o.cash_change_direction &&
|
|
103
|
+
estimated_fee_total == o.estimated_fee_total
|
|
93
104
|
end
|
|
94
105
|
|
|
95
106
|
# @see the `==` method
|
|
@@ -101,7 +112,7 @@ module SnapTrade
|
|
|
101
112
|
# Calculates hash code according to all attributes.
|
|
102
113
|
# @return [Integer] Hash code
|
|
103
114
|
def hash
|
|
104
|
-
[
|
|
115
|
+
[estimated_cash_change, cash_change_direction, estimated_fee_total].hash
|
|
105
116
|
end
|
|
106
117
|
|
|
107
118
|
# Builds the object from hash
|
|
@@ -26,16 +26,16 @@ module SnapTrade
|
|
|
26
26
|
# The amount of the base currency to buy or sell.
|
|
27
27
|
attr_accessor :amount
|
|
28
28
|
|
|
29
|
-
# The limit price. Required if the order type is LIMIT
|
|
29
|
+
# The limit price. Required if the order type is `LIMIT`, `STOP_LOSS_LIMIT` or `TAKE_PROFIT_LIMIT`.
|
|
30
30
|
attr_accessor :limit_price
|
|
31
31
|
|
|
32
|
-
# The stop price. Required if the order type is STOP_LOSS_MARKET
|
|
32
|
+
# The stop price. Required if the order type is `STOP_LOSS_MARKET`, `STOP_LOSS_LIMIT`, `TAKE_PROFIT_MARKET` or `TAKE_PROFIT_LIMIT`.
|
|
33
33
|
attr_accessor :stop_price
|
|
34
34
|
|
|
35
|
-
# Valid and required only for order type LIMIT
|
|
35
|
+
# Valid and required only for order type `LIMIT`. If true orders that would be filled immediately are rejected to avoid incurring TAKER fees.
|
|
36
36
|
attr_accessor :post_only
|
|
37
37
|
|
|
38
|
-
# The expiration date of the order. Required if the time_in_force is GTD
|
|
38
|
+
# The expiration date of the order. Required if the time_in_force is `GTD`.
|
|
39
39
|
attr_accessor :expiration_date
|
|
40
40
|
|
|
41
41
|
# Attribute mapping from ruby-style variable name to JSON key.
|
data/lib/snaptrade/version.rb
CHANGED
data/lib/snaptrade.rb
CHANGED
|
@@ -59,6 +59,7 @@ require 'snaptrade/models/brokerage_instrument'
|
|
|
59
59
|
require 'snaptrade/models/brokerage_instruments_response'
|
|
60
60
|
require 'snaptrade/models/brokerage_type'
|
|
61
61
|
require 'snaptrade/models/cancel_order_response'
|
|
62
|
+
require 'snaptrade/models/cash_change_direction'
|
|
62
63
|
require 'snaptrade/models/child_brokerage_order_ids'
|
|
63
64
|
require 'snaptrade/models/connection_portal_version'
|
|
64
65
|
require 'snaptrade/models/connection_type'
|
|
@@ -29,9 +29,10 @@ describe 'OptionsApi' do
|
|
|
29
29
|
|
|
30
30
|
# unit tests for get_option_quote
|
|
31
31
|
# Get option quote
|
|
32
|
-
# Returns a real-time quote for a single option contract. The option contract is specified using
|
|
32
|
+
# Returns a real-time quote for a single option contract. The option contract is specified using in the 21 character OCC format. For example `AAPL 251114C00240000` represents a call option on AAPL expiring on 2025-11-14 with a strike price of $240. For more information on the OCC format, see [here](https://en.wikipedia.org/wiki/Option_symbol#OCC_format)
|
|
33
33
|
# @param user_id
|
|
34
34
|
# @param user_secret
|
|
35
|
+
# @param account_id
|
|
35
36
|
# @param symbol The OCC-formatted option symbol.
|
|
36
37
|
# @param [Hash] opts the optional parameters
|
|
37
38
|
# @return [OptionQuote]
|
|
@@ -74,7 +74,7 @@ describe 'TradingApi' do
|
|
|
74
74
|
|
|
75
75
|
# unit tests for get_option_impact
|
|
76
76
|
# Get option order impact
|
|
77
|
-
# Simulates an option order with up to 4 legs and returns the estimated cost and transaction fees without placing it. Only supported for certain brokerages. Please refer to https://
|
|
77
|
+
# Simulates an option order with up to 4 legs and returns the estimated cost and transaction fees without placing it. Only supported for certain brokerages. Please refer to the [brokerage trading support page](https://snaptrade.notion.site/brokerages) for more information on which brokerages support this endpoint.
|
|
78
78
|
# @param user_id
|
|
79
79
|
# @param user_secret
|
|
80
80
|
# @param account_id
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#SnapTrade
|
|
3
|
+
|
|
4
|
+
#Connect brokerage accounts to your app for live positions and trading
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: api@snaptrade.com
|
|
8
|
+
=end
|
|
9
|
+
|
|
10
|
+
require 'spec_helper'
|
|
11
|
+
require 'json'
|
|
12
|
+
require 'date'
|
|
13
|
+
|
|
14
|
+
# Unit tests for SnapTrade::CashChangeDirection
|
|
15
|
+
describe SnapTrade::CashChangeDirection do
|
|
16
|
+
let(:instance) { SnapTrade::CashChangeDirection.new }
|
|
17
|
+
|
|
18
|
+
describe 'test an instance of CashChangeDirection' do
|
|
19
|
+
it 'should create an instance of CashChangeDirection' do
|
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::CashChangeDirection)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -20,13 +20,19 @@ describe SnapTrade::OptionImpact do
|
|
|
20
20
|
expect(instance).to be_instance_of(SnapTrade::OptionImpact)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
|
-
describe 'test attribute "
|
|
23
|
+
describe 'test attribute "estimated_cash_change"' do
|
|
24
24
|
it 'should work' do
|
|
25
25
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
describe 'test attribute "
|
|
29
|
+
describe 'test attribute "cash_change_direction"' do
|
|
30
|
+
it 'should work' do
|
|
31
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
describe 'test attribute "estimated_fee_total"' do
|
|
30
36
|
it 'should work' do
|
|
31
37
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
32
38
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: snaptrade
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.170
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- SnapTrade
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-03-
|
|
11
|
+
date: 2026-03-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -139,6 +139,7 @@ files:
|
|
|
139
139
|
- lib/snaptrade/models/brokerage_instruments_response.rb
|
|
140
140
|
- lib/snaptrade/models/brokerage_type.rb
|
|
141
141
|
- lib/snaptrade/models/cancel_order_response.rb
|
|
142
|
+
- lib/snaptrade/models/cash_change_direction.rb
|
|
142
143
|
- lib/snaptrade/models/child_brokerage_order_ids.rb
|
|
143
144
|
- lib/snaptrade/models/connection_portal_version.rb
|
|
144
145
|
- lib/snaptrade/models/connection_type.rb
|
|
@@ -320,6 +321,7 @@ files:
|
|
|
320
321
|
- spec/models/brokerage_spec.rb
|
|
321
322
|
- spec/models/brokerage_type_spec.rb
|
|
322
323
|
- spec/models/cancel_order_response_spec.rb
|
|
324
|
+
- spec/models/cash_change_direction_spec.rb
|
|
323
325
|
- spec/models/child_brokerage_order_ids_spec.rb
|
|
324
326
|
- spec/models/connection_portal_version_spec.rb
|
|
325
327
|
- spec/models/connection_type_spec.rb
|
|
@@ -556,6 +558,7 @@ test_files:
|
|
|
556
558
|
- spec/models/brokerage_authorization_refresh_confirmation_spec.rb
|
|
557
559
|
- spec/models/account_order_record_spec.rb
|
|
558
560
|
- spec/models/strategy_quotes_greek_spec.rb
|
|
561
|
+
- spec/models/cash_change_direction_spec.rb
|
|
559
562
|
- spec/models/net_contributions_spec.rb
|
|
560
563
|
- spec/models/mleg_order_response_spec.rb
|
|
561
564
|
- spec/models/manual_trade_form_notional_value_spec.rb
|