snaptrade 2.0.104 → 2.0.105
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 +4 -2
- data/lib/snaptrade/api/trading_api.rb +6 -2
- data/lib/snaptrade/models/mleg_trade_form.rb +11 -1
- data/lib/snaptrade/version.rb +1 -1
- data/spec/models/mleg_trade_form_spec.rb +6 -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: 709ced67e4adad4ebaf3209d1f7ce593d4017b52d17c8cd2778ee9b4f34250aa
|
4
|
+
data.tar.gz: e34de10a02a27e658477d17e18a78314cbe1977a690f4b3b65ca627aa6106922
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f31b8253882883ef36d801441882be39af34053a42256b6979b11e1da4356bb2ff746de3264a59ae6c027eaaa067b517e9f73af9d48c38893265ae49384351b8
|
7
|
+
data.tar.gz: 1ba29a4875743bfd989276f3ec0067e6c123fbf310470adc9467beebcf29fe655235002d8aa102c49ee7c2be21a5025e0a30fafca052a0fd443304e4767d52d4
|
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.105)
|
5
5
|
faraday (>= 1.0.1, < 3.0)
|
6
6
|
faraday-multipart (~> 1.0, >= 1.0.4)
|
7
7
|
|
@@ -68,7 +68,7 @@ GEM
|
|
68
68
|
rubocop-ast (>= 1.2.0, < 2.0)
|
69
69
|
ruby-progressbar (~> 1.7)
|
70
70
|
unicode-display_width (>= 1.4.0, < 3.0)
|
71
|
-
rubocop-ast (1.
|
71
|
+
rubocop-ast (1.45.0)
|
72
72
|
parser (>= 3.3.7.2)
|
73
73
|
prism (~> 1.4)
|
74
74
|
ruby-progressbar (1.13.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.105)
|
10
10
|
[](https://snaptrade.com/)
|
11
11
|
|
12
12
|
</div>
|
@@ -82,7 +82,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
82
82
|
Add to Gemfile:
|
83
83
|
|
84
84
|
```ruby
|
85
|
-
gem 'snaptrade', '~> 2.0.
|
85
|
+
gem 'snaptrade', '~> 2.0.105'
|
86
86
|
```
|
87
87
|
|
88
88
|
## Getting Started<a id="getting-started"></a>
|
@@ -2021,6 +2021,7 @@ result = snaptrade.trading.place_mleg_order(
|
|
2021
2021
|
account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
2022
2022
|
limit_price: "",
|
2023
2023
|
stop_price: "",
|
2024
|
+
price_effect: "DEBIT",
|
2024
2025
|
)
|
2025
2026
|
p result
|
2026
2027
|
```
|
@@ -2050,6 +2051,7 @@ The limit price. Required if the order type is LIMIT, STOP_LOSS_LIMIT.
|
|
2050
2051
|
##### stop_price: `Float`<a id="stop_price-float"></a>
|
2051
2052
|
The stop price. Required if the order type is STOP_LOSS_MARKET, STOP_LOSS_LIMIT.
|
2052
2053
|
|
2054
|
+
##### price_effect: [`String`](./lib/snaptrade/models/string.rb)<a id="price_effect-stringlibsnaptrademodelsstringrb"></a>
|
2053
2055
|
#### 🔄 Return<a id="🔄-return"></a>
|
2054
2056
|
|
2055
2057
|
[MlegOrderResponse](./lib/snaptrade/models/mleg_order_response.rb)
|
@@ -964,14 +964,16 @@ module SnapTrade
|
|
964
964
|
# @param account_id [String]
|
965
965
|
# @param limit_price [Float] The limit price. Required if the order type is LIMIT, STOP_LOSS_LIMIT.
|
966
966
|
# @param stop_price [Float] The stop price. Required if the order type is STOP_LOSS_MARKET, STOP_LOSS_LIMIT.
|
967
|
+
# @param price_effect [String]
|
967
968
|
# @param body [MlegTradeForm]
|
968
969
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
969
|
-
def place_mleg_order(order_type:, time_in_force:, legs:, user_id:, user_secret:, account_id:, limit_price: SENTINEL, stop_price: SENTINEL, extra: {})
|
970
|
+
def place_mleg_order(order_type:, time_in_force:, legs:, user_id:, user_secret:, account_id:, limit_price: SENTINEL, stop_price: SENTINEL, price_effect: SENTINEL, extra: {})
|
970
971
|
_body = {}
|
971
972
|
_body[:order_type] = order_type if order_type != SENTINEL
|
972
973
|
_body[:time_in_force] = time_in_force if time_in_force != SENTINEL
|
973
974
|
_body[:limit_price] = limit_price if limit_price != SENTINEL
|
974
975
|
_body[:stop_price] = stop_price if stop_price != SENTINEL
|
976
|
+
_body[:price_effect] = price_effect if price_effect != SENTINEL
|
975
977
|
_body[:legs] = legs if legs != SENTINEL
|
976
978
|
mleg_trade_form = _body
|
977
979
|
data, _status_code, _headers = place_mleg_order_with_http_info_impl(user_id, user_secret, account_id, mleg_trade_form, extra)
|
@@ -990,14 +992,16 @@ module SnapTrade
|
|
990
992
|
# @param account_id [String]
|
991
993
|
# @param limit_price [Float] The limit price. Required if the order type is LIMIT, STOP_LOSS_LIMIT.
|
992
994
|
# @param stop_price [Float] The stop price. Required if the order type is STOP_LOSS_MARKET, STOP_LOSS_LIMIT.
|
995
|
+
# @param price_effect [String]
|
993
996
|
# @param body [MlegTradeForm]
|
994
997
|
# @param [Hash] extra additional parameters to pass along through :header_params, :query_params, or parameter name
|
995
|
-
def place_mleg_order_with_http_info(order_type:, time_in_force:, legs:, user_id:, user_secret:, account_id:, limit_price: SENTINEL, stop_price: SENTINEL, extra: {})
|
998
|
+
def place_mleg_order_with_http_info(order_type:, time_in_force:, legs:, user_id:, user_secret:, account_id:, limit_price: SENTINEL, stop_price: SENTINEL, price_effect: SENTINEL, extra: {})
|
996
999
|
_body = {}
|
997
1000
|
_body[:order_type] = order_type if order_type != SENTINEL
|
998
1001
|
_body[:time_in_force] = time_in_force if time_in_force != SENTINEL
|
999
1002
|
_body[:limit_price] = limit_price if limit_price != SENTINEL
|
1000
1003
|
_body[:stop_price] = stop_price if stop_price != SENTINEL
|
1004
|
+
_body[:price_effect] = price_effect if price_effect != SENTINEL
|
1001
1005
|
_body[:legs] = legs if legs != SENTINEL
|
1002
1006
|
mleg_trade_form = _body
|
1003
1007
|
place_mleg_order_with_http_info_impl(user_id, user_secret, account_id, mleg_trade_form, extra)
|
@@ -25,6 +25,8 @@ module SnapTrade
|
|
25
25
|
# The stop price. Required if the order type is STOP_LOSS_MARKET, STOP_LOSS_LIMIT.
|
26
26
|
attr_accessor :stop_price
|
27
27
|
|
28
|
+
attr_accessor :price_effect
|
29
|
+
|
28
30
|
attr_accessor :legs
|
29
31
|
|
30
32
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -34,6 +36,7 @@ module SnapTrade
|
|
34
36
|
:'time_in_force' => :'time_in_force',
|
35
37
|
:'limit_price' => :'limit_price',
|
36
38
|
:'stop_price' => :'stop_price',
|
39
|
+
:'price_effect' => :'price_effect',
|
37
40
|
:'legs' => :'legs'
|
38
41
|
}
|
39
42
|
end
|
@@ -50,6 +53,7 @@ module SnapTrade
|
|
50
53
|
:'time_in_force' => :'TimeInForceStrict',
|
51
54
|
:'limit_price' => :'Float',
|
52
55
|
:'stop_price' => :'Float',
|
56
|
+
:'price_effect' => :'String',
|
53
57
|
:'legs' => :'Array<MlegLeg>'
|
54
58
|
}
|
55
59
|
end
|
@@ -59,6 +63,7 @@ module SnapTrade
|
|
59
63
|
Set.new([
|
60
64
|
:'limit_price',
|
61
65
|
:'stop_price',
|
66
|
+
:'price_effect',
|
62
67
|
])
|
63
68
|
end
|
64
69
|
|
@@ -93,6 +98,10 @@ module SnapTrade
|
|
93
98
|
self.stop_price = attributes[:'stop_price']
|
94
99
|
end
|
95
100
|
|
101
|
+
if attributes.key?(:'price_effect')
|
102
|
+
self.price_effect = attributes[:'price_effect']
|
103
|
+
end
|
104
|
+
|
96
105
|
if attributes.key?(:'legs')
|
97
106
|
if (value = attributes[:'legs']).is_a?(Array)
|
98
107
|
self.legs = value
|
@@ -137,6 +146,7 @@ module SnapTrade
|
|
137
146
|
time_in_force == o.time_in_force &&
|
138
147
|
limit_price == o.limit_price &&
|
139
148
|
stop_price == o.stop_price &&
|
149
|
+
price_effect == o.price_effect &&
|
140
150
|
legs == o.legs
|
141
151
|
end
|
142
152
|
|
@@ -149,7 +159,7 @@ module SnapTrade
|
|
149
159
|
# Calculates hash code according to all attributes.
|
150
160
|
# @return [Integer] Hash code
|
151
161
|
def hash
|
152
|
-
[order_type, time_in_force, limit_price, stop_price, legs].hash
|
162
|
+
[order_type, time_in_force, limit_price, stop_price, price_effect, legs].hash
|
153
163
|
end
|
154
164
|
|
155
165
|
# Builds the object from hash
|
data/lib/snaptrade/version.rb
CHANGED
@@ -44,6 +44,12 @@ describe SnapTrade::MlegTradeForm do
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
+
describe 'test attribute "price_effect"' do
|
48
|
+
it 'should work' do
|
49
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
47
53
|
describe 'test attribute "legs"' do
|
48
54
|
it 'should work' do
|
49
55
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
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.105
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SnapTrade
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-06-
|
11
|
+
date: 2025-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|