snaptrade 2.0.70 → 2.0.71
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +77 -8
- data/lib/snaptrade/api/account_information_api.rb +132 -0
- data/lib/snaptrade/api/transactions_and_reporting_api.rb +4 -4
- data/lib/snaptrade/version.rb +1 -1
- data/spec/api/account_information_api_spec.rb +17 -0
- data/spec/api/transactions_and_reporting_api_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 331918e282cbf30fde05e5a9c0712d94a220e0a0a4b6a2d1a2822c9123cd520b
|
4
|
+
data.tar.gz: 499926478a36d2e78583de8f30f01a51c587571aa7c38d4403c5876b55e94448
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 776323da13f42eb87522aeeceaac7ba3071f0a4c018f889c1cc004d02f3db9276c02dd3708c368fa856c05b4759055beb9af8429f86987c248ffe1e0d5081bf3
|
7
|
+
data.tar.gz: b380fd51c3000756d98d1fff33a5dd65df480fe1f0935b240ce79c60eff04cc25673abb41f0670977a072d4090927a71034c22d6dcabbf13541bc3ae5ef2b046
|
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.71)
|
5
5
|
faraday (>= 1.0.1, < 3.0)
|
6
6
|
faraday-multipart (~> 1.0, >= 1.0.4)
|
7
7
|
|
@@ -29,7 +29,7 @@ GEM
|
|
29
29
|
method_source (1.1.0)
|
30
30
|
multipart-post (2.4.1)
|
31
31
|
parallel (1.26.3)
|
32
|
-
parser (3.3.
|
32
|
+
parser (3.3.7.0)
|
33
33
|
ast (~> 2.4.1)
|
34
34
|
racc
|
35
35
|
pry (0.14.2)
|
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.71)
|
10
10
|
[](https://snaptrade.com/)
|
11
11
|
|
12
12
|
</div>
|
@@ -19,6 +19,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
19
19
|
- [Getting Started](#getting-started)
|
20
20
|
- [Raw HTTP Response](#raw-http-response)
|
21
21
|
- [Reference](#reference)
|
22
|
+
* [`snaptrade.account_information.get_account_activities`](#snaptradeaccount_informationget_account_activities)
|
22
23
|
* [`snaptrade.account_information.get_all_user_holdings`](#snaptradeaccount_informationget_all_user_holdings)
|
23
24
|
* [`snaptrade.account_information.get_user_account_balance`](#snaptradeaccount_informationget_user_account_balance)
|
24
25
|
* [`snaptrade.account_information.get_user_account_details`](#snaptradeaccount_informationget_user_account_details)
|
@@ -73,7 +74,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
73
74
|
Add to Gemfile:
|
74
75
|
|
75
76
|
```ruby
|
76
|
-
gem 'snaptrade', '~> 2.0.
|
77
|
+
gem 'snaptrade', '~> 2.0.71'
|
77
78
|
```
|
78
79
|
|
79
80
|
## Getting Started<a id="getting-started"></a>
|
@@ -85,10 +86,13 @@ configuration = SnapTrade::Configuration.new
|
|
85
86
|
configuration.client_id = ENV["SNAPTRADE_CLIENT_ID"]
|
86
87
|
configuration.consumer_key = ENV["SNAPTRADE_CONSUMER_KEY"]
|
87
88
|
snaptrade = SnapTrade::Client.new(configuration)
|
88
|
-
result = snaptrade.account_information.
|
89
|
+
result = snaptrade.account_information.get_account_activities(
|
90
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
89
91
|
user_id: "snaptrade-user-123",
|
90
92
|
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
91
|
-
|
93
|
+
start_date: "2022-01-24",
|
94
|
+
end_date: "2022-01-24",
|
95
|
+
type: "BUY,SELL,DIVIDEND",
|
92
96
|
)
|
93
97
|
p result
|
94
98
|
```
|
@@ -98,12 +102,15 @@ p result
|
|
98
102
|
To access the raw HTTP response, suffix any method with `_with_http_info`.
|
99
103
|
|
100
104
|
```ruby
|
101
|
-
result = snaptrade.account_information.
|
105
|
+
result = snaptrade.account_information.get_account_activities_with_http_info(
|
106
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
102
107
|
user_id: "snaptrade-user-123",
|
103
108
|
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
104
|
-
|
109
|
+
start_date: "2022-01-24",
|
110
|
+
end_date: "2022-01-24",
|
111
|
+
type: "BUY,SELL,DIVIDEND",
|
105
112
|
)
|
106
|
-
p result[0] # [Array<
|
113
|
+
p result[0] # [Array<UniversalActivity>] Deserialized data
|
107
114
|
p.result[1] # [Integer] HTTP status code
|
108
115
|
p.result[2] # [Hash] HTTP headers
|
109
116
|
p.result[3] # [Faraday::Response] Raw HTTP response
|
@@ -112,6 +119,68 @@ p.result[3] # [Faraday::Response] Raw HTTP response
|
|
112
119
|
## Reference<a id="reference"></a>
|
113
120
|
|
114
121
|
|
122
|
+
### `snaptrade.account_information.get_account_activities`<a id="snaptradeaccount_informationget_account_activities"></a>
|
123
|
+
|
124
|
+
Returns all historical transactions for the specified account. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request.
|
125
|
+
|
126
|
+
There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order.
|
127
|
+
|
128
|
+
The data returned here is always cached and refreshed once a day.
|
129
|
+
|
130
|
+
|
131
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
132
|
+
|
133
|
+
```ruby
|
134
|
+
result = snaptrade.account_information.get_account_activities(
|
135
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
136
|
+
user_id: "snaptrade-user-123",
|
137
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
138
|
+
start_date: "2022-01-24",
|
139
|
+
end_date: "2022-01-24",
|
140
|
+
type: "BUY,SELL,DIVIDEND",
|
141
|
+
)
|
142
|
+
p result
|
143
|
+
```
|
144
|
+
|
145
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
146
|
+
|
147
|
+
##### account_id: `String`<a id="account_id-string"></a>
|
148
|
+
##### user_id: `String`<a id="user_id-string"></a>
|
149
|
+
##### user_secret: `String`<a id="user_secret-string"></a>
|
150
|
+
##### start_date: `Date`<a id="start_date-date"></a>
|
151
|
+
The start date (inclusive) of the transaction history to retrieve. If not
|
152
|
+
provided, the default is the first transaction known to SnapTrade based on
|
153
|
+
`trade_date`.
|
154
|
+
|
155
|
+
##### end_date: `Date`<a id="end_date-date"></a>
|
156
|
+
The end date (inclusive) of the transaction history to retrieve. If not
|
157
|
+
provided, the default is the last transaction known to SnapTrade based on
|
158
|
+
`trade_date`.
|
159
|
+
|
160
|
+
##### type: `String`<a id="type-string"></a>
|
161
|
+
Optional comma separated list of transaction types to filter by. SnapTrade does
|
162
|
+
a best effort to categorize brokerage transaction types into a common set of
|
163
|
+
values. Here are some of the most popular values: - `BUY` - Asset bought. -
|
164
|
+
`SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash
|
165
|
+
contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment.
|
166
|
+
- `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from
|
167
|
+
the account. - `OPTIONEXPIRATION` - Option expiration event. -
|
168
|
+
`OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option
|
169
|
+
exercise event. - `TRANSFER` - Transfer of assets from one account to another
|
170
|
+
|
171
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
172
|
+
|
173
|
+
[UniversalActivity](./lib/snaptrade/models/universal_activity.rb)
|
174
|
+
|
175
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
176
|
+
|
177
|
+
`/accounts/{accountId}/activities` `GET`
|
178
|
+
|
179
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
180
|
+
|
181
|
+
---
|
182
|
+
|
183
|
+
|
115
184
|
### `snaptrade.account_information.get_all_user_holdings`<a id="snaptradeaccount_informationget_all_user_holdings"></a>
|
116
185
|

|
117
186
|
|
@@ -1800,7 +1869,7 @@ Returns all historical transactions for the specified user and filtering criteri
|
|
1800
1869
|
|
1801
1870
|
There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order.
|
1802
1871
|
|
1803
|
-
The data returned here is always cached and refreshed once a day.
|
1872
|
+
The data returned here is always cached and refreshed once a day.
|
1804
1873
|
|
1805
1874
|
|
1806
1875
|
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
@@ -17,6 +17,138 @@ module SnapTrade
|
|
17
17
|
@api_client = api_client
|
18
18
|
end
|
19
19
|
|
20
|
+
# List account activities
|
21
|
+
#
|
22
|
+
# Returns all historical transactions for the specified account. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request.
|
23
|
+
#
|
24
|
+
# There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order.
|
25
|
+
#
|
26
|
+
# The data returned here is always cached and refreshed once a day.
|
27
|
+
#
|
28
|
+
# @param account_id [String]
|
29
|
+
# @param user_id [String]
|
30
|
+
# @param user_secret [String]
|
31
|
+
# @param start_date [Date] The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on `trade_date`.
|
32
|
+
# @param end_date [Date] The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`.
|
33
|
+
# @param type [String] Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of assets from one account to another
|
34
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
35
|
+
def get_account_activities(account_id:, user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, type: SENTINEL, extra: {})
|
36
|
+
extra[:start_date] = start_date if start_date != SENTINEL
|
37
|
+
extra[:end_date] = end_date if end_date != SENTINEL
|
38
|
+
extra[:type] = type if type != SENTINEL
|
39
|
+
data, _status_code, _headers = get_account_activities_with_http_info_impl(account_id, user_id, user_secret, extra)
|
40
|
+
data
|
41
|
+
end
|
42
|
+
|
43
|
+
# List account activities
|
44
|
+
#
|
45
|
+
# Returns all historical transactions for the specified account. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request.
|
46
|
+
#
|
47
|
+
# There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order.
|
48
|
+
#
|
49
|
+
# The data returned here is always cached and refreshed once a day.
|
50
|
+
#
|
51
|
+
# @param account_id [String]
|
52
|
+
# @param user_id [String]
|
53
|
+
# @param user_secret [String]
|
54
|
+
# @param start_date [Date] The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on `trade_date`.
|
55
|
+
# @param end_date [Date] The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`.
|
56
|
+
# @param type [String] Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of assets from one account to another
|
57
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
58
|
+
def get_account_activities_with_http_info(account_id:, user_id:, user_secret:, start_date: SENTINEL, end_date: SENTINEL, type: SENTINEL, extra: {})
|
59
|
+
extra[:start_date] = start_date if start_date != SENTINEL
|
60
|
+
extra[:end_date] = end_date if end_date != SENTINEL
|
61
|
+
extra[:type] = type if type != SENTINEL
|
62
|
+
get_account_activities_with_http_info_impl(account_id, user_id, user_secret, extra)
|
63
|
+
end
|
64
|
+
|
65
|
+
# List account activities
|
66
|
+
# Returns all historical transactions for the specified account. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request. There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order. The data returned here is always cached and refreshed once a day.
|
67
|
+
# @param account_id [String]
|
68
|
+
# @param user_id [String]
|
69
|
+
# @param user_secret [String]
|
70
|
+
# @param [Hash] opts the optional parameters
|
71
|
+
# @option opts [Date] :start_date The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on `trade_date`.
|
72
|
+
# @option opts [Date] :end_date The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`.
|
73
|
+
# @option opts [String] :type Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of assets from one account to another
|
74
|
+
# @return [Array<UniversalActivity>]
|
75
|
+
private def get_account_activities_impl(account_id, user_id, user_secret, opts = {})
|
76
|
+
data, _status_code, _headers = get_account_activities_with_http_info(account_id, user_id, user_secret, opts)
|
77
|
+
data
|
78
|
+
end
|
79
|
+
|
80
|
+
# List account activities
|
81
|
+
# Returns all historical transactions for the specified account. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request. There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order. The data returned here is always cached and refreshed once a day.
|
82
|
+
# @param account_id [String]
|
83
|
+
# @param user_id [String]
|
84
|
+
# @param user_secret [String]
|
85
|
+
# @param [Hash] opts the optional parameters
|
86
|
+
# @option opts [Date] :start_date The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on `trade_date`.
|
87
|
+
# @option opts [Date] :end_date The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`.
|
88
|
+
# @option opts [String] :type Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of assets from one account to another
|
89
|
+
# @return [Array<(Array<UniversalActivity>, Integer, Hash)>] Array<UniversalActivity> data, response status code and response headers
|
90
|
+
private def get_account_activities_with_http_info_impl(account_id, user_id, user_secret, opts = {})
|
91
|
+
if @api_client.config.debugging
|
92
|
+
@api_client.config.logger.debug 'Calling API: AccountInformationApi.get_account_activities ...'
|
93
|
+
end
|
94
|
+
# verify the required parameter 'account_id' is set
|
95
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
96
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountInformationApi.get_account_activities"
|
97
|
+
end
|
98
|
+
# verify the required parameter 'user_id' is set
|
99
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
100
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AccountInformationApi.get_account_activities"
|
101
|
+
end
|
102
|
+
# verify the required parameter 'user_secret' is set
|
103
|
+
if @api_client.config.client_side_validation && user_secret.nil?
|
104
|
+
fail ArgumentError, "Missing the required parameter 'user_secret' when calling AccountInformationApi.get_account_activities"
|
105
|
+
end
|
106
|
+
# resource path
|
107
|
+
local_var_path = '/accounts/{accountId}/activities'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
|
108
|
+
|
109
|
+
# query parameters
|
110
|
+
query_params = opts[:query_params] || {}
|
111
|
+
query_params[:'userId'] = user_id
|
112
|
+
query_params[:'userSecret'] = user_secret
|
113
|
+
query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
|
114
|
+
query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
|
115
|
+
query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
|
116
|
+
|
117
|
+
# header parameters
|
118
|
+
header_params = opts[:header_params] || {}
|
119
|
+
# HTTP header 'Accept' (if needed)
|
120
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
121
|
+
|
122
|
+
# form parameters
|
123
|
+
form_params = opts[:form_params] || {}
|
124
|
+
|
125
|
+
# http body (model)
|
126
|
+
post_body = opts[:debug_body]
|
127
|
+
|
128
|
+
# return_type
|
129
|
+
return_type = opts[:debug_return_type] || 'Array<UniversalActivity>'
|
130
|
+
|
131
|
+
# auth_names
|
132
|
+
auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
|
133
|
+
|
134
|
+
new_options = opts.merge(
|
135
|
+
:operation => :"AccountInformationApi.get_account_activities",
|
136
|
+
:header_params => header_params,
|
137
|
+
:query_params => query_params,
|
138
|
+
:form_params => form_params,
|
139
|
+
:body => post_body,
|
140
|
+
:auth_names => auth_names,
|
141
|
+
:return_type => return_type
|
142
|
+
)
|
143
|
+
|
144
|
+
data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
|
145
|
+
if @api_client.config.debugging
|
146
|
+
@api_client.config.logger.debug "API called: AccountInformationApi#get_account_activities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
147
|
+
end
|
148
|
+
return data, status_code, headers, response
|
149
|
+
end
|
150
|
+
|
151
|
+
|
20
152
|
# List all accounts for the user, plus balances, positions, and orders for each account.
|
21
153
|
#
|
22
154
|
# **Deprecated, please use the account-specific holdings endpoint instead.**
|
@@ -23,7 +23,7 @@ module SnapTrade
|
|
23
23
|
#
|
24
24
|
# There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order.
|
25
25
|
#
|
26
|
-
# The data returned here is always cached and refreshed once a day.
|
26
|
+
# The data returned here is always cached and refreshed once a day.
|
27
27
|
#
|
28
28
|
# @param user_id [String]
|
29
29
|
# @param user_secret [String]
|
@@ -49,7 +49,7 @@ module SnapTrade
|
|
49
49
|
#
|
50
50
|
# There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order.
|
51
51
|
#
|
52
|
-
# The data returned here is always cached and refreshed once a day.
|
52
|
+
# The data returned here is always cached and refreshed once a day.
|
53
53
|
#
|
54
54
|
# @param user_id [String]
|
55
55
|
# @param user_secret [String]
|
@@ -69,7 +69,7 @@ module SnapTrade
|
|
69
69
|
end
|
70
70
|
|
71
71
|
# Get transaction history for a user
|
72
|
-
# Returns all historical transactions for the specified user and filtering criteria. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request. There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order. The data returned here is always cached and refreshed once a day.
|
72
|
+
# Returns all historical transactions for the specified user and filtering criteria. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request. There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order. The data returned here is always cached and refreshed once a day.
|
73
73
|
# @param user_id [String]
|
74
74
|
# @param user_secret [String]
|
75
75
|
# @param [Hash] opts the optional parameters
|
@@ -85,7 +85,7 @@ module SnapTrade
|
|
85
85
|
end
|
86
86
|
|
87
87
|
# Get transaction history for a user
|
88
|
-
# Returns all historical transactions for the specified user and filtering criteria. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request. There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order. The data returned here is always cached and refreshed once a day.
|
88
|
+
# Returns all historical transactions for the specified user and filtering criteria. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request. There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order. The data returned here is always cached and refreshed once a day.
|
89
89
|
# @param user_id [String]
|
90
90
|
# @param user_secret [String]
|
91
91
|
# @param [Hash] opts the optional parameters
|
data/lib/snaptrade/version.rb
CHANGED
@@ -27,6 +27,23 @@ describe 'AccountInformationApi' do
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
+
# unit tests for get_account_activities
|
31
|
+
# List account activities
|
32
|
+
# Returns all historical transactions for the specified account. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request. There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order. The data returned here is always cached and refreshed once a day.
|
33
|
+
# @param account_id
|
34
|
+
# @param user_id
|
35
|
+
# @param user_secret
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @option opts [Date] :start_date The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on `trade_date`.
|
38
|
+
# @option opts [Date] :end_date The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`.
|
39
|
+
# @option opts [String] :type Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - Transfer of assets from one account to another
|
40
|
+
# @return [Array<UniversalActivity>]
|
41
|
+
describe 'get_account_activities test' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
30
47
|
# unit tests for get_all_user_holdings
|
31
48
|
# List all accounts for the user, plus balances, positions, and orders for each account.
|
32
49
|
# **Deprecated, please use the account-specific holdings endpoint instead.** List all accounts for the user, plus balances, positions, and orders for each account.
|
@@ -29,7 +29,7 @@ describe 'TransactionsAndReportingApi' do
|
|
29
29
|
|
30
30
|
# unit tests for get_activities
|
31
31
|
# Get transaction history for a user
|
32
|
-
# Returns all historical transactions for the specified user and filtering criteria. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request. There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order. The data returned here is always cached and refreshed once a day.
|
32
|
+
# Returns all historical transactions for the specified user and filtering criteria. It's recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There's a max number of 10000 transactions returned per request. There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order. The data returned here is always cached and refreshed once a day.
|
33
33
|
# @param user_id
|
34
34
|
# @param user_secret
|
35
35
|
# @param [Hash] opts the optional parameters
|
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.71
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SnapTrade
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|