snaptrade 2.0.159 → 2.0.161
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 +1 -1
- data/README.md +8 -11
- data/lib/snaptrade/api/account_information_api.rb +6 -6
- data/lib/snaptrade/api/experimental_endpoints_api.rb +22 -35
- data/lib/snaptrade/version.rb +1 -1
- data/spec/api/account_information_api_spec.rb +1 -1
- data/spec/api/experimental_endpoints_api_spec.rb +2 -2
- 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: cff757123d9aa13d82660e1f9a83796b057c847966a741d7379bfd15853cdb83
|
|
4
|
+
data.tar.gz: c695a68f78e095c6a3914a9ee8d1fd966f5ebe74893ab046be3be0585d2824a7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5a1f93f3f4c0d2ce32547538fab648f1e004780f06311c1a24182a3b31d08aeb27f030f737a26799153d364d9c31a854983641fc9b406ff1a504edc55ca8316a
|
|
7
|
+
data.tar.gz: af48d20033afb2dde33ca48c7ca46e74d5c652125bd91d23f78b54ff6723c9b00f7bec88e364f8bb057ac3dfdcf1e54fe52ad4acfd7d25efc19910ecbc604eee
|
data/Gemfile.lock
CHANGED
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.161)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -84,7 +84,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
84
84
|
Add to Gemfile:
|
|
85
85
|
|
|
86
86
|
```ruby
|
|
87
|
-
gem 'snaptrade', '~> 2.0.
|
|
87
|
+
gem 'snaptrade', '~> 2.0.161'
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
## Getting Started<a id="getting-started"></a>
|
|
@@ -468,9 +468,9 @@ p result
|
|
|
468
468
|
|
|
469
469
|
### `snaptrade.account_information.get_user_account_recent_orders`<a id="snaptradeaccount_informationget_user_account_recent_orders"></a>
|
|
470
470
|
|
|
471
|
-
A lightweight endpoint that returns
|
|
471
|
+
A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders.
|
|
472
472
|
This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders
|
|
473
|
-
Differs from /orders in that it is realtime, and only checks the last 24 hours
|
|
473
|
+
Differs from /orders in that it is always realtime, and only checks the last 24 hours
|
|
474
474
|
By default only returns executed orders, but that can be changed by setting *only_executed* to false
|
|
475
475
|
|
|
476
476
|
|
|
@@ -1131,7 +1131,7 @@ specific users
|
|
|
1131
1131
|
|
|
1132
1132
|
### `snaptrade.experimental_endpoints.get_user_account_order_detail_v2`<a id="snaptradeexperimental_endpointsget_user_account_order_detail_v2"></a>
|
|
1133
1133
|
|
|
1134
|
-
Returns the detail of a single order using the
|
|
1134
|
+
Returns the detail of a single order using the brokerage order ID provided as a path parameter.
|
|
1135
1135
|
|
|
1136
1136
|
The V2 order response format includes all legs of the order in the `legs` list field.
|
|
1137
1137
|
If the order is single legged, `legs` will be a list of one leg.
|
|
@@ -1145,8 +1145,8 @@ This endpoint only returns orders placed through SnapTrade. In other words, orde
|
|
|
1145
1145
|
|
|
1146
1146
|
```ruby
|
|
1147
1147
|
result = snaptrade.experimental_endpoints.get_user_account_order_detail_v2(
|
|
1148
|
-
brokerage_order_id: "66a033fa-da74-4fcf-b527-feefdec9257e",
|
|
1149
1148
|
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1149
|
+
brokerage_order_id: "66a033fa-da74-4fcf-b527-feefdec9257e",
|
|
1150
1150
|
user_id: "snaptrade-user-123",
|
|
1151
1151
|
user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1152
1152
|
)
|
|
@@ -1155,11 +1155,8 @@ p result
|
|
|
1155
1155
|
|
|
1156
1156
|
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1157
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
1158
|
##### account_id: `String`<a id="account_id-string"></a>
|
|
1159
|
+
##### brokerage_order_id: `String`<a id="brokerage_order_id-string"></a>
|
|
1163
1160
|
##### user_id: `String`<a id="user_id-string"></a>
|
|
1164
1161
|
##### user_secret: `String`<a id="user_secret-string"></a>
|
|
1165
1162
|
#### 🔄 Return<a id="🔄-return"></a>
|
|
@@ -1168,7 +1165,7 @@ the brokerage system.
|
|
|
1168
1165
|
|
|
1169
1166
|
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1170
1167
|
|
|
1171
|
-
`/accounts/{accountId}/orders/details/v2` `
|
|
1168
|
+
`/accounts/{accountId}/orders/details/v2/{brokerageOrderId}` `GET`
|
|
1172
1169
|
|
|
1173
1170
|
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1174
1171
|
|
|
@@ -907,9 +907,9 @@ module SnapTrade
|
|
|
907
907
|
|
|
908
908
|
# List account recent orders (last 24 hours only)
|
|
909
909
|
#
|
|
910
|
-
# A lightweight endpoint that returns
|
|
910
|
+
# A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders.
|
|
911
911
|
# This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders
|
|
912
|
-
# Differs from /orders in that it is realtime, and only checks the last 24 hours
|
|
912
|
+
# Differs from /orders in that it is always realtime, and only checks the last 24 hours
|
|
913
913
|
# By default only returns executed orders, but that can be changed by setting *only_executed* to false
|
|
914
914
|
#
|
|
915
915
|
# @param user_id [String]
|
|
@@ -925,9 +925,9 @@ module SnapTrade
|
|
|
925
925
|
|
|
926
926
|
# List account recent orders (last 24 hours only)
|
|
927
927
|
#
|
|
928
|
-
# A lightweight endpoint that returns
|
|
928
|
+
# A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders.
|
|
929
929
|
# This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders
|
|
930
|
-
# Differs from /orders in that it is realtime, and only checks the last 24 hours
|
|
930
|
+
# Differs from /orders in that it is always realtime, and only checks the last 24 hours
|
|
931
931
|
# By default only returns executed orders, but that can be changed by setting *only_executed* to false
|
|
932
932
|
#
|
|
933
933
|
# @param user_id [String]
|
|
@@ -941,7 +941,7 @@ module SnapTrade
|
|
|
941
941
|
end
|
|
942
942
|
|
|
943
943
|
# List account recent orders (last 24 hours only)
|
|
944
|
-
# A lightweight endpoint that returns
|
|
944
|
+
# A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders Differs from /orders in that it is always realtime, and only checks the last 24 hours By default only returns executed orders, but that can be changed by setting *only_executed* to false
|
|
945
945
|
# @param user_id [String]
|
|
946
946
|
# @param user_secret [String]
|
|
947
947
|
# @param account_id [String]
|
|
@@ -954,7 +954,7 @@ module SnapTrade
|
|
|
954
954
|
end
|
|
955
955
|
|
|
956
956
|
# List account recent orders (last 24 hours only)
|
|
957
|
-
# A lightweight endpoint that returns
|
|
957
|
+
# A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders Differs from /orders in that it is always realtime, and only checks the last 24 hours By default only returns executed orders, but that can be changed by setting *only_executed* to false
|
|
958
958
|
# @param user_id [String]
|
|
959
959
|
# @param user_secret [String]
|
|
960
960
|
# @param account_id [String]
|
|
@@ -19,7 +19,7 @@ module SnapTrade
|
|
|
19
19
|
|
|
20
20
|
# Get account order detail (V2)
|
|
21
21
|
#
|
|
22
|
-
# Returns the detail of a single order using the
|
|
22
|
+
# Returns the detail of a single order using the brokerage order ID provided as a path parameter.
|
|
23
23
|
#
|
|
24
24
|
# The V2 order response format includes all legs of the order in the `legs` list field.
|
|
25
25
|
# If the order is single legged, `legs` will be a list of one leg.
|
|
@@ -28,23 +28,19 @@ module SnapTrade
|
|
|
28
28
|
#
|
|
29
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
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
31
|
# @param account_id [String]
|
|
32
|
+
# @param brokerage_order_id [String]
|
|
33
33
|
# @param user_id [String]
|
|
34
34
|
# @param user_secret [String]
|
|
35
|
-
# @param body [AccountInformationGetUserAccountOrderDetailRequest]
|
|
36
35
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
|
37
|
-
def get_user_account_order_detail_v2(
|
|
38
|
-
|
|
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)
|
|
36
|
+
def get_user_account_order_detail_v2(account_id:, brokerage_order_id:, user_id:, user_secret:, extra: {})
|
|
37
|
+
data, _status_code, _headers = get_user_account_order_detail_v2_with_http_info_impl(account_id, brokerage_order_id, user_id, user_secret, extra)
|
|
42
38
|
data
|
|
43
39
|
end
|
|
44
40
|
|
|
45
41
|
# Get account order detail (V2)
|
|
46
42
|
#
|
|
47
|
-
# Returns the detail of a single order using the
|
|
43
|
+
# Returns the detail of a single order using the brokerage order ID provided as a path parameter.
|
|
48
44
|
#
|
|
49
45
|
# The V2 order response format includes all legs of the order in the `legs` list field.
|
|
50
46
|
# If the order is single legged, `legs` will be a list of one leg.
|
|
@@ -53,41 +49,37 @@ module SnapTrade
|
|
|
53
49
|
#
|
|
54
50
|
# 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
51
|
#
|
|
56
|
-
# @param brokerage_order_id [String] Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.
|
|
57
52
|
# @param account_id [String]
|
|
53
|
+
# @param brokerage_order_id [String]
|
|
58
54
|
# @param user_id [String]
|
|
59
55
|
# @param user_secret [String]
|
|
60
|
-
# @param body [AccountInformationGetUserAccountOrderDetailRequest]
|
|
61
56
|
# @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(
|
|
63
|
-
|
|
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)
|
|
57
|
+
def get_user_account_order_detail_v2_with_http_info(account_id:, brokerage_order_id:, user_id:, user_secret:, extra: {})
|
|
58
|
+
get_user_account_order_detail_v2_with_http_info_impl(account_id, brokerage_order_id, user_id, user_secret, extra)
|
|
67
59
|
end
|
|
68
60
|
|
|
69
61
|
# Get account order detail (V2)
|
|
70
|
-
# Returns the detail of a single order using the
|
|
62
|
+
# Returns the detail of a single order using the brokerage order ID provided as a path parameter. 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
63
|
# @param account_id [String]
|
|
64
|
+
# @param brokerage_order_id [String]
|
|
72
65
|
# @param user_id [String]
|
|
73
66
|
# @param user_secret [String]
|
|
74
|
-
# @param account_information_get_user_account_order_detail_request [AccountInformationGetUserAccountOrderDetailRequest]
|
|
75
67
|
# @param [Hash] opts the optional parameters
|
|
76
68
|
# @return [AccountOrderRecordV2]
|
|
77
|
-
private def get_user_account_order_detail_v2_impl(account_id, user_id, user_secret,
|
|
78
|
-
data, _status_code, _headers = get_user_account_order_detail_v2_with_http_info(account_id, user_id, user_secret,
|
|
69
|
+
private def get_user_account_order_detail_v2_impl(account_id, brokerage_order_id, user_id, user_secret, opts = {})
|
|
70
|
+
data, _status_code, _headers = get_user_account_order_detail_v2_with_http_info(account_id, brokerage_order_id, user_id, user_secret, opts)
|
|
79
71
|
data
|
|
80
72
|
end
|
|
81
73
|
|
|
82
74
|
# Get account order detail (V2)
|
|
83
|
-
# Returns the detail of a single order using the
|
|
75
|
+
# Returns the detail of a single order using the brokerage order ID provided as a path parameter. 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
76
|
# @param account_id [String]
|
|
77
|
+
# @param brokerage_order_id [String]
|
|
85
78
|
# @param user_id [String]
|
|
86
79
|
# @param user_secret [String]
|
|
87
|
-
# @param account_information_get_user_account_order_detail_request [AccountInformationGetUserAccountOrderDetailRequest]
|
|
88
80
|
# @param [Hash] opts the optional parameters
|
|
89
81
|
# @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,
|
|
82
|
+
private def get_user_account_order_detail_v2_with_http_info_impl(account_id, brokerage_order_id, user_id, user_secret, opts = {})
|
|
91
83
|
if @api_client.config.debugging
|
|
92
84
|
@api_client.config.logger.debug 'Calling API: ExperimentalEndpointsApi.get_user_account_order_detail_v2 ...'
|
|
93
85
|
end
|
|
@@ -95,6 +87,10 @@ module SnapTrade
|
|
|
95
87
|
if @api_client.config.client_side_validation && account_id.nil?
|
|
96
88
|
fail ArgumentError, "Missing the required parameter 'account_id' when calling ExperimentalEndpointsApi.get_user_account_order_detail_v2"
|
|
97
89
|
end
|
|
90
|
+
# verify the required parameter 'brokerage_order_id' is set
|
|
91
|
+
if @api_client.config.client_side_validation && brokerage_order_id.nil?
|
|
92
|
+
fail ArgumentError, "Missing the required parameter 'brokerage_order_id' when calling ExperimentalEndpointsApi.get_user_account_order_detail_v2"
|
|
93
|
+
end
|
|
98
94
|
# verify the required parameter 'user_id' is set
|
|
99
95
|
if @api_client.config.client_side_validation && user_id.nil?
|
|
100
96
|
fail ArgumentError, "Missing the required parameter 'user_id' when calling ExperimentalEndpointsApi.get_user_account_order_detail_v2"
|
|
@@ -103,12 +99,8 @@ module SnapTrade
|
|
|
103
99
|
if @api_client.config.client_side_validation && user_secret.nil?
|
|
104
100
|
fail ArgumentError, "Missing the required parameter 'user_secret' when calling ExperimentalEndpointsApi.get_user_account_order_detail_v2"
|
|
105
101
|
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
102
|
# resource path
|
|
111
|
-
local_var_path = '/accounts/{accountId}/orders/details/v2'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s))
|
|
103
|
+
local_var_path = '/accounts/{accountId}/orders/details/v2/{brokerageOrderId}'.sub('{' + 'accountId' + '}', CGI.escape(account_id.to_s)).sub('{' + 'brokerageOrderId' + '}', CGI.escape(brokerage_order_id.to_s))
|
|
112
104
|
|
|
113
105
|
# query parameters
|
|
114
106
|
query_params = opts[:query_params] || {}
|
|
@@ -119,17 +111,12 @@ module SnapTrade
|
|
|
119
111
|
header_params = opts[:header_params] || {}
|
|
120
112
|
# HTTP header 'Accept' (if needed)
|
|
121
113
|
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
114
|
|
|
128
115
|
# form parameters
|
|
129
116
|
form_params = opts[:form_params] || {}
|
|
130
117
|
|
|
131
118
|
# http body (model)
|
|
132
|
-
post_body = opts[:debug_body]
|
|
119
|
+
post_body = opts[:debug_body]
|
|
133
120
|
|
|
134
121
|
# return_type
|
|
135
122
|
return_type = opts[:debug_return_type] || 'AccountOrderRecordV2'
|
|
@@ -147,7 +134,7 @@ module SnapTrade
|
|
|
147
134
|
:return_type => return_type
|
|
148
135
|
)
|
|
149
136
|
|
|
150
|
-
data, status_code, headers, response = @api_client.call_api(:
|
|
137
|
+
data, status_code, headers, response = @api_client.call_api(:GET, local_var_path, new_options)
|
|
151
138
|
if @api_client.config.debugging
|
|
152
139
|
@api_client.config.logger.debug "API called: ExperimentalEndpointsApi#get_user_account_order_detail_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
153
140
|
end
|
data/lib/snaptrade/version.rb
CHANGED
|
@@ -135,7 +135,7 @@ describe 'AccountInformationApi' do
|
|
|
135
135
|
|
|
136
136
|
# unit tests for get_user_account_recent_orders
|
|
137
137
|
# List account recent orders (last 24 hours only)
|
|
138
|
-
# A lightweight endpoint that returns
|
|
138
|
+
# A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders Differs from /orders in that it is always realtime, and only checks the last 24 hours By default only returns executed orders, but that can be changed by setting *only_executed* to false
|
|
139
139
|
# @param user_id
|
|
140
140
|
# @param user_secret
|
|
141
141
|
# @param account_id
|
|
@@ -29,11 +29,11 @@ describe 'ExperimentalEndpointsApi' do
|
|
|
29
29
|
|
|
30
30
|
# unit tests for get_user_account_order_detail_v2
|
|
31
31
|
# Get account order detail (V2)
|
|
32
|
-
# Returns the detail of a single order using the
|
|
32
|
+
# Returns the detail of a single order using the brokerage order ID provided as a path parameter. 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
33
|
# @param account_id
|
|
34
|
+
# @param brokerage_order_id
|
|
34
35
|
# @param user_id
|
|
35
36
|
# @param user_secret
|
|
36
|
-
# @param account_information_get_user_account_order_detail_request
|
|
37
37
|
# @param [Hash] opts the optional parameters
|
|
38
38
|
# @return [AccountOrderRecordV2]
|
|
39
39
|
describe 'get_user_account_order_detail_v2 test' do
|
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.161
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- SnapTrade
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-02-
|
|
11
|
+
date: 2026-02-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|