snaptrade 2.0.87 → 2.0.88
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 +280 -285
- data/lib/snaptrade/api/trading_api.rb +653 -0
- data/lib/snaptrade/models/cryptocurrency_pair.rb +12 -2
- data/lib/snaptrade/models/{crypto_spot_quote.rb → cryptocurrency_pair_quote.rb} +3 -3
- data/lib/snaptrade/models/{crypto_spot_order_preview.rb → simple_order_preview.rb} +5 -5
- data/lib/snaptrade/models/{crypto_spot_order_preview_estimated_fee.rb → simple_order_preview_estimated_fee.rb} +3 -3
- data/lib/snaptrade/models/{crypto_spot_order_request_body_time_in_force.rb → simple_order_request_body_time_in_force.rb} +3 -3
- data/lib/snaptrade/models/{trading_crypto_spot_place_order_request.rb → trading_place_simple_order_request.rb} +14 -14
- data/lib/snaptrade/models/{trading_crypto_spot_symbols200_response.rb → trading_search_cryptocurrency_pair_instruments200_response.rb} +3 -3
- data/lib/snaptrade/version.rb +1 -1
- data/lib/snaptrade.rb +6 -10
- data/spec/api/trading_api_spec.rb +76 -0
- data/spec/models/{crypto_spot_quote_spec.rb → cryptocurrency_pair_quote_spec.rb} +6 -6
- data/spec/models/cryptocurrency_pair_spec.rb +6 -0
- data/spec/models/{crypto_spot_order_preview_estimated_fee_spec.rb → simple_order_preview_estimated_fee_spec.rb} +6 -6
- data/spec/models/{crypto_spot_order_preview_spec.rb → simple_order_preview_spec.rb} +6 -6
- data/spec/models/simple_order_request_body_time_in_force_spec.rb +23 -0
- data/spec/models/{trading_crypto_spot_place_order_request_spec.rb → trading_place_simple_order_request_spec.rb} +7 -7
- data/spec/models/trading_search_cryptocurrency_pair_instruments200_response_spec.rb +29 -0
- metadata +20 -26
- data/lib/snaptrade/api/crypto_spot_trading_api.rb +0 -698
- data/lib/snaptrade/models/trading_crypto_spot_cancel_order_request.rb +0 -222
- data/spec/api/crypto_spot_trading_api_spec.rb +0 -107
- data/spec/models/crypto_spot_order_request_body_time_in_force_spec.rb +0 -23
- data/spec/models/trading_crypto_spot_cancel_order_request_spec.rb +0 -29
- data/spec/models/trading_crypto_spot_symbols200_response_spec.rb +0 -29
@@ -11,8 +11,11 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
# A cryptocurrency
|
14
|
+
# A cryptocurrency pair instrument.
|
15
15
|
class CryptocurrencyPair
|
16
|
+
# Cryptocurrency pair instrument instrument symbol
|
17
|
+
attr_accessor :symbol
|
18
|
+
|
16
19
|
# The base currency of a pair (e.g., \"BTC\" in BTC/USD). Either fiat or cryptocurrency symbol, for fiat use ISO-4217 codes.
|
17
20
|
attr_accessor :base
|
18
21
|
|
@@ -22,6 +25,7 @@ module SnapTrade
|
|
22
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
23
26
|
def self.attribute_map
|
24
27
|
{
|
28
|
+
:'symbol' => :'symbol',
|
25
29
|
:'base' => :'base',
|
26
30
|
:'quote' => :'quote'
|
27
31
|
}
|
@@ -35,6 +39,7 @@ module SnapTrade
|
|
35
39
|
# Attribute type mapping.
|
36
40
|
def self.openapi_types
|
37
41
|
{
|
42
|
+
:'symbol' => :'String',
|
38
43
|
:'base' => :'String',
|
39
44
|
:'quote' => :'String'
|
40
45
|
}
|
@@ -61,6 +66,10 @@ module SnapTrade
|
|
61
66
|
h[k.to_sym] = v
|
62
67
|
}
|
63
68
|
|
69
|
+
if attributes.key?(:'symbol')
|
70
|
+
self.symbol = attributes[:'symbol']
|
71
|
+
end
|
72
|
+
|
64
73
|
if attributes.key?(:'base')
|
65
74
|
self.base = attributes[:'base']
|
66
75
|
end
|
@@ -98,6 +107,7 @@ module SnapTrade
|
|
98
107
|
def ==(o)
|
99
108
|
return true if self.equal?(o)
|
100
109
|
self.class == o.class &&
|
110
|
+
symbol == o.symbol &&
|
101
111
|
base == o.base &&
|
102
112
|
quote == o.quote
|
103
113
|
end
|
@@ -111,7 +121,7 @@ module SnapTrade
|
|
111
121
|
# Calculates hash code according to all attributes.
|
112
122
|
# @return [Integer] Hash code
|
113
123
|
def hash
|
114
|
-
[base, quote].hash
|
124
|
+
[symbol, base, quote].hash
|
115
125
|
end
|
116
126
|
|
117
127
|
# Builds the object from hash
|
@@ -11,7 +11,7 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
class
|
14
|
+
class CryptocurrencyPairQuote
|
15
15
|
# The highest price a buyer is willing to pay.
|
16
16
|
attr_accessor :bid
|
17
17
|
|
@@ -59,13 +59,13 @@ module SnapTrade
|
|
59
59
|
# @param [Hash] attributes Model attributes in the form of hash
|
60
60
|
def initialize(attributes = {})
|
61
61
|
if (!attributes.is_a?(Hash))
|
62
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::
|
62
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::CryptocurrencyPairQuote` initialize method"
|
63
63
|
end
|
64
64
|
|
65
65
|
# check to see if the attribute exists and convert string to symbol for hash key
|
66
66
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
67
67
|
if (!self.class.attribute_map.key?(k.to_sym))
|
68
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::CryptocurrencyPairQuote`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
69
69
|
end
|
70
70
|
h[k.to_sym] = v
|
71
71
|
}
|
@@ -11,8 +11,8 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
# Preview of
|
15
|
-
class
|
14
|
+
# Preview of an order.
|
15
|
+
class SimpleOrderPreview
|
16
16
|
attr_accessor :estimated_fee
|
17
17
|
|
18
18
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -30,7 +30,7 @@ module SnapTrade
|
|
30
30
|
# Attribute type mapping.
|
31
31
|
def self.openapi_types
|
32
32
|
{
|
33
|
-
:'estimated_fee' => :'
|
33
|
+
:'estimated_fee' => :'SimpleOrderPreviewEstimatedFee'
|
34
34
|
}
|
35
35
|
end
|
36
36
|
|
@@ -44,13 +44,13 @@ module SnapTrade
|
|
44
44
|
# @param [Hash] attributes Model attributes in the form of hash
|
45
45
|
def initialize(attributes = {})
|
46
46
|
if (!attributes.is_a?(Hash))
|
47
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::
|
47
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::SimpleOrderPreview` initialize method"
|
48
48
|
end
|
49
49
|
|
50
50
|
# check to see if the attribute exists and convert string to symbol for hash key
|
51
51
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
52
52
|
if (!self.class.attribute_map.key?(k.to_sym))
|
53
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::
|
53
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::SimpleOrderPreview`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
54
54
|
end
|
55
55
|
h[k.to_sym] = v
|
56
56
|
}
|
@@ -12,7 +12,7 @@ require 'time'
|
|
12
12
|
|
13
13
|
module SnapTrade
|
14
14
|
# The estimated order fee.
|
15
|
-
class
|
15
|
+
class SimpleOrderPreviewEstimatedFee
|
16
16
|
# Symbol to identify a cryptocurrency or fiat currency on a crypto exchange. Fiat currencies symbols are ISO-4217 codes.
|
17
17
|
attr_accessor :currency
|
18
18
|
|
@@ -49,13 +49,13 @@ module SnapTrade
|
|
49
49
|
# @param [Hash] attributes Model attributes in the form of hash
|
50
50
|
def initialize(attributes = {})
|
51
51
|
if (!attributes.is_a?(Hash))
|
52
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::
|
52
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::SimpleOrderPreviewEstimatedFee` initialize method"
|
53
53
|
end
|
54
54
|
|
55
55
|
# check to see if the attribute exists and convert string to symbol for hash key
|
56
56
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
57
57
|
if (!self.class.attribute_map.key?(k.to_sym))
|
58
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::
|
58
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::SimpleOrderPreviewEstimatedFee`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
59
59
|
end
|
60
60
|
h[k.to_sym] = v
|
61
61
|
}
|
@@ -11,7 +11,7 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
class
|
14
|
+
class SimpleOrderRequestBodyTimeInForce
|
15
15
|
GTC = "GTC".freeze
|
16
16
|
FOK = "FOK".freeze
|
17
17
|
IOC = "IOC".freeze
|
@@ -32,8 +32,8 @@ module SnapTrade
|
|
32
32
|
# @param [String] The enum value in the form of the string
|
33
33
|
# @return [String] The enum value
|
34
34
|
def build_from_hash(value)
|
35
|
-
return value if
|
36
|
-
raise "Invalid ENUM value #{value} for class #
|
35
|
+
return value if SimpleOrderRequestBodyTimeInForce.all_vars.include?(value)
|
36
|
+
raise "Invalid ENUM value #{value} for class #SimpleOrderRequestBodyTimeInForce"
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
@@ -11,8 +11,8 @@ require 'date'
|
|
11
11
|
require 'time'
|
12
12
|
|
13
13
|
module SnapTrade
|
14
|
-
class
|
15
|
-
attr_accessor :
|
14
|
+
class TradingPlaceSimpleOrderRequest
|
15
|
+
attr_accessor :instrument
|
16
16
|
|
17
17
|
# The action describes the intent or side of a trade. This is either `BUY` or `SELL`.
|
18
18
|
attr_accessor :side
|
@@ -41,7 +41,7 @@ module SnapTrade
|
|
41
41
|
# Attribute mapping from ruby-style variable name to JSON key.
|
42
42
|
def self.attribute_map
|
43
43
|
{
|
44
|
-
:'
|
44
|
+
:'instrument' => :'instrument',
|
45
45
|
:'side' => :'side',
|
46
46
|
:'type' => :'type',
|
47
47
|
:'time_in_force' => :'time_in_force',
|
@@ -61,10 +61,10 @@ module SnapTrade
|
|
61
61
|
# Attribute type mapping.
|
62
62
|
def self.openapi_types
|
63
63
|
{
|
64
|
-
:'
|
64
|
+
:'instrument' => :'TradingInstrument',
|
65
65
|
:'side' => :'ActionStrict',
|
66
66
|
:'type' => :'Type',
|
67
|
-
:'time_in_force' => :'
|
67
|
+
:'time_in_force' => :'SimpleOrderRequestBodyTimeInForce',
|
68
68
|
:'amount' => :'Float',
|
69
69
|
:'limit_price' => :'Float',
|
70
70
|
:'stop_price' => :'Float',
|
@@ -83,19 +83,19 @@ module SnapTrade
|
|
83
83
|
# @param [Hash] attributes Model attributes in the form of hash
|
84
84
|
def initialize(attributes = {})
|
85
85
|
if (!attributes.is_a?(Hash))
|
86
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::
|
86
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::TradingPlaceSimpleOrderRequest` initialize method"
|
87
87
|
end
|
88
88
|
|
89
89
|
# check to see if the attribute exists and convert string to symbol for hash key
|
90
90
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
91
91
|
if (!self.class.attribute_map.key?(k.to_sym))
|
92
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::
|
92
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::TradingPlaceSimpleOrderRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
93
93
|
end
|
94
94
|
h[k.to_sym] = v
|
95
95
|
}
|
96
96
|
|
97
|
-
if attributes.key?(:'
|
98
|
-
self.
|
97
|
+
if attributes.key?(:'instrument')
|
98
|
+
self.instrument = attributes[:'instrument']
|
99
99
|
end
|
100
100
|
|
101
101
|
if attributes.key?(:'side')
|
@@ -135,8 +135,8 @@ module SnapTrade
|
|
135
135
|
# @return Array for valid properties with the reasons
|
136
136
|
def list_invalid_properties
|
137
137
|
invalid_properties = Array.new
|
138
|
-
if @
|
139
|
-
invalid_properties.push('invalid value for "
|
138
|
+
if @instrument.nil?
|
139
|
+
invalid_properties.push('invalid value for "instrument", instrument cannot be nil.')
|
140
140
|
end
|
141
141
|
|
142
142
|
if @side.nil?
|
@@ -161,7 +161,7 @@ module SnapTrade
|
|
161
161
|
# Check to see if the all the properties in the model are valid
|
162
162
|
# @return true if the model is valid
|
163
163
|
def valid?
|
164
|
-
return false if @
|
164
|
+
return false if @instrument.nil?
|
165
165
|
return false if @side.nil?
|
166
166
|
return false if @type.nil?
|
167
167
|
return false if @time_in_force.nil?
|
@@ -174,7 +174,7 @@ module SnapTrade
|
|
174
174
|
def ==(o)
|
175
175
|
return true if self.equal?(o)
|
176
176
|
self.class == o.class &&
|
177
|
-
|
177
|
+
instrument == o.instrument &&
|
178
178
|
side == o.side &&
|
179
179
|
type == o.type &&
|
180
180
|
time_in_force == o.time_in_force &&
|
@@ -194,7 +194,7 @@ module SnapTrade
|
|
194
194
|
# Calculates hash code according to all attributes.
|
195
195
|
# @return [Integer] Hash code
|
196
196
|
def hash
|
197
|
-
[
|
197
|
+
[instrument, side, type, time_in_force, amount, limit_price, stop_price, post_only, expiration_date].hash
|
198
198
|
end
|
199
199
|
|
200
200
|
# Builds the object from hash
|
@@ -12,7 +12,7 @@ require 'time'
|
|
12
12
|
|
13
13
|
module SnapTrade
|
14
14
|
# The symbols
|
15
|
-
class
|
15
|
+
class TradingSearchCryptocurrencyPairInstruments200Response
|
16
16
|
attr_accessor :items
|
17
17
|
|
18
18
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -44,13 +44,13 @@ module SnapTrade
|
|
44
44
|
# @param [Hash] attributes Model attributes in the form of hash
|
45
45
|
def initialize(attributes = {})
|
46
46
|
if (!attributes.is_a?(Hash))
|
47
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::
|
47
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::TradingSearchCryptocurrencyPairInstruments200Response` initialize method"
|
48
48
|
end
|
49
49
|
|
50
50
|
# check to see if the attribute exists and convert string to symbol for hash key
|
51
51
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
52
52
|
if (!self.class.attribute_map.key?(k.to_sym))
|
53
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::
|
53
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::TradingSearchCryptocurrencyPairInstruments200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
54
54
|
end
|
55
55
|
h[k.to_sym] = v
|
56
56
|
}
|
data/lib/snaptrade/version.rb
CHANGED
data/lib/snaptrade.rb
CHANGED
@@ -52,11 +52,8 @@ require 'snaptrade/models/child_brokerage_order_ids'
|
|
52
52
|
require 'snaptrade/models/connection_portal_version'
|
53
53
|
require 'snaptrade/models/connection_type'
|
54
54
|
require 'snaptrade/models/connections_session_events200_response_inner'
|
55
|
-
require 'snaptrade/models/crypto_spot_order_preview'
|
56
|
-
require 'snaptrade/models/crypto_spot_order_preview_estimated_fee'
|
57
|
-
require 'snaptrade/models/crypto_spot_order_request_body_time_in_force'
|
58
|
-
require 'snaptrade/models/crypto_spot_quote'
|
59
55
|
require 'snaptrade/models/cryptocurrency_pair'
|
56
|
+
require 'snaptrade/models/cryptocurrency_pair_quote'
|
60
57
|
require 'snaptrade/models/currency'
|
61
58
|
require 'snaptrade/models/delete_user_response'
|
62
59
|
require 'snaptrade/models/dividend_at_date'
|
@@ -119,6 +116,9 @@ require 'snaptrade/models/recent_orders_response'
|
|
119
116
|
require 'snaptrade/models/security_type'
|
120
117
|
require 'snaptrade/models/session_event'
|
121
118
|
require 'snaptrade/models/session_event_type'
|
119
|
+
require 'snaptrade/models/simple_order_preview'
|
120
|
+
require 'snaptrade/models/simple_order_preview_estimated_fee'
|
121
|
+
require 'snaptrade/models/simple_order_request_body_time_in_force'
|
122
122
|
require 'snaptrade/models/snap_trade_holdings_account'
|
123
123
|
require 'snaptrade/models/snap_trade_holdings_total_value'
|
124
124
|
require 'snaptrade/models/snap_trade_login_user_request_body'
|
@@ -141,11 +141,10 @@ require 'snaptrade/models/take_profit'
|
|
141
141
|
require 'snaptrade/models/time_in_force_strict'
|
142
142
|
require 'snaptrade/models/timeframe'
|
143
143
|
require 'snaptrade/models/trading_cancel_user_account_order_request'
|
144
|
-
require 'snaptrade/models/trading_crypto_spot_cancel_order_request'
|
145
|
-
require 'snaptrade/models/trading_crypto_spot_place_order_request'
|
146
|
-
require 'snaptrade/models/trading_crypto_spot_symbols200_response'
|
147
144
|
require 'snaptrade/models/trading_instrument'
|
148
145
|
require 'snaptrade/models/trading_instrument_type'
|
146
|
+
require 'snaptrade/models/trading_place_simple_order_request'
|
147
|
+
require 'snaptrade/models/trading_search_cryptocurrency_pair_instruments200_response'
|
149
148
|
require 'snaptrade/models/transactions_status'
|
150
149
|
require 'snaptrade/models/type'
|
151
150
|
require 'snaptrade/models/us_exchange'
|
@@ -162,7 +161,6 @@ require 'snaptrade/api/account_information_api'
|
|
162
161
|
require 'snaptrade/api/api_status_api'
|
163
162
|
require 'snaptrade/api/authentication_api'
|
164
163
|
require 'snaptrade/api/connections_api'
|
165
|
-
require 'snaptrade/api/crypto_spot_trading_api'
|
166
164
|
require 'snaptrade/api/options_api'
|
167
165
|
require 'snaptrade/api/reference_data_api'
|
168
166
|
require 'snaptrade/api/trading_api'
|
@@ -236,7 +234,6 @@ module SnapTrade
|
|
236
234
|
attr_reader :api_status
|
237
235
|
attr_reader :authentication
|
238
236
|
attr_reader :connections
|
239
|
-
attr_reader :crypto_spot_trading
|
240
237
|
attr_reader :options
|
241
238
|
attr_reader :reference_data
|
242
239
|
attr_reader :trading
|
@@ -248,7 +245,6 @@ module SnapTrade
|
|
248
245
|
@api_status = SnapTrade::APIStatusApi.new(@api_client)
|
249
246
|
@authentication = SnapTrade::AuthenticationApi.new(@api_client)
|
250
247
|
@connections = SnapTrade::ConnectionsApi.new(@api_client)
|
251
|
-
@crypto_spot_trading = SnapTrade::CryptoSpotTradingApi.new(@api_client)
|
252
248
|
@options = SnapTrade::OptionsApi.new(@api_client)
|
253
249
|
@reference_data = SnapTrade::ReferenceDataApi.new(@api_client)
|
254
250
|
@trading = SnapTrade::TradingApi.new(@api_client)
|
@@ -27,6 +27,21 @@ describe 'TradingApi' do
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
+
# unit tests for cancel_order
|
31
|
+
# Cancel an order.
|
32
|
+
# Cancels an order in the specified account.
|
33
|
+
# @param user_id
|
34
|
+
# @param user_secret
|
35
|
+
# @param account_id
|
36
|
+
# @param brokerage_order_id
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @return [OrderUpdatedResponse]
|
39
|
+
describe 'cancel_order 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 cancel_user_account_order
|
31
46
|
# Cancel order
|
32
47
|
# Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
|
@@ -42,6 +57,21 @@ describe 'TradingApi' do
|
|
42
57
|
end
|
43
58
|
end
|
44
59
|
|
60
|
+
# unit tests for get_cryptocurrency_pair_quote
|
61
|
+
# Get cryptocurrency pair quote
|
62
|
+
# Gets a quote for the specified account.
|
63
|
+
# @param user_id
|
64
|
+
# @param user_secret
|
65
|
+
# @param account_id
|
66
|
+
# @param instrument_symbol
|
67
|
+
# @param [Hash] opts the optional parameters
|
68
|
+
# @return [CryptocurrencyPairQuote]
|
69
|
+
describe 'get_cryptocurrency_pair_quote test' do
|
70
|
+
it 'should work' do
|
71
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
45
75
|
# unit tests for get_order_impact
|
46
76
|
# Check order impact
|
47
77
|
# Simulates an order and its impact on the account. This endpoint does not place the order with the brokerage. If successful, it returns a `Trade` object and the ID of the object can be used to place the order with the brokerage using the [place checked order endpoint](/reference/Trading/Trading_placeOrder). Please note that the `Trade` object returned expires after 5 minutes. Any order placed using an expired `Trade` will be rejected.
|
@@ -116,6 +146,36 @@ describe 'TradingApi' do
|
|
116
146
|
end
|
117
147
|
end
|
118
148
|
|
149
|
+
# unit tests for place_simple_order
|
150
|
+
# Place order
|
151
|
+
# Places an order in the specified account. This endpoint does not compute the impact to the account balance from the order before submitting the order.
|
152
|
+
# @param user_id
|
153
|
+
# @param user_secret
|
154
|
+
# @param account_id
|
155
|
+
# @param trading_place_simple_order_request
|
156
|
+
# @param [Hash] opts the optional parameters
|
157
|
+
# @return [OrderUpdatedResponse]
|
158
|
+
describe 'place_simple_order test' do
|
159
|
+
it 'should work' do
|
160
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
# unit tests for preview_simple_order
|
165
|
+
# Preview order
|
166
|
+
# Previews an order using the specified account.
|
167
|
+
# @param user_id
|
168
|
+
# @param user_secret
|
169
|
+
# @param account_id
|
170
|
+
# @param trading_place_simple_order_request
|
171
|
+
# @param [Hash] opts the optional parameters
|
172
|
+
# @return [SimpleOrderPreview]
|
173
|
+
describe 'preview_simple_order test' do
|
174
|
+
it 'should work' do
|
175
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
119
179
|
# unit tests for replace_order
|
120
180
|
# Replaces an order with a new one
|
121
181
|
# Replaces an existing pending order with a new one. The way this works is brokerage dependent, but usually involves cancelling the existing order and placing a new one. The order's brokerage_order_id may or may not change, be sure to use the one returned in the response going forward. Only supported on some brokerages
|
@@ -132,4 +192,20 @@ describe 'TradingApi' do
|
|
132
192
|
end
|
133
193
|
end
|
134
194
|
|
195
|
+
# unit tests for search_cryptocurrency_pair_instruments
|
196
|
+
# Search cryptocurrency pairs instruments
|
197
|
+
# Searches cryptocurrency pairs instruments accessible to the specified account.
|
198
|
+
# @param user_id
|
199
|
+
# @param user_secret
|
200
|
+
# @param account_id
|
201
|
+
# @param [Hash] opts the optional parameters
|
202
|
+
# @option opts [String] :base
|
203
|
+
# @option opts [String] :quote
|
204
|
+
# @return [TradingSearchCryptocurrencyPairInstruments200Response]
|
205
|
+
describe 'search_cryptocurrency_pair_instruments test' do
|
206
|
+
it 'should work' do
|
207
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
135
211
|
end
|
@@ -11,13 +11,13 @@ require 'spec_helper'
|
|
11
11
|
require 'json'
|
12
12
|
require 'date'
|
13
13
|
|
14
|
-
# Unit tests for SnapTrade::
|
15
|
-
describe SnapTrade::
|
16
|
-
let(:instance) { SnapTrade::
|
14
|
+
# Unit tests for SnapTrade::CryptocurrencyPairQuote
|
15
|
+
describe SnapTrade::CryptocurrencyPairQuote do
|
16
|
+
let(:instance) { SnapTrade::CryptocurrencyPairQuote.new }
|
17
17
|
|
18
|
-
describe 'test an instance of
|
19
|
-
it 'should create an instance of
|
20
|
-
expect(instance).to be_instance_of(SnapTrade::
|
18
|
+
describe 'test an instance of CryptocurrencyPairQuote' do
|
19
|
+
it 'should create an instance of CryptocurrencyPairQuote' do
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::CryptocurrencyPairQuote)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
describe 'test attribute "bid"' do
|
@@ -20,6 +20,12 @@ describe SnapTrade::CryptocurrencyPair do
|
|
20
20
|
expect(instance).to be_instance_of(SnapTrade::CryptocurrencyPair)
|
21
21
|
end
|
22
22
|
end
|
23
|
+
describe 'test attribute "symbol"' 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
|
+
|
23
29
|
describe 'test attribute "base"' do
|
24
30
|
it 'should work' do
|
25
31
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
@@ -11,13 +11,13 @@ require 'spec_helper'
|
|
11
11
|
require 'json'
|
12
12
|
require 'date'
|
13
13
|
|
14
|
-
# Unit tests for SnapTrade::
|
15
|
-
describe SnapTrade::
|
16
|
-
let(:instance) { SnapTrade::
|
14
|
+
# Unit tests for SnapTrade::SimpleOrderPreviewEstimatedFee
|
15
|
+
describe SnapTrade::SimpleOrderPreviewEstimatedFee do
|
16
|
+
let(:instance) { SnapTrade::SimpleOrderPreviewEstimatedFee.new }
|
17
17
|
|
18
|
-
describe 'test an instance of
|
19
|
-
it 'should create an instance of
|
20
|
-
expect(instance).to be_instance_of(SnapTrade::
|
18
|
+
describe 'test an instance of SimpleOrderPreviewEstimatedFee' do
|
19
|
+
it 'should create an instance of SimpleOrderPreviewEstimatedFee' do
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::SimpleOrderPreviewEstimatedFee)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
describe 'test attribute "currency"' do
|
@@ -11,13 +11,13 @@ require 'spec_helper'
|
|
11
11
|
require 'json'
|
12
12
|
require 'date'
|
13
13
|
|
14
|
-
# Unit tests for SnapTrade::
|
15
|
-
describe SnapTrade::
|
16
|
-
let(:instance) { SnapTrade::
|
14
|
+
# Unit tests for SnapTrade::SimpleOrderPreview
|
15
|
+
describe SnapTrade::SimpleOrderPreview do
|
16
|
+
let(:instance) { SnapTrade::SimpleOrderPreview.new }
|
17
17
|
|
18
|
-
describe 'test an instance of
|
19
|
-
it 'should create an instance of
|
20
|
-
expect(instance).to be_instance_of(SnapTrade::
|
18
|
+
describe 'test an instance of SimpleOrderPreview' do
|
19
|
+
it 'should create an instance of SimpleOrderPreview' do
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::SimpleOrderPreview)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
describe 'test attribute "estimated_fee"' do
|
@@ -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::SimpleOrderRequestBodyTimeInForce
|
15
|
+
describe SnapTrade::SimpleOrderRequestBodyTimeInForce do
|
16
|
+
let(:instance) { SnapTrade::SimpleOrderRequestBodyTimeInForce.new }
|
17
|
+
|
18
|
+
describe 'test an instance of SimpleOrderRequestBodyTimeInForce' do
|
19
|
+
it 'should create an instance of SimpleOrderRequestBodyTimeInForce' do
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::SimpleOrderRequestBodyTimeInForce)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -11,16 +11,16 @@ require 'spec_helper'
|
|
11
11
|
require 'json'
|
12
12
|
require 'date'
|
13
13
|
|
14
|
-
# Unit tests for SnapTrade::
|
15
|
-
describe SnapTrade::
|
16
|
-
let(:instance) { SnapTrade::
|
14
|
+
# Unit tests for SnapTrade::TradingPlaceSimpleOrderRequest
|
15
|
+
describe SnapTrade::TradingPlaceSimpleOrderRequest do
|
16
|
+
let(:instance) { SnapTrade::TradingPlaceSimpleOrderRequest.new }
|
17
17
|
|
18
|
-
describe 'test an instance of
|
19
|
-
it 'should create an instance of
|
20
|
-
expect(instance).to be_instance_of(SnapTrade::
|
18
|
+
describe 'test an instance of TradingPlaceSimpleOrderRequest' do
|
19
|
+
it 'should create an instance of TradingPlaceSimpleOrderRequest' do
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::TradingPlaceSimpleOrderRequest)
|
21
21
|
end
|
22
22
|
end
|
23
|
-
describe 'test attribute "
|
23
|
+
describe 'test attribute "instrument"' do
|
24
24
|
it 'should work' do
|
25
25
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
26
26
|
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::TradingSearchCryptocurrencyPairInstruments200Response
|
15
|
+
describe SnapTrade::TradingSearchCryptocurrencyPairInstruments200Response do
|
16
|
+
let(:instance) { SnapTrade::TradingSearchCryptocurrencyPairInstruments200Response.new }
|
17
|
+
|
18
|
+
describe 'test an instance of TradingSearchCryptocurrencyPairInstruments200Response' do
|
19
|
+
it 'should create an instance of TradingSearchCryptocurrencyPairInstruments200Response' do
|
20
|
+
expect(instance).to be_instance_of(SnapTrade::TradingSearchCryptocurrencyPairInstruments200Response)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
describe 'test attribute "items"' 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
|