snaptrade 2.0.172 → 2.0.174

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 13aaf2e483a1087e202cf2a72db5754d347a7cf59bcb373f9f31e90a5ea7b36e
4
- data.tar.gz: 9252ce76879156f6fc12e0ebaa6e59ecf3883f41e526872be4f3f4c49ee4403c
3
+ metadata.gz: 3efae43f8628cbe19a4de381ce7dcd918ecdcb4fb5ac12b4e0b4434e8e57990d
4
+ data.tar.gz: 449e148b180601757110ef99a3ddc188ae3e198bcec73b8dc54e945f28571e6f
5
5
  SHA512:
6
- metadata.gz: 4be7c89dbc9dcbc79377e2de9cef48ed1af1220702d0421c0c11ca846fa8edf1dfad5675d669670fc40f6e1e783056460e45574a06926b6d812bd53adfc45203
7
- data.tar.gz: f60d32bef575a1fe4cd589aba951ce59ff9f967e808fad570acfefdede2a272672b7b8b7a2e0912f760f97d2e116feae40bf11079e86e4e3e590da7c0f3f249b
6
+ metadata.gz: c18beddf828ca16284b16830d31091512834b6091fe569a38a8dfbf5c12a2d7cc3b536a99850784af4cffb1557e05a4d184d369c5f75c68774a66c5304f412f7
7
+ data.tar.gz: b4dbb4089da49fcf83384377e1175e77de0ceb2c3e55960237d20bbe71dc7cf6f656e8afa8b5dfa9d4076f777c3279e22d9ec8f82a2a3a3fd713382396c8dca7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snaptrade (2.0.172)
4
+ snaptrade (2.0.174)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-multipart (~> 1.0, >= 1.0.4)
7
7
 
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
- [![npm](https://img.shields.io/badge/gem-v2.0.172-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.172)
9
+ [![npm](https://img.shields.io/badge/gem-v2.0.174-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.174)
10
10
  [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
11
11
 
12
12
  </div>
@@ -49,7 +49,6 @@ Connect brokerage accounts to your app for live positions and trading
49
49
  * [`snaptrade.experimental_endpoints.get_user_account_order_detail_v2`](#snaptradeexperimental_endpointsget_user_account_order_detail_v2)
50
50
  * [`snaptrade.experimental_endpoints.get_user_account_orders_v2`](#snaptradeexperimental_endpointsget_user_account_orders_v2)
51
51
  * [`snaptrade.experimental_endpoints.get_user_account_recent_orders_v2`](#snaptradeexperimental_endpointsget_user_account_recent_orders_v2)
52
- * [`snaptrade.options.get_option_quote`](#snaptradeoptionsget_option_quote)
53
52
  * [`snaptrade.options.list_option_holdings`](#snaptradeoptionslist_option_holdings)
54
53
  * [`snaptrade.reference_data.get_currency_exchange_rate_pair`](#snaptradereference_dataget_currency_exchange_rate_pair)
55
54
  * [`snaptrade.reference_data.get_partner_info`](#snaptradereference_dataget_partner_info)
@@ -87,7 +86,7 @@ Connect brokerage accounts to your app for live positions and trading
87
86
  Add to Gemfile:
88
87
 
89
88
  ```ruby
90
- gem 'snaptrade', '~> 2.0.172'
89
+ gem 'snaptrade', '~> 2.0.174'
91
90
  ```
92
91
 
93
92
  ## Getting Started<a id="getting-started"></a>
@@ -1334,44 +1333,6 @@ false to retrieve non executed orders as well
1334
1333
  ---
1335
1334
 
1336
1335
 
1337
- ### `snaptrade.options.get_option_quote`<a id="snaptradeoptionsget_option_quote"></a>
1338
-
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)
1340
-
1341
-
1342
- #### 🛠️ Usage<a id="🛠️-usage"></a>
1343
-
1344
- ```ruby
1345
- result = snaptrade.options.get_option_quote(
1346
- user_id: "snaptrade-user-123",
1347
- user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
1348
- account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
1349
- symbol: "AAPL 251219C00150000",
1350
- )
1351
- p result
1352
- ```
1353
-
1354
- #### ⚙️ Parameters<a id="⚙️-parameters"></a>
1355
-
1356
- ##### user_id: `String`<a id="user_id-string"></a>
1357
- ##### user_secret: `String`<a id="user_secret-string"></a>
1358
- ##### account_id: `String`<a id="account_id-string"></a>
1359
- ##### symbol: `String`<a id="symbol-string"></a>
1360
- The OCC-formatted option symbol.
1361
-
1362
- #### 🔄 Return<a id="🔄-return"></a>
1363
-
1364
- [OptionQuote](./lib/snaptrade/models/option_quote.rb)
1365
-
1366
- #### 🌐 Endpoint<a id="🌐-endpoint"></a>
1367
-
1368
- `/accounts/{accountId}/quotes/options` `GET`
1369
-
1370
- [🔙 **Back to Table of Contents**](#table-of-contents)
1371
-
1372
- ---
1373
-
1374
-
1375
1336
  ### `snaptrade.options.list_option_holdings`<a id="snaptradeoptionslist_option_holdings"></a>
1376
1337
 
1377
1338
  Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions).
@@ -1871,7 +1832,7 @@ p result
1871
1832
  ### `snaptrade.trading.get_option_impact`<a id="snaptradetradingget_option_impact"></a>
1872
1833
 
1873
1834
  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 the [brokerage trading support page](https://snaptrade.notion.site/brokerages) for more information on which brokerages support this endpoint.
1835
+ Only supported for certain enabled brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for more information on which brokerages support this endpoint.
1875
1836
 
1876
1837
 
1877
1838
  #### 🛠️ Usage<a id="🛠️-usage"></a>
@@ -17,118 +17,6 @@ module SnapTrade
17
17
  @api_client = api_client
18
18
  end
19
19
 
20
- # Get option quote
21
- #
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)
23
- #
24
- # @param user_id [String]
25
- # @param user_secret [String]
26
- # @param account_id [String]
27
- # @param symbol [String] The OCC-formatted option symbol.
28
- # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
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)
31
- data
32
- end
33
-
34
- # Get option quote
35
- #
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)
37
- #
38
- # @param user_id [String]
39
- # @param user_secret [String]
40
- # @param account_id [String]
41
- # @param symbol [String] The OCC-formatted option symbol.
42
- # @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
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)
45
- end
46
-
47
- # Get option quote
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)
49
- # @param user_id [String]
50
- # @param user_secret [String]
51
- # @param account_id [String]
52
- # @param symbol [String] The OCC-formatted option symbol.
53
- # @param [Hash] opts the optional parameters
54
- # @return [OptionQuote]
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)
57
- data
58
- end
59
-
60
- # Get option quote
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 &#x60;AAPL 251114C00240000&#x60; 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)
62
- # @param user_id [String]
63
- # @param user_secret [String]
64
- # @param account_id [String]
65
- # @param symbol [String] The OCC-formatted option symbol.
66
- # @param [Hash] opts the optional parameters
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, account_id, symbol, opts = {})
69
- if @api_client.config.debugging
70
- @api_client.config.logger.debug 'Calling API: OptionsApi.get_option_quote ...'
71
- end
72
- # verify the required parameter 'user_id' is set
73
- if @api_client.config.client_side_validation && user_id.nil?
74
- fail ArgumentError, "Missing the required parameter 'user_id' when calling OptionsApi.get_option_quote"
75
- end
76
- # verify the required parameter 'user_secret' is set
77
- if @api_client.config.client_side_validation && user_secret.nil?
78
- fail ArgumentError, "Missing the required parameter 'user_secret' when calling OptionsApi.get_option_quote"
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
84
- # verify the required parameter 'symbol' is set
85
- if @api_client.config.client_side_validation && symbol.nil?
86
- fail ArgumentError, "Missing the required parameter 'symbol' when calling OptionsApi.get_option_quote"
87
- end
88
- # resource path
89
- local_var_path = '/accounts/{accountId}/quotes/options'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
90
-
91
- # query parameters
92
- query_params = opts[:query_params] || {}
93
- query_params[:'userId'] = user_id
94
- query_params[:'userSecret'] = user_secret
95
- query_params[:'symbol'] = symbol
96
-
97
- # header parameters
98
- header_params = opts[:header_params] || {}
99
- # HTTP header 'Accept' (if needed)
100
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
101
-
102
- # form parameters
103
- form_params = opts[:form_params] || {}
104
-
105
- # http body (model)
106
- post_body = opts[:debug_body]
107
-
108
- # return_type
109
- return_type = opts[:debug_return_type] || 'OptionQuote'
110
-
111
- # auth_names
112
- auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
113
-
114
- new_options = opts.merge(
115
- :operation => :"OptionsApi.get_option_quote",
116
- :header_params => header_params,
117
- :query_params => query_params,
118
- :form_params => form_params,
119
- :body => post_body,
120
- :auth_names => auth_names,
121
- :return_type => return_type
122
- )
123
-
124
- data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
125
- if @api_client.config.debugging
126
- @api_client.config.logger.debug "API called: OptionsApi#get_option_quote\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
127
- end
128
- return data, status_code, headers, response
129
- end
130
-
131
-
132
20
  # List account option positions
133
21
  #
134
22
  # Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions).
@@ -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 the [brokerage trading support page](https://snaptrade.notion.site/brokerages) for more information on which brokerages support this endpoint.
384
+ # Only supported for certain enabled brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/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.
@@ -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 the [brokerage trading support page](https://snaptrade.notion.site/brokerages) for more information on which brokerages support this endpoint.
413
+ # Only supported for certain enabled brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/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.
@@ -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 the [brokerage trading support page](https://snaptrade.notion.site/brokerages) for more information on which brokerages support this endpoint.
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 enabled brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/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 the [brokerage trading support page](https://snaptrade.notion.site/brokerages) for more information on which brokerages support this endpoint.
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 enabled brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/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]
@@ -16,54 +16,25 @@ module SnapTrade
16
16
  # The OCC-formatted option symbol.
17
17
  attr_accessor :symbol
18
18
 
19
- # The best bid price for the option contract.
20
- attr_accessor :bid_price
21
-
22
- # The number of contracts available at the bid price.
23
- attr_accessor :bid_size
24
-
25
- # The best ask price for the option contract.
26
- attr_accessor :ask_price
27
-
28
- # The number of contracts available at the ask price.
29
- attr_accessor :ask_size
30
-
31
- # The price of the last trade for the option contract.
32
- attr_accessor :last_price
33
-
34
- # The number of contracts in the last trade.
35
- attr_accessor :last_size
36
-
37
- # The total number of outstanding contracts.
38
- attr_accessor :open_interest
39
-
40
- # The total number of contracts traded during the current session.
41
- attr_accessor :volume
19
+ # The derived synthetic price of the contract.
20
+ attr_accessor :synthetic_price
42
21
 
43
22
  # The implied volatility of the option contract.
44
23
  attr_accessor :implied_volatility
45
24
 
46
- # The current price of the underlying security.
47
- attr_accessor :underlying_price
48
-
49
- # The timestamp of the quote.
25
+ # The timestamp of the last update for the option quote.
50
26
  attr_accessor :timestamp
51
27
 
28
+ attr_accessor :greeks
29
+
52
30
  # Attribute mapping from ruby-style variable name to JSON key.
53
31
  def self.attribute_map
54
32
  {
55
33
  :'symbol' => :'symbol',
56
- :'bid_price' => :'bid_price',
57
- :'bid_size' => :'bid_size',
58
- :'ask_price' => :'ask_price',
59
- :'ask_size' => :'ask_size',
60
- :'last_price' => :'last_price',
61
- :'last_size' => :'last_size',
62
- :'open_interest' => :'open_interest',
63
- :'volume' => :'volume',
34
+ :'synthetic_price' => :'synthetic_price',
64
35
  :'implied_volatility' => :'implied_volatility',
65
- :'underlying_price' => :'underlying_price',
66
- :'timestamp' => :'timestamp'
36
+ :'timestamp' => :'timestamp',
37
+ :'greeks' => :'greeks'
67
38
  }
68
39
  end
69
40
 
@@ -76,24 +47,17 @@ module SnapTrade
76
47
  def self.openapi_types
77
48
  {
78
49
  :'symbol' => :'String',
79
- :'bid_price' => :'Float',
80
- :'bid_size' => :'Integer',
81
- :'ask_price' => :'Float',
82
- :'ask_size' => :'Integer',
83
- :'last_price' => :'Float',
84
- :'last_size' => :'Integer',
85
- :'open_interest' => :'Integer',
86
- :'volume' => :'Integer',
50
+ :'synthetic_price' => :'Float',
87
51
  :'implied_volatility' => :'Float',
88
- :'underlying_price' => :'Float',
89
- :'timestamp' => :'Time'
52
+ :'timestamp' => :'Time',
53
+ :'greeks' => :'OptionQuoteGreeks'
90
54
  }
91
55
  end
92
56
 
93
57
  # List of attributes with nullable: true
94
58
  def self.openapi_nullable
95
59
  Set.new([
96
- :'timestamp'
60
+ :'timestamp',
97
61
  ])
98
62
  end
99
63
 
@@ -116,49 +80,21 @@ module SnapTrade
116
80
  self.symbol = attributes[:'symbol']
117
81
  end
118
82
 
119
- if attributes.key?(:'bid_price')
120
- self.bid_price = attributes[:'bid_price']
121
- end
122
-
123
- if attributes.key?(:'bid_size')
124
- self.bid_size = attributes[:'bid_size']
125
- end
126
-
127
- if attributes.key?(:'ask_price')
128
- self.ask_price = attributes[:'ask_price']
129
- end
130
-
131
- if attributes.key?(:'ask_size')
132
- self.ask_size = attributes[:'ask_size']
133
- end
134
-
135
- if attributes.key?(:'last_price')
136
- self.last_price = attributes[:'last_price']
137
- end
138
-
139
- if attributes.key?(:'last_size')
140
- self.last_size = attributes[:'last_size']
141
- end
142
-
143
- if attributes.key?(:'open_interest')
144
- self.open_interest = attributes[:'open_interest']
145
- end
146
-
147
- if attributes.key?(:'volume')
148
- self.volume = attributes[:'volume']
83
+ if attributes.key?(:'synthetic_price')
84
+ self.synthetic_price = attributes[:'synthetic_price']
149
85
  end
150
86
 
151
87
  if attributes.key?(:'implied_volatility')
152
88
  self.implied_volatility = attributes[:'implied_volatility']
153
89
  end
154
90
 
155
- if attributes.key?(:'underlying_price')
156
- self.underlying_price = attributes[:'underlying_price']
157
- end
158
-
159
91
  if attributes.key?(:'timestamp')
160
92
  self.timestamp = attributes[:'timestamp']
161
93
  end
94
+
95
+ if attributes.key?(:'greeks')
96
+ self.greeks = attributes[:'greeks']
97
+ end
162
98
  end
163
99
 
164
100
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -180,17 +116,10 @@ module SnapTrade
180
116
  return true if self.equal?(o)
181
117
  self.class == o.class &&
182
118
  symbol == o.symbol &&
183
- bid_price == o.bid_price &&
184
- bid_size == o.bid_size &&
185
- ask_price == o.ask_price &&
186
- ask_size == o.ask_size &&
187
- last_price == o.last_price &&
188
- last_size == o.last_size &&
189
- open_interest == o.open_interest &&
190
- volume == o.volume &&
119
+ synthetic_price == o.synthetic_price &&
191
120
  implied_volatility == o.implied_volatility &&
192
- underlying_price == o.underlying_price &&
193
- timestamp == o.timestamp
121
+ timestamp == o.timestamp &&
122
+ greeks == o.greeks
194
123
  end
195
124
 
196
125
  # @see the `==` method
@@ -202,7 +131,7 @@ module SnapTrade
202
131
  # Calculates hash code according to all attributes.
203
132
  # @return [Integer] Hash code
204
133
  def hash
205
- [symbol, bid_price, bid_size, ask_price, ask_size, last_price, last_size, open_interest, volume, implied_volatility, underlying_price, timestamp].hash
134
+ [symbol, synthetic_price, implied_volatility, timestamp, greeks].hash
206
135
  end
207
136
 
208
137
  # Builds the object from hash