snaptrade 2.0.158 → 2.0.159
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +49 -2
- data/lib/snaptrade/api/experimental_endpoints_api.rb +138 -0
- data/lib/snaptrade/version.rb +1 -1
- data/spec/api/experimental_endpoints_api_spec.rb +15 -0
- 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: 1fa83bbe1d67bcd1156377fbb945969cae929351a7a62071d2a984b8d8e92b1c
|
|
4
|
+
data.tar.gz: '08ec226e7f82a264662215fe06a4801f5aa21967f38adad0baaa851cb73e94a3'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 04e30804f136b31435b4ccc4d40311212c6f893eb5c693477010f99759d810f5d4bac3e9ba0924b341d5372cdb1a042ad21f2b00fef9ccbcd92b5fe247ad3e92
|
|
7
|
+
data.tar.gz: 51b23e6298dd0a2b50a96e26c39f477a26032064ef10abe3b7b4d04dfcd9f67229184c761045ed9842feca14c3fecee05c155081847c3eaf902586de52aa6fe5
|
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.159)
|
|
5
5
|
faraday (>= 1.0.1, < 3.0)
|
|
6
6
|
faraday-multipart (~> 1.0, >= 1.0.4)
|
|
7
7
|
|
|
@@ -58,7 +58,7 @@ GEM
|
|
|
58
58
|
rspec-mocks (3.13.7)
|
|
59
59
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
60
60
|
rspec-support (~> 3.13.0)
|
|
61
|
-
rspec-support (3.13.
|
|
61
|
+
rspec-support (3.13.7)
|
|
62
62
|
rubocop (1.12.1)
|
|
63
63
|
parallel (~> 1.10)
|
|
64
64
|
parser (>= 3.0.0.0)
|
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.159)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -44,6 +44,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
44
44
|
* [`snaptrade.connections.remove_brokerage_authorization`](#snaptradeconnectionsremove_brokerage_authorization)
|
|
45
45
|
* [`snaptrade.connections.return_rates`](#snaptradeconnectionsreturn_rates)
|
|
46
46
|
* [`snaptrade.connections.session_events`](#snaptradeconnectionssession_events)
|
|
47
|
+
* [`snaptrade.experimental_endpoints.get_user_account_order_detail_v2`](#snaptradeexperimental_endpointsget_user_account_order_detail_v2)
|
|
47
48
|
* [`snaptrade.experimental_endpoints.get_user_account_orders_v2`](#snaptradeexperimental_endpointsget_user_account_orders_v2)
|
|
48
49
|
* [`snaptrade.experimental_endpoints.get_user_account_recent_orders_v2`](#snaptradeexperimental_endpointsget_user_account_recent_orders_v2)
|
|
49
50
|
* [`snaptrade.options.get_options_chain`](#snaptradeoptionsget_options_chain)
|
|
@@ -83,7 +84,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
83
84
|
Add to Gemfile:
|
|
84
85
|
|
|
85
86
|
```ruby
|
|
86
|
-
gem 'snaptrade', '~> 2.0.
|
|
87
|
+
gem 'snaptrade', '~> 2.0.159'
|
|
87
88
|
```
|
|
88
89
|
|
|
89
90
|
## Getting Started<a id="getting-started"></a>
|
|
@@ -1128,6 +1129,52 @@ specific users
|
|
|
1128
1129
|
---
|
|
1129
1130
|
|
|
1130
1131
|
|
|
1132
|
+
### `snaptrade.experimental_endpoints.get_user_account_order_detail_v2`<a id="snaptradeexperimental_endpointsget_user_account_order_detail_v2"></a>
|
|
1133
|
+
|
|
1134
|
+
Returns the detail of a single order using the external order ID provided in the request body.
|
|
1135
|
+
|
|
1136
|
+
The V2 order response format includes all legs of the order in the `legs` list field.
|
|
1137
|
+
If the order is single legged, `legs` will be a list of one leg.
|
|
1138
|
+
|
|
1139
|
+
This endpoint is always realtime and does not rely on cached data.
|
|
1140
|
+
|
|
1141
|
+
This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
1142
|
+
|
|
1143
|
+
|
|
1144
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1145
|
+
|
|
1146
|
+
```ruby
|
|
1147
|
+
result = snaptrade.experimental_endpoints.get_user_account_order_detail_v2(
|
|
1148
|
+
brokerage_order_id: "66a033fa-da74-4fcf-b527-feefdec9257e",
|
|
1149
|
+
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1150
|
+
user_id: "snaptrade-user-123",
|
|
1151
|
+
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1152
|
+
)
|
|
1153
|
+
p result
|
|
1154
|
+
```
|
|
1155
|
+
|
|
1156
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1157
|
+
|
|
1158
|
+
##### brokerage_order_id: `String`<a id="brokerage_order_id-string"></a>
|
|
1159
|
+
Order ID returned by brokerage. This is the unique identifier for the order in
|
|
1160
|
+
the brokerage system.
|
|
1161
|
+
|
|
1162
|
+
##### account_id: `String`<a id="account_id-string"></a>
|
|
1163
|
+
##### user_id: `String`<a id="user_id-string"></a>
|
|
1164
|
+
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
1165
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
1166
|
+
|
|
1167
|
+
[AccountOrderRecordV2](./lib/snaptrade/models/account_order_record_v2.rb)
|
|
1168
|
+
|
|
1169
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1170
|
+
|
|
1171
|
+
`/accounts/{accountId}/orders/details/v2` `POST`
|
|
1172
|
+
|
|
1173
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1174
|
+
|
|
1175
|
+
---
|
|
1176
|
+
|
|
1177
|
+
|
|
1131
1178
|
### `snaptrade.experimental_endpoints.get_user_account_orders_v2`<a id="snaptradeexperimental_endpointsget_user_account_orders_v2"></a>
|
|
1132
1179
|
|
|
1133
1180
|
Returns a list of recent orders in the specified account.
|
|
@@ -17,6 +17,144 @@ module SnapTrade
|
|
|
17
17
|
@api_client = api_client
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
+
# Get account order detail (V2)
|
|
21
|
+
#
|
|
22
|
+
# Returns the detail of a single order using the external order ID provided in the request body.
|
|
23
|
+
#
|
|
24
|
+
# The V2 order response format includes all legs of the order in the `legs` list field.
|
|
25
|
+
# If the order is single legged, `legs` will be a list of one leg.
|
|
26
|
+
#
|
|
27
|
+
# This endpoint is always realtime and does not rely on cached data.
|
|
28
|
+
#
|
|
29
|
+
# This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
30
|
+
#
|
|
31
|
+
# @param brokerage_order_id [String] Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
|
|
32
|
+
# @param account_id [String]
|
|
33
|
+
# @param user_id [String]
|
|
34
|
+
# @param user_secret [String]
|
|
35
|
+
# @param body [AccountInformationGetUserAccountOrderDetailRequest]
|
|
36
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
37
|
+
def get_user_account_order_detail_v2(brokerage_order_id:, account_id:, user_id:, user_secret:, extra: {})
|
|
38
|
+
_body = {}
|
|
39
|
+
_body[:brokerage_order_id] = brokerage_order_id if brokerage_order_id != SENTINEL
|
|
40
|
+
account_information_get_user_account_order_detail_request = _body
|
|
41
|
+
data, _status_code, _headers = get_user_account_order_detail_v2_with_http_info_impl(account_id, user_id, user_secret, account_information_get_user_account_order_detail_request, extra)
|
|
42
|
+
data
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Get account order detail (V2)
|
|
46
|
+
#
|
|
47
|
+
# Returns the detail of a single order using the external order ID provided in the request body.
|
|
48
|
+
#
|
|
49
|
+
# The V2 order response format includes all legs of the order in the `legs` list field.
|
|
50
|
+
# If the order is single legged, `legs` will be a list of one leg.
|
|
51
|
+
#
|
|
52
|
+
# This endpoint is always realtime and does not rely on cached data.
|
|
53
|
+
#
|
|
54
|
+
# This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
55
|
+
#
|
|
56
|
+
# @param brokerage_order_id [String] Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
|
|
57
|
+
# @param account_id [String]
|
|
58
|
+
# @param user_id [String]
|
|
59
|
+
# @param user_secret [String]
|
|
60
|
+
# @param body [AccountInformationGetUserAccountOrderDetailRequest]
|
|
61
|
+
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
62
|
+
def get_user_account_order_detail_v2_with_http_info(brokerage_order_id:, account_id:, user_id:, user_secret:, extra: {})
|
|
63
|
+
_body = {}
|
|
64
|
+
_body[:brokerage_order_id] = brokerage_order_id if brokerage_order_id != SENTINEL
|
|
65
|
+
account_information_get_user_account_order_detail_request = _body
|
|
66
|
+
get_user_account_order_detail_v2_with_http_info_impl(account_id, user_id, user_secret, account_information_get_user_account_order_detail_request, extra)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Get account order detail (V2)
|
|
70
|
+
# Returns the detail of a single order using the external order ID provided in the request body. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
71
|
+
# @param account_id [String]
|
|
72
|
+
# @param user_id [String]
|
|
73
|
+
# @param user_secret [String]
|
|
74
|
+
# @param account_information_get_user_account_order_detail_request [AccountInformationGetUserAccountOrderDetailRequest]
|
|
75
|
+
# @param [Hash] opts the optional parameters
|
|
76
|
+
# @return [AccountOrderRecordV2]
|
|
77
|
+
private def get_user_account_order_detail_v2_impl(account_id, user_id, user_secret, account_information_get_user_account_order_detail_request, opts = {})
|
|
78
|
+
data, _status_code, _headers = get_user_account_order_detail_v2_with_http_info(account_id, user_id, user_secret, account_information_get_user_account_order_detail_request, opts)
|
|
79
|
+
data
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Get account order detail (V2)
|
|
83
|
+
# Returns the detail of a single order using the external order ID provided in the request body. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
84
|
+
# @param account_id [String]
|
|
85
|
+
# @param user_id [String]
|
|
86
|
+
# @param user_secret [String]
|
|
87
|
+
# @param account_information_get_user_account_order_detail_request [AccountInformationGetUserAccountOrderDetailRequest]
|
|
88
|
+
# @param [Hash] opts the optional parameters
|
|
89
|
+
# @return [Array<(AccountOrderRecordV2, Integer, Hash)>] AccountOrderRecordV2 data, response status code and response headers
|
|
90
|
+
private def get_user_account_order_detail_v2_with_http_info_impl(account_id, user_id, user_secret, account_information_get_user_account_order_detail_request, opts = {})
|
|
91
|
+
if @api_client.config.debugging
|
|
92
|
+
@api_client.config.logger.debug 'Calling API: ExperimentalEndpointsApi.get_user_account_order_detail_v2 ...'
|
|
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 ExperimentalEndpointsApi.get_user_account_order_detail_v2"
|
|
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 ExperimentalEndpointsApi.get_user_account_order_detail_v2"
|
|
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 ExperimentalEndpointsApi.get_user_account_order_detail_v2"
|
|
105
|
+
end
|
|
106
|
+
# verify the required parameter 'account_information_get_user_account_order_detail_request' is set
|
|
107
|
+
if @api_client.config.client_side_validation && account_information_get_user_account_order_detail_request.nil?
|
|
108
|
+
fail ArgumentError, "Missing the required parameter 'account_information_get_user_account_order_detail_request' when calling ExperimentalEndpointsApi.get_user_account_order_detail_v2"
|
|
109
|
+
end
|
|
110
|
+
# resource path
|
|
111
|
+
local_var_path = '/accounts/{accountId}/orders/details/v2'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
|
|
112
|
+
|
|
113
|
+
# query parameters
|
|
114
|
+
query_params = opts[:query_params] || {}
|
|
115
|
+
query_params[:'userId'] = user_id
|
|
116
|
+
query_params[:'userSecret'] = user_secret
|
|
117
|
+
|
|
118
|
+
# header parameters
|
|
119
|
+
header_params = opts[:header_params] || {}
|
|
120
|
+
# HTTP header 'Accept' (if needed)
|
|
121
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
122
|
+
# HTTP header 'Content-Type'
|
|
123
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
124
|
+
if !content_type.nil?
|
|
125
|
+
header_params['Content-Type'] = content_type
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# form parameters
|
|
129
|
+
form_params = opts[:form_params] || {}
|
|
130
|
+
|
|
131
|
+
# http body (model)
|
|
132
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(account_information_get_user_account_order_detail_request)
|
|
133
|
+
|
|
134
|
+
# return_type
|
|
135
|
+
return_type = opts[:debug_return_type] || 'AccountOrderRecordV2'
|
|
136
|
+
|
|
137
|
+
# auth_names
|
|
138
|
+
auth_names = opts[:debug_auth_names] || ['PartnerClientId', 'PartnerSignature', 'PartnerTimestamp']
|
|
139
|
+
|
|
140
|
+
new_options = opts.merge(
|
|
141
|
+
:operation => :"ExperimentalEndpointsApi.get_user_account_order_detail_v2",
|
|
142
|
+
:header_params => header_params,
|
|
143
|
+
:query_params => query_params,
|
|
144
|
+
:form_params => form_params,
|
|
145
|
+
:body => post_body,
|
|
146
|
+
:auth_names => auth_names,
|
|
147
|
+
:return_type => return_type
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
data, status_code, headers, response = @api_client.call_api(:POST, local_var_path, new_options)
|
|
151
|
+
if @api_client.config.debugging
|
|
152
|
+
@api_client.config.logger.debug "API called: ExperimentalEndpointsApi#get_user_account_order_detail_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
153
|
+
end
|
|
154
|
+
return data, status_code, headers, response
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
|
|
20
158
|
# List account orders v2
|
|
21
159
|
#
|
|
22
160
|
# Returns a list of recent orders in the specified account.
|
data/lib/snaptrade/version.rb
CHANGED
|
@@ -27,6 +27,21 @@ describe 'ExperimentalEndpointsApi' do
|
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
+
# unit tests for get_user_account_order_detail_v2
|
|
31
|
+
# Get account order detail (V2)
|
|
32
|
+
# Returns the detail of a single order using the external order ID provided in the request body. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
33
|
+
# @param account_id
|
|
34
|
+
# @param user_id
|
|
35
|
+
# @param user_secret
|
|
36
|
+
# @param account_information_get_user_account_order_detail_request
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @return [AccountOrderRecordV2]
|
|
39
|
+
describe 'get_user_account_order_detail_v2 test' do
|
|
40
|
+
it 'should work' do
|
|
41
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
30
45
|
# unit tests for get_user_account_orders_v2
|
|
31
46
|
# List account orders v2
|
|
32
47
|
# Returns a list of recent orders in the specified account. The V2 order response format will include all legs of each order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
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.159
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- SnapTrade
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-02-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|