snaptrade 2.0.53 → 2.0.55
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/README.md +110 -2
- data/lib/snaptrade/api/account_information_api.rb +212 -0
- data/lib/snaptrade/api/connections_api.rb +103 -0
- data/lib/snaptrade/models/rate_of_return_object.rb +238 -0
- data/lib/snaptrade/models/rate_of_return_response.rb +220 -0
- data/lib/snaptrade/models/recent_orders_response.rb +220 -0
- data/lib/snaptrade/models/timeframe.rb +40 -0
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +4 -0
- data/spec/api/account_information_api_spec.rb +28 -0
- data/spec/api/connections_api_spec.rb +14 -0
- data/spec/models/rate_of_return_object_spec.rb +41 -0
- data/spec/models/rate_of_return_response_spec.rb +29 -0
- data/spec/models/recent_orders_response_spec.rb +29 -0
- data/spec/models/timeframe_spec.rb +23 -0
- metadata +14 -2
data/lib/snaptrade/version.rb
CHANGED
data/lib/snaptrade.rb
CHANGED
@@ -94,6 +94,9 @@ require 'snaptrade/models/past_value'
|
|
94
94
|
require 'snaptrade/models/performance_custom'
|
95
95
|
require 'snaptrade/models/position'
|
96
96
|
require 'snaptrade/models/position_symbol'
|
97
|
+
require 'snaptrade/models/rate_of_return_object'
|
98
|
+
require 'snaptrade/models/rate_of_return_response'
|
99
|
+
require 'snaptrade/models/recent_orders_response'
|
97
100
|
require 'snaptrade/models/security_type'
|
98
101
|
require 'snaptrade/models/session_event'
|
99
102
|
require 'snaptrade/models/session_event_type'
|
@@ -115,6 +118,7 @@ require 'snaptrade/models/symbol_figi_instrument'
|
|
115
118
|
require 'snaptrade/models/symbol_query'
|
116
119
|
require 'snaptrade/models/symbols_quotes_inner'
|
117
120
|
require 'snaptrade/models/time_in_force_strict'
|
121
|
+
require 'snaptrade/models/timeframe'
|
118
122
|
require 'snaptrade/models/trading_cancel_user_account_order_request'
|
119
123
|
require 'snaptrade/models/transactions_status'
|
120
124
|
require 'snaptrade/models/type'
|
@@ -99,6 +99,34 @@ describe 'AccountInformationApi' do
|
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
102
|
+
# unit tests for get_user_account_recent_orders
|
103
|
+
# List account recent executed orders
|
104
|
+
# Returns a list of orders executed in the last 24 hours in the specified account. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution Differs from /orders in that it only returns orders that have been *executed* in the last 24 hours as opposed to pending or cancelled orders up to 30 days old *Please contact support for access as this endpoint is not enabled by default.*
|
105
|
+
# @param user_id
|
106
|
+
# @param user_secret
|
107
|
+
# @param account_id
|
108
|
+
# @param [Hash] opts the optional parameters
|
109
|
+
# @return [RecentOrdersResponse]
|
110
|
+
describe 'get_user_account_recent_orders test' do
|
111
|
+
it 'should work' do
|
112
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
# unit tests for get_user_account_return_rates
|
117
|
+
# List account rate of returns
|
118
|
+
# Returns a list of rate of return percents for a given account. Will include timeframes available from the brokerage, for example \"ALL\", \"1Y\", \"6M\", \"3M\", \"1M\"
|
119
|
+
# @param user_id
|
120
|
+
# @param user_secret
|
121
|
+
# @param account_id
|
122
|
+
# @param [Hash] opts the optional parameters
|
123
|
+
# @return [RateOfReturnResponse]
|
124
|
+
describe 'get_user_account_return_rates test' do
|
125
|
+
it 'should work' do
|
126
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
102
130
|
# unit tests for get_user_holdings
|
103
131
|
# List account holdings
|
104
132
|
# Returns a list of balances, 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**.
|
@@ -96,6 +96,20 @@ describe 'ConnectionsApi' do
|
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
99
|
+
# unit tests for return_rates
|
100
|
+
# List connection rate of returns
|
101
|
+
# Returns a list of rate of return percents for a given connection. Will include timeframes available from the brokerage, for example \"ALL\", \"1Y\", \"6M\", \"3M\", \"1M\"
|
102
|
+
# @param user_id
|
103
|
+
# @param user_secret
|
104
|
+
# @param authorization_id
|
105
|
+
# @param [Hash] opts the optional parameters
|
106
|
+
# @return [RateOfReturnResponse]
|
107
|
+
describe 'return_rates test' do
|
108
|
+
it 'should work' do
|
109
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
99
113
|
# unit tests for session_events
|
100
114
|
# Get all session events for a user
|
101
115
|
# Returns a list of session events associated with a user.
|
@@ -0,0 +1,41 @@
|
|
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::RateOfReturnObject
|
15
|
+
describe SnapTrade::RateOfReturnObject do
|
16
|
+
let(:instance) { SnapTrade::RateOfReturnObject.new }
|
17
|
+
|
18
|
+
describe 'test an instance of RateOfReturnObject' do
|
19
|
+
it 'should create an instance of RateOfReturnObject' do
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::RateOfReturnObject)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
describe 'test attribute "timeframe"' do
|
24
|
+
it 'should work' do
|
25
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test attribute "return_percent"' 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 "created_date"' do
|
36
|
+
it 'should work' do
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
@@ -0,0 +1,29 @@
|
|
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::RateOfReturnResponse
|
15
|
+
describe SnapTrade::RateOfReturnResponse do
|
16
|
+
let(:instance) { SnapTrade::RateOfReturnResponse.new }
|
17
|
+
|
18
|
+
describe 'test an instance of RateOfReturnResponse' do
|
19
|
+
it 'should create an instance of RateOfReturnResponse' do
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::RateOfReturnResponse)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
describe 'test attribute "data"' do
|
24
|
+
it 'should work' do
|
25
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
@@ -0,0 +1,29 @@
|
|
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::RecentOrdersResponse
|
15
|
+
describe SnapTrade::RecentOrdersResponse do
|
16
|
+
let(:instance) { SnapTrade::RecentOrdersResponse.new }
|
17
|
+
|
18
|
+
describe 'test an instance of RecentOrdersResponse' do
|
19
|
+
it 'should create an instance of RecentOrdersResponse' do
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::RecentOrdersResponse)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
describe 'test attribute "orders"' do
|
24
|
+
it 'should work' do
|
25
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
@@ -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::Timeframe
|
15
|
+
describe SnapTrade::Timeframe do
|
16
|
+
let(:instance) { SnapTrade::Timeframe.new }
|
17
|
+
|
18
|
+
describe 'test an instance of Timeframe' do
|
19
|
+
it 'should create an instance of Timeframe' do
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::Timeframe)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
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.55
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SnapTrade
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -173,6 +173,9 @@ files:
|
|
173
173
|
- lib/snaptrade/models/performance_custom.rb
|
174
174
|
- lib/snaptrade/models/position.rb
|
175
175
|
- lib/snaptrade/models/position_symbol.rb
|
176
|
+
- lib/snaptrade/models/rate_of_return_object.rb
|
177
|
+
- lib/snaptrade/models/rate_of_return_response.rb
|
178
|
+
- lib/snaptrade/models/recent_orders_response.rb
|
176
179
|
- lib/snaptrade/models/security_type.rb
|
177
180
|
- lib/snaptrade/models/session_event.rb
|
178
181
|
- lib/snaptrade/models/session_event_type.rb
|
@@ -194,6 +197,7 @@ files:
|
|
194
197
|
- lib/snaptrade/models/symbol_query.rb
|
195
198
|
- lib/snaptrade/models/symbols_quotes_inner.rb
|
196
199
|
- lib/snaptrade/models/time_in_force_strict.rb
|
200
|
+
- lib/snaptrade/models/timeframe.rb
|
197
201
|
- lib/snaptrade/models/trading_cancel_user_account_order_request.rb
|
198
202
|
- lib/snaptrade/models/transactions_status.rb
|
199
203
|
- lib/snaptrade/models/type.rb
|
@@ -299,6 +303,9 @@ files:
|
|
299
303
|
- spec/models/performance_custom_spec.rb
|
300
304
|
- spec/models/position_spec.rb
|
301
305
|
- spec/models/position_symbol_spec.rb
|
306
|
+
- spec/models/rate_of_return_object_spec.rb
|
307
|
+
- spec/models/rate_of_return_response_spec.rb
|
308
|
+
- spec/models/recent_orders_response_spec.rb
|
302
309
|
- spec/models/security_type_spec.rb
|
303
310
|
- spec/models/session_event_spec.rb
|
304
311
|
- spec/models/session_event_type_spec.rb
|
@@ -320,6 +327,7 @@ files:
|
|
320
327
|
- spec/models/symbol_spec.rb
|
321
328
|
- spec/models/symbols_quotes_inner_spec.rb
|
322
329
|
- spec/models/time_in_force_strict_spec.rb
|
330
|
+
- spec/models/timeframe_spec.rb
|
323
331
|
- spec/models/trading_cancel_user_account_order_request_spec.rb
|
324
332
|
- spec/models/transactions_status_spec.rb
|
325
333
|
- spec/models/type_spec.rb
|
@@ -380,6 +388,7 @@ test_files:
|
|
380
388
|
- spec/models/option_leg_spec.rb
|
381
389
|
- spec/models/account_spec.rb
|
382
390
|
- spec/models/exchange_rate_pairs_spec.rb
|
391
|
+
- spec/models/recent_orders_response_spec.rb
|
383
392
|
- spec/models/model403_feature_not_enabled_response_spec.rb
|
384
393
|
- spec/models/time_in_force_strict_spec.rb
|
385
394
|
- spec/models/options_get_option_strategy_request_spec.rb
|
@@ -428,12 +437,14 @@ test_files:
|
|
428
437
|
- spec/models/options_place_option_strategy_request_spec.rb
|
429
438
|
- spec/models/notional_value_spec.rb
|
430
439
|
- spec/models/account_order_record_universal_symbol_spec.rb
|
440
|
+
- spec/models/timeframe_spec.rb
|
431
441
|
- spec/models/session_event_type_spec.rb
|
432
442
|
- spec/models/underlying_symbol_spec.rb
|
433
443
|
- spec/models/trading_cancel_user_account_order_request_spec.rb
|
434
444
|
- spec/models/us_exchange_spec.rb
|
435
445
|
- spec/models/strategy_order_record_status_spec.rb
|
436
446
|
- spec/models/balance_spec.rb
|
447
|
+
- spec/models/rate_of_return_object_spec.rb
|
437
448
|
- spec/models/universal_symbol_spec.rb
|
438
449
|
- spec/models/strategy_quotes_greek_spec.rb
|
439
450
|
- spec/models/options_position_spec.rb
|
@@ -467,6 +478,7 @@ test_files:
|
|
467
478
|
- spec/models/options_position_currency_spec.rb
|
468
479
|
- spec/models/authentication_login_snap_trade_user200_response_spec.rb
|
469
480
|
- spec/models/account_holdings_spec.rb
|
481
|
+
- spec/models/rate_of_return_response_spec.rb
|
470
482
|
- spec/models/encrypted_response_encrypted_message_data_spec.rb
|
471
483
|
- spec/models/strategy_type_spec.rb
|
472
484
|
- spec/models/manual_trade_and_impact_spec.rb
|