snaptrade 2.0.31 → 2.0.32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +31 -29
- data/README.md +4 -2
- data/lib/snaptrade/api/account_information_api.rb +6 -2
- data/lib/snaptrade/models/account_holdings_account.rb +1 -1
- data/lib/snaptrade/models/account_order_record.rb +4 -2
- data/lib/snaptrade/models/exchange.rb +9 -1
- data/lib/snaptrade/models/figi_instrument.rb +3 -1
- data/lib/snaptrade/models/option_brokerage_symbol.rb +3 -1
- data/lib/snaptrade/models/options_position.rb +1 -1
- data/lib/snaptrade/models/options_position_currency.rb +1 -0
- data/lib/snaptrade/models/options_symbol.rb +12 -24
- data/lib/snaptrade/models/position_symbol.rb +6 -1
- data/lib/snaptrade/models/security_type.rb +5 -1
- data/lib/snaptrade/models/symbol_figi_instrument.rb +2 -0
- data/lib/snaptrade/models/underlying_symbol.rb +20 -5
- data/lib/snaptrade/models/{model_portfolio.rb → underlying_symbol_exchange.rb} +73 -12
- data/lib/snaptrade/models/{brokerage_symbol.rb → underlying_symbol_type.rb} +28 -38
- data/lib/snaptrade/models/universal_symbol.rb +9 -3
- data/lib/snaptrade/models/{model_asset_class.rb → universal_symbol_currency.rb} +24 -4
- data/lib/snaptrade/models/{portfolio_group.rb → universal_symbol_exchange.rb} +78 -7
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +4 -36
- data/spec/api/account_information_api_spec.rb +1 -1
- data/spec/models/options_symbol_spec.rb +0 -12
- data/spec/models/{brokerage_symbol_option_symbol_spec.rb → underlying_symbol_exchange_spec.rb} +14 -14
- data/spec/models/underlying_symbol_spec.rb +6 -0
- data/spec/models/{trade_impact_spec.rb → underlying_symbol_type_spec.rb} +10 -16
- data/spec/models/{model_portfolio_spec.rb → universal_symbol_currency_spec.rb} +8 -8
- data/spec/models/{trade_spec.rb → universal_symbol_exchange_spec.rb} +13 -13
- metadata +113 -209
- data/lib/snaptrade/models/brokerage_authorization_type.rb +0 -216
- data/lib/snaptrade/models/brokerage_authorization_type_type.rb +0 -37
- data/lib/snaptrade/models/brokerage_symbol_option_symbol.rb +0 -325
- data/lib/snaptrade/models/brokerage_symbol_symbol.rb +0 -339
- data/lib/snaptrade/models/calculated_trade.rb +0 -228
- data/lib/snaptrade/models/excluded_asset.rb +0 -217
- data/lib/snaptrade/models/jwt.rb +0 -217
- data/lib/snaptrade/models/model_asset_class_details.rb +0 -227
- data/lib/snaptrade/models/model_asset_class_target.rb +0 -216
- data/lib/snaptrade/models/model_portfolio_asset_class.rb +0 -249
- data/lib/snaptrade/models/model_portfolio_details.rb +0 -238
- data/lib/snaptrade/models/model_portfolio_security.rb +0 -249
- data/lib/snaptrade/models/model_type.rb +0 -38
- data/lib/snaptrade/models/portfolio_group_info.rb +0 -325
- data/lib/snaptrade/models/portfolio_group_position.rb +0 -237
- data/lib/snaptrade/models/portfolio_group_settings.rb +0 -276
- data/lib/snaptrade/models/redirect_tokenand_pin.rb +0 -226
- data/lib/snaptrade/models/snap_trade_api_disclaimer_accept_status.rb +0 -226
- data/lib/snaptrade/models/state.rb +0 -40
- data/lib/snaptrade/models/strategy_impact.rb +0 -309
- data/lib/snaptrade/models/strategy_impact_legs_inner.rb +0 -270
- data/lib/snaptrade/models/strategy_order_place.rb +0 -228
- data/lib/snaptrade/models/strategy_order_place_orders_inner.rb +0 -596
- data/lib/snaptrade/models/strategy_order_place_orders_inner_legs_inner.rb +0 -270
- data/lib/snaptrade/models/target_asset.rb +0 -289
- data/lib/snaptrade/models/trade.rb +0 -280
- data/lib/snaptrade/models/trade_action.rb +0 -37
- data/lib/snaptrade/models/trade_execution_status.rb +0 -297
- data/lib/snaptrade/models/trade_execution_status_action.rb +0 -37
- data/lib/snaptrade/models/trade_impact.rb +0 -256
- data/lib/snaptrade/models/user_error_log.rb +0 -262
- data/lib/snaptrade/models/user_settings.rb +0 -298
- data/spec/models/brokerage_authorization_type_spec.rb +0 -29
- data/spec/models/brokerage_authorization_type_type_spec.rb +0 -23
- data/spec/models/brokerage_symbol_spec.rb +0 -59
- data/spec/models/brokerage_symbol_symbol_spec.rb +0 -83
- data/spec/models/calculated_trade_spec.rb +0 -35
- data/spec/models/excluded_asset_spec.rb +0 -29
- data/spec/models/jwt_spec.rb +0 -29
- data/spec/models/model_asset_class_details_spec.rb +0 -35
- data/spec/models/model_asset_class_spec.rb +0 -35
- data/spec/models/model_asset_class_target_spec.rb +0 -29
- data/spec/models/model_portfolio_asset_class_spec.rb +0 -35
- data/spec/models/model_portfolio_details_spec.rb +0 -41
- data/spec/models/model_portfolio_security_spec.rb +0 -35
- data/spec/models/model_type_spec.rb +0 -23
- data/spec/models/portfolio_group_info_spec.rb +0 -89
- data/spec/models/portfolio_group_position_spec.rb +0 -41
- data/spec/models/portfolio_group_settings_spec.rb +0 -53
- data/spec/models/portfolio_group_spec.rb +0 -35
- data/spec/models/redirect_tokenand_pin_spec.rb +0 -35
- data/spec/models/snap_trade_api_disclaimer_accept_status_spec.rb +0 -35
- data/spec/models/state_spec.rb +0 -23
- data/spec/models/strategy_impact_legs_inner_spec.rb +0 -65
- data/spec/models/strategy_impact_spec.rb +0 -89
- data/spec/models/strategy_order_place_orders_inner_legs_inner_spec.rb +0 -65
- data/spec/models/strategy_order_place_orders_inner_spec.rb +0 -281
- data/spec/models/strategy_order_place_spec.rb +0 -35
- data/spec/models/target_asset_spec.rb +0 -59
- data/spec/models/trade_action_spec.rb +0 -23
- data/spec/models/trade_execution_status_action_spec.rb +0 -23
- data/spec/models/trade_execution_status_spec.rb +0 -77
- data/spec/models/user_error_log_spec.rb +0 -59
- data/spec/models/user_settings_spec.rb +0 -83
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 887242914b86d8378fc839b462051ccc0489d1e2a1ba0b37bc6bff2ad458003a
|
4
|
+
data.tar.gz: bd3892448dcca278db8625b0df2f88bc81cd53011ee7b93db4823909f2d273c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f9941bbba13715288cfe8a284dd215fb0d43a89760285651ff7f7f114def7ab938cc79dbdbcd554134017fd448be5944236098aa0831c05304397509dc57cd1
|
7
|
+
data.tar.gz: a1f13e4ff3b7d3faf8702b6f4c8fda8f82ce5ca4bd78811b2180011f31f8f88d21362a19685c3e245acdfe2c8818a07e1d1ae31e414a1c03b6e38dd81edf98a9
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
snaptrade (2.0.
|
4
|
+
snaptrade (2.0.32)
|
5
5
|
faraday (>= 1.0.1, < 3.0)
|
6
6
|
faraday-multipart (~> 1.0, >= 1.0.4)
|
7
7
|
|
@@ -9,27 +9,27 @@ GEM
|
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
11
|
ast (2.4.2)
|
12
|
-
base64 (0.
|
12
|
+
base64 (0.2.0)
|
13
13
|
byebug (11.1.3)
|
14
14
|
coderay (1.1.3)
|
15
15
|
debug (1.8.0)
|
16
16
|
irb (>= 1.5.0)
|
17
17
|
reline (>= 0.3.1)
|
18
|
-
diff-lcs (1.5.
|
19
|
-
faraday (2.
|
18
|
+
diff-lcs (1.5.1)
|
19
|
+
faraday (2.8.1)
|
20
20
|
base64
|
21
21
|
faraday-net_http (>= 2.0, < 3.1)
|
22
22
|
ruby2_keywords (>= 0.0.4)
|
23
23
|
faraday-multipart (1.0.4)
|
24
24
|
multipart-post (~> 2)
|
25
25
|
faraday-net_http (3.0.2)
|
26
|
-
io-console (0.
|
26
|
+
io-console (0.7.2)
|
27
27
|
irb (1.6.4)
|
28
28
|
reline (>= 0.3.0)
|
29
|
-
method_source (1.
|
30
|
-
multipart-post (2.
|
31
|
-
parallel (1.
|
32
|
-
parser (3.
|
29
|
+
method_source (1.1.0)
|
30
|
+
multipart-post (2.4.1)
|
31
|
+
parallel (1.26.2)
|
32
|
+
parser (3.3.4.2)
|
33
33
|
ast (~> 2.4.1)
|
34
34
|
racc
|
35
35
|
pry (0.14.2)
|
@@ -38,26 +38,27 @@ GEM
|
|
38
38
|
pry-byebug (3.10.1)
|
39
39
|
byebug (~> 11.0)
|
40
40
|
pry (>= 0.13, < 0.15)
|
41
|
-
racc (1.
|
41
|
+
racc (1.8.1)
|
42
42
|
rainbow (3.1.1)
|
43
43
|
rake (13.0.6)
|
44
|
-
regexp_parser (2.
|
45
|
-
reline (0.
|
44
|
+
regexp_parser (2.9.2)
|
45
|
+
reline (0.5.9)
|
46
46
|
io-console (~> 0.5)
|
47
|
-
rexml (3.
|
48
|
-
|
49
|
-
|
50
|
-
rspec-
|
51
|
-
rspec-
|
52
|
-
|
53
|
-
|
54
|
-
|
47
|
+
rexml (3.3.5)
|
48
|
+
strscan
|
49
|
+
rspec (3.13.0)
|
50
|
+
rspec-core (~> 3.13.0)
|
51
|
+
rspec-expectations (~> 3.13.0)
|
52
|
+
rspec-mocks (~> 3.13.0)
|
53
|
+
rspec-core (3.13.0)
|
54
|
+
rspec-support (~> 3.13.0)
|
55
|
+
rspec-expectations (3.13.1)
|
55
56
|
diff-lcs (>= 1.2.0, < 2.0)
|
56
|
-
rspec-support (~> 3.
|
57
|
-
rspec-mocks (3.
|
57
|
+
rspec-support (~> 3.13.0)
|
58
|
+
rspec-mocks (3.13.1)
|
58
59
|
diff-lcs (>= 1.2.0, < 2.0)
|
59
|
-
rspec-support (~> 3.
|
60
|
-
rspec-support (3.
|
60
|
+
rspec-support (~> 3.13.0)
|
61
|
+
rspec-support (3.13.1)
|
61
62
|
rubocop (1.12.1)
|
62
63
|
parallel (~> 1.10)
|
63
64
|
parser (>= 3.0.0.0)
|
@@ -67,14 +68,15 @@ GEM
|
|
67
68
|
rubocop-ast (>= 1.2.0, < 2.0)
|
68
69
|
ruby-progressbar (~> 1.7)
|
69
70
|
unicode-display_width (>= 1.4.0, < 3.0)
|
70
|
-
rubocop-ast (1.
|
71
|
-
parser (>= 3.
|
71
|
+
rubocop-ast (1.32.0)
|
72
|
+
parser (>= 3.3.1.0)
|
72
73
|
ruby-progressbar (1.13.0)
|
73
74
|
ruby2_keywords (0.0.5)
|
74
|
-
|
75
|
+
strscan (3.1.0)
|
76
|
+
unicode-display_width (2.5.0)
|
75
77
|
|
76
78
|
PLATFORMS
|
77
|
-
|
79
|
+
x86_64-linux
|
78
80
|
|
79
81
|
DEPENDENCIES
|
80
82
|
debug (~> 1.8)
|
@@ -86,4 +88,4 @@ DEPENDENCIES
|
|
86
88
|
snaptrade!
|
87
89
|
|
88
90
|
BUNDLED WITH
|
89
|
-
2.4.
|
91
|
+
2.4.22
|
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.
|
9
|
+
[![npm](https://img.shields.io/badge/gem-v2.0.32-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.32)
|
10
10
|
[![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
|
11
11
|
|
12
12
|
</div>
|
@@ -70,7 +70,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
70
70
|
Add to Gemfile:
|
71
71
|
|
72
72
|
```ruby
|
73
|
-
gem 'snaptrade', '~> 2.0.
|
73
|
+
gem 'snaptrade', '~> 2.0.32'
|
74
74
|
```
|
75
75
|
|
76
76
|
## Getting Started<a id="getting-started"></a>
|
@@ -305,6 +305,8 @@ The ID of the account to get positions.
|
|
305
305
|
|
306
306
|
Lists balances, positions, option positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__
|
307
307
|
|
308
|
+
The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
309
|
+
|
308
310
|
|
309
311
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
310
312
|
|
@@ -564,6 +564,8 @@ module SnapTrade
|
|
564
564
|
# List account holdings
|
565
565
|
#
|
566
566
|
# Lists balances, positions, option positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__
|
567
|
+
#
|
568
|
+
# The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
567
569
|
#
|
568
570
|
# @param account_id [String]
|
569
571
|
# @param user_id [String]
|
@@ -577,6 +579,8 @@ module SnapTrade
|
|
577
579
|
# List account holdings
|
578
580
|
#
|
579
581
|
# Lists balances, positions, option positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__
|
582
|
+
#
|
583
|
+
# The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for "Cache Expiry Time" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
580
584
|
#
|
581
585
|
# @param account_id [String]
|
582
586
|
# @param user_id [String]
|
@@ -587,7 +591,7 @@ module SnapTrade
|
|
587
591
|
end
|
588
592
|
|
589
593
|
# List account holdings
|
590
|
-
# Lists balances, positions, option positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__
|
594
|
+
# Lists balances, positions, option positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__ The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
591
595
|
# @param account_id [String]
|
592
596
|
# @param user_id [String]
|
593
597
|
# @param user_secret [String]
|
@@ -599,7 +603,7 @@ module SnapTrade
|
|
599
603
|
end
|
600
604
|
|
601
605
|
# List account holdings
|
602
|
-
# Lists balances, positions, option positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__
|
606
|
+
# Lists balances, positions, option positions, and recent orders for the specified account. The data returned is similar to the data returned over the more fine-grained [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getUserAccountPositions) and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders) endpoints. __The finer-grained APIs are preferred. They are easier to work with, faster, and have better error handling than this coarse-grained API.__ The data returned here is cached. How long the data is cached for varies by brokerage. Check the [brokerage integrations doc](https://snaptrade.notion.site/66793431ad0b416489eaabaf248d0afb?v=d16c4c97b8d5438bbb2d8581ac53b11e) and look for \"Cache Expiry Time\" to see the exact value for a specific brokerage. **If you need real-time data, please use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint**.
|
603
607
|
# @param account_id [String]
|
604
608
|
# @param user_id [String]
|
605
609
|
# @param user_secret [String]
|
@@ -11,7 +11,7 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
# A wrapper object containing holdings information for a single account
|
14
|
+
# A wrapper object containing holdings information for a single account.
|
15
15
|
class AccountHoldingsAccount
|
16
16
|
attr_accessor :account
|
17
17
|
|
@@ -11,13 +11,15 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
#
|
14
|
+
# Describes a single recent order in an account.
|
15
15
|
class AccountOrderRecord
|
16
|
-
# Order
|
16
|
+
# Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
|
17
17
|
attr_accessor :brokerage_order_id
|
18
18
|
|
19
|
+
# Indicates the status of an order. SnapTrade does a best effort to map brokerage statuses to statuses in this enum.
|
19
20
|
attr_accessor :status
|
20
21
|
|
22
|
+
# 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.
|
21
23
|
attr_accessor :symbol
|
22
24
|
|
23
25
|
attr_accessor :universal_symbol
|
@@ -11,22 +11,30 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
#
|
14
|
+
# Describes a single stock or crypto exchange.
|
15
15
|
class Exchange
|
16
|
+
# Unique ID for the exchange in SnapTrade.
|
16
17
|
attr_accessor :id
|
17
18
|
|
19
|
+
# A short name for the exchange. For standardized exchange code, please us the `mic_code` field.
|
18
20
|
attr_accessor :code
|
19
21
|
|
22
|
+
# The [Market Identifier Code](https://en.wikipedia.org/wiki/Market_Identifier_Code) (MIC) for the exchange.
|
20
23
|
attr_accessor :mic_code
|
21
24
|
|
25
|
+
# The full name of the exchange.
|
22
26
|
attr_accessor :name
|
23
27
|
|
28
|
+
# The timezone for the trading hours (`start_time` and `close_time`) of the exchange.
|
24
29
|
attr_accessor :timezone
|
25
30
|
|
31
|
+
# The time when the exchange opens for trading.
|
26
32
|
attr_accessor :start_time
|
27
33
|
|
34
|
+
# The time when the exchange closes for trading.
|
28
35
|
attr_accessor :close_time
|
29
36
|
|
37
|
+
# The suffix to be appended to the symbol when trading on this exchange. For example, the suffix for the Toronto Stock Exchange is `.TO`. See `UniversalSymbol->symbol` and `UniversalSymbol->raw_symbol` for more detail.
|
30
38
|
attr_accessor :suffix
|
31
39
|
|
32
40
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -11,10 +11,12 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
#
|
14
|
+
# Financial Instrument Global Identifier (FIGI) information for the security. See [OpenFIGI](https://www.openfigi.com/) for more information.
|
15
15
|
class FigiInstrument
|
16
|
+
# This identifier is unique per security per trading venue. See section 1.4.1 of the [FIGI Standard](https://www.openfigi.com/assets/local/figi-allocation-rules.pdf) for more information.
|
16
17
|
attr_accessor :figi_code
|
17
18
|
|
19
|
+
# This enables users to link multiple FIGIs for the same security in order to obtain an aggregated view across all countries and all exchanges. For example, `AAPL` has a different FIGI for each exchange/trading venue it is traded on. The `figi_share_class` is the same for all of these FIGIs. See section 1.4.3 of the [FIGI Standard](https://www.openfigi.com/assets/local/figi-allocation-rules.pdf) for more information.
|
18
20
|
attr_accessor :figi_share_class
|
19
21
|
|
20
22
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -11,10 +11,12 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
#
|
14
|
+
# Uniquely describes a security for the option position within an account. The distinction between this and the `option_symbol` child property is that this object is specific to a position within an account, while the `option_symbol` child property is universal across all brokerage accounts. The caller should rely on the `option_symbol` child property for most use cases.
|
15
15
|
class OptionBrokerageSymbol
|
16
|
+
# 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.
|
16
17
|
attr_accessor :id
|
17
18
|
|
19
|
+
# This field is deprecated and the caller should use the `option_symbol` child property's `description` instead.
|
18
20
|
attr_accessor :description
|
19
21
|
|
20
22
|
attr_accessor :option_symbol
|
@@ -18,7 +18,7 @@ module SnapTrade
|
|
18
18
|
# Last known market price for the option contract. The freshness of this price depends on the brokerage. Some brokerages provide real-time prices, while others provide delayed prices. It is recommended that you rely on your own third-party market data provider for most up to date prices.
|
19
19
|
attr_accessor :price
|
20
20
|
|
21
|
-
# The number of contracts for this option position.
|
21
|
+
# The number of contracts for this option position. A positive number indicates a long position, while a negative number indicates a short position.
|
22
22
|
attr_accessor :units
|
23
23
|
|
24
24
|
attr_accessor :currency
|
@@ -11,6 +11,7 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
+
# The currency of the price. This field is deprecated and will be removed in a future version. The currency of the price is determined by the currency of the underlying security.
|
14
15
|
class OptionsPositionCurrency
|
15
16
|
# Unique identifier for the currency. This is the UUID used to reference the currency in SnapTrade.
|
16
17
|
attr_accessor :id
|
@@ -11,26 +11,28 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
#
|
14
|
+
# Uniquely describes an option security + exchange combination across all brokerages.
|
15
15
|
class OptionsSymbol
|
16
|
+
# Unique identifier for the option symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
|
16
17
|
attr_accessor :id
|
17
18
|
|
19
|
+
# The [OCC symbol](https://en.wikipedia.org/wiki/Option_symbol) for the option.
|
18
20
|
attr_accessor :ticker
|
19
21
|
|
22
|
+
# The type of option. Either \"CALL\" or \"PUT\".
|
20
23
|
attr_accessor :option_type
|
21
24
|
|
25
|
+
# The option strike price.
|
22
26
|
attr_accessor :strike_price
|
23
27
|
|
28
|
+
# The option expiration date.
|
24
29
|
attr_accessor :expiration_date
|
25
30
|
|
31
|
+
# Whether the option is a mini option. Mini options have 10 underlying shares per contract instead of the standard 100.
|
26
32
|
attr_accessor :is_mini_option
|
27
33
|
|
28
34
|
attr_accessor :underlying_symbol
|
29
35
|
|
30
|
-
attr_accessor :local_id
|
31
|
-
|
32
|
-
attr_accessor :exchange_id
|
33
|
-
|
34
36
|
# Attribute mapping from ruby-style variable name to JSON key.
|
35
37
|
def self.attribute_map
|
36
38
|
{
|
@@ -40,9 +42,7 @@ module SnapTrade
|
|
40
42
|
:'strike_price' => :'strike_price',
|
41
43
|
:'expiration_date' => :'expiration_date',
|
42
44
|
:'is_mini_option' => :'is_mini_option',
|
43
|
-
:'underlying_symbol' => :'underlying_symbol'
|
44
|
-
:'local_id' => :'local_id',
|
45
|
-
:'exchange_id' => :'exchange_id'
|
45
|
+
:'underlying_symbol' => :'underlying_symbol'
|
46
46
|
}
|
47
47
|
end
|
48
48
|
|
@@ -58,11 +58,9 @@ module SnapTrade
|
|
58
58
|
:'ticker' => :'String',
|
59
59
|
:'option_type' => :'OptionType',
|
60
60
|
:'strike_price' => :'Float',
|
61
|
-
:'expiration_date' => :'
|
61
|
+
:'expiration_date' => :'Date',
|
62
62
|
:'is_mini_option' => :'Boolean',
|
63
|
-
:'underlying_symbol' => :'UnderlyingSymbol'
|
64
|
-
:'local_id' => :'String',
|
65
|
-
:'exchange_id' => :'String'
|
63
|
+
:'underlying_symbol' => :'UnderlyingSymbol'
|
66
64
|
}
|
67
65
|
end
|
68
66
|
|
@@ -114,14 +112,6 @@ module SnapTrade
|
|
114
112
|
if attributes.key?(:'underlying_symbol')
|
115
113
|
self.underlying_symbol = attributes[:'underlying_symbol']
|
116
114
|
end
|
117
|
-
|
118
|
-
if attributes.key?(:'local_id')
|
119
|
-
self.local_id = attributes[:'local_id']
|
120
|
-
end
|
121
|
-
|
122
|
-
if attributes.key?(:'exchange_id')
|
123
|
-
self.exchange_id = attributes[:'exchange_id']
|
124
|
-
end
|
125
115
|
end
|
126
116
|
|
127
117
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -178,9 +168,7 @@ module SnapTrade
|
|
178
168
|
strike_price == o.strike_price &&
|
179
169
|
expiration_date == o.expiration_date &&
|
180
170
|
is_mini_option == o.is_mini_option &&
|
181
|
-
underlying_symbol == o.underlying_symbol
|
182
|
-
local_id == o.local_id &&
|
183
|
-
exchange_id == o.exchange_id
|
171
|
+
underlying_symbol == o.underlying_symbol
|
184
172
|
end
|
185
173
|
|
186
174
|
# @see the `==` method
|
@@ -192,7 +180,7 @@ module SnapTrade
|
|
192
180
|
# Calculates hash code according to all attributes.
|
193
181
|
# @return [Integer] Hash code
|
194
182
|
def hash
|
195
|
-
[id, ticker, option_type, strike_price, expiration_date, is_mini_option, underlying_symbol
|
183
|
+
[id, ticker, option_type, strike_price, expiration_date, is_mini_option, underlying_symbol].hash
|
196
184
|
end
|
197
185
|
|
198
186
|
# Builds the object from hash
|
@@ -11,18 +11,23 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
#
|
14
|
+
# Uniquely describes a security for the position within an account. The distinction between this and the `symbol` child property is that this object is specific to a position within an account, while the `symbol` child property is universal across all brokerage accounts. The caller should rely on the `symbol` child property for most use cases.
|
15
15
|
class PositionSymbol
|
16
|
+
# 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.
|
16
17
|
attr_accessor :id
|
17
18
|
|
19
|
+
# This field is deprecated and the caller should use the `symbol` child property's `description` instead.
|
18
20
|
attr_accessor :description
|
19
21
|
|
20
22
|
attr_accessor :symbol
|
21
23
|
|
24
|
+
# This field is deprecated and should not be used. Please reach out to SnapTrade support if you have a valid usecase for this.
|
22
25
|
attr_accessor :local_id
|
23
26
|
|
27
|
+
# This field is deprecated and should not be used. Please reach out to SnapTrade support if you have a valid usecase for this.
|
24
28
|
attr_accessor :is_quotable
|
25
29
|
|
30
|
+
# This field is deprecated and should not be used. Please reach out to SnapTrade support if you have a valid usecase for this.
|
26
31
|
attr_accessor :is_tradable
|
27
32
|
|
28
33
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -11,14 +11,18 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
#
|
14
|
+
# The type of security. For example, \"Common Stock\" or \"ETF\".
|
15
15
|
class SecurityType
|
16
|
+
# Unique identifier for the security type within SnapTrade. This is the ID used to reference the security type in SnapTrade API calls.
|
16
17
|
attr_accessor :id
|
17
18
|
|
19
|
+
# A short code representing the security type. For example, \"cs\" for Common Stock. Here are some common values: ad - ADR bnd - Bond cs - Common Stock cef - Closed End Fund et - ETF oef - Open Ended Fund ps - Preferred Stock rt - Right struct - Structured Product ut - Unit wi - When Issued wt - Warrant
|
18
20
|
attr_accessor :code
|
19
21
|
|
22
|
+
# A human-readable description of the security type. For example, \"Common Stock\" or \"ETF\".
|
20
23
|
attr_accessor :description
|
21
24
|
|
25
|
+
# This field is deprecated and should not be used. Please reach out to SnapTrade support if you have a valid usecase for this.
|
22
26
|
attr_accessor :is_supported
|
23
27
|
|
24
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -12,8 +12,10 @@ require 'time'
|
|
12
12
|
|
13
13
|
module SnapTrade
|
14
14
|
class SymbolFigiInstrument
|
15
|
+
# This identifier is unique per security per trading venue. See section 1.4.1 of the [FIGI Standard](https://www.openfigi.com/assets/local/figi-allocation-rules.pdf) for more information.
|
15
16
|
attr_accessor :figi_code
|
16
17
|
|
18
|
+
# This enables users to link multiple FIGIs for the same security in order to obtain an aggregated view across all countries and all exchanges. For example, `AAPL` has a different FIGI for each exchange/trading venue it is traded on. The `figi_share_class` is the same for all of these FIGIs. See section 1.4.3 of the [FIGI Standard](https://www.openfigi.com/assets/local/figi-allocation-rules.pdf) for more information.
|
17
19
|
attr_accessor :figi_share_class
|
18
20
|
|
19
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -11,12 +11,18 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
#
|
14
|
+
# Symbol object for the underlying security of an option.
|
15
15
|
class UnderlyingSymbol
|
16
|
+
# Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
|
16
17
|
attr_accessor :id
|
17
18
|
|
19
|
+
# The security's trading ticker symbol. For example \"AAPL\" for Apple Inc. We largely follow the [Yahoo Finance ticker format](https://help.yahoo.com/kb/SLN2310.html)(click on \"Yahoo Finance Market Coverage and Data Delays\"). For example, for securities traded on the Toronto Stock Exchange, the symbol has a '.TO' suffix. For securities traded on NASDAQ or NYSE, the symbol does not have a suffix.
|
18
20
|
attr_accessor :symbol
|
19
21
|
|
22
|
+
# The raw symbol is `symbol` with the exchange suffix removed. For example, if `symbol` is \"VAB.TO\", then `raw_symbol` is \"VAB\".
|
23
|
+
attr_accessor :raw_symbol
|
24
|
+
|
25
|
+
# A human-readable description of the security. This is usually the company name or ETF name.
|
20
26
|
attr_accessor :description
|
21
27
|
|
22
28
|
attr_accessor :currency
|
@@ -25,8 +31,10 @@ module SnapTrade
|
|
25
31
|
|
26
32
|
attr_accessor :type
|
27
33
|
|
34
|
+
# This field is deprecated and should not be used. Please reach out to SnapTrade support if you have a valid usecase for this.
|
28
35
|
attr_accessor :currencies
|
29
36
|
|
37
|
+
# This identifier is unique per security per trading venue. See section 1.4.1 of the [FIGI Standard](https://www.openfigi.com/assets/local/figi-allocation-rules.pdf) for more information. This value should be the same as the `figi_code` in the `figi_instrument` child property.
|
30
38
|
attr_accessor :figi_code
|
31
39
|
|
32
40
|
attr_accessor :figi_instrument
|
@@ -36,6 +44,7 @@ module SnapTrade
|
|
36
44
|
{
|
37
45
|
:'id' => :'id',
|
38
46
|
:'symbol' => :'symbol',
|
47
|
+
:'raw_symbol' => :'raw_symbol',
|
39
48
|
:'description' => :'description',
|
40
49
|
:'currency' => :'currency',
|
41
50
|
:'exchange' => :'exchange',
|
@@ -56,10 +65,11 @@ module SnapTrade
|
|
56
65
|
{
|
57
66
|
:'id' => :'String',
|
58
67
|
:'symbol' => :'String',
|
68
|
+
:'raw_symbol' => :'String',
|
59
69
|
:'description' => :'String',
|
60
|
-
:'currency' => :'
|
61
|
-
:'exchange' => :'
|
62
|
-
:'type' => :'
|
70
|
+
:'currency' => :'UniversalSymbolCurrency',
|
71
|
+
:'exchange' => :'UnderlyingSymbolExchange',
|
72
|
+
:'type' => :'UnderlyingSymbolType',
|
63
73
|
:'currencies' => :'Array<Currency>',
|
64
74
|
:'figi_code' => :'String',
|
65
75
|
:'figi_instrument' => :'SymbolFigiInstrument'
|
@@ -98,6 +108,10 @@ module SnapTrade
|
|
98
108
|
self.symbol = attributes[:'symbol']
|
99
109
|
end
|
100
110
|
|
111
|
+
if attributes.key?(:'raw_symbol')
|
112
|
+
self.raw_symbol = attributes[:'raw_symbol']
|
113
|
+
end
|
114
|
+
|
101
115
|
if attributes.key?(:'description')
|
102
116
|
self.description = attributes[:'description']
|
103
117
|
end
|
@@ -149,6 +163,7 @@ module SnapTrade
|
|
149
163
|
self.class == o.class &&
|
150
164
|
id == o.id &&
|
151
165
|
symbol == o.symbol &&
|
166
|
+
raw_symbol == o.raw_symbol &&
|
152
167
|
description == o.description &&
|
153
168
|
currency == o.currency &&
|
154
169
|
exchange == o.exchange &&
|
@@ -167,7 +182,7 @@ module SnapTrade
|
|
167
182
|
# Calculates hash code according to all attributes.
|
168
183
|
# @return [Integer] Hash code
|
169
184
|
def hash
|
170
|
-
[id, symbol, description, currency, exchange, type, currencies, figi_code, figi_instrument].hash
|
185
|
+
[id, symbol, raw_symbol, description, currency, exchange, type, currencies, figi_code, figi_instrument].hash
|
171
186
|
end
|
172
187
|
|
173
188
|
# Builds the object from hash
|