snaptrade 2.0.119 → 2.0.121

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 04544c3b4f3722e8f2bfc3b1a730fb3fc6ef65fd762afddf4d3e21556880faa4
4
- data.tar.gz: 53521894f19e0f2bb52942845132b7f07dc3a0b9de436aa00d57b96d539c1041
3
+ metadata.gz: 7c6d68c3bef6d28351d54a9f45678a5cfefc9b9391e9ab251e2a1fde13a1932d
4
+ data.tar.gz: d6a23c0e07e552ec7a3164b9726b4c9a17519e25adcc6b6cd3fb141ec1ae6c68
5
5
  SHA512:
6
- metadata.gz: e24567932a3cb2c2aa19c1219e3ebc26708beab6a2a5c84cf06b5f4468526c6466a4029202743227245a6d0eafea43fa02fdd7ddcb6e2b88bed363f7c1623fa0
7
- data.tar.gz: b8409aaf5fcb21bd3a9a591f0cdaa93500211ad4bd359f6edd929fcbfac82450402a477f14c321b8d6cc73d44a491c85d7fc0b15da597b10f92e731e7c641432
6
+ metadata.gz: 70c0c65c30a04eacf60727973d3b3090b28cfac3746b964c9884f64271705e304762d280b7fda101db556548e94a34e8262d17d83a0dc56ea6cc66688f6330b6
7
+ data.tar.gz: fd1a0091ab72a9e0ee4955fe64d8ae8cc96edc7a03fa2ffdaddf516cf043a901142980dca741929703522ea7ebdc44f4a3bab494819b630a65df65f8136f895c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snaptrade (2.0.119)
4
+ snaptrade (2.0.121)
5
5
  faraday (>= 1.0.1, < 3.0)
6
6
  faraday-multipart (~> 1.0, >= 1.0.4)
7
7
 
@@ -42,7 +42,7 @@ GEM
42
42
  racc (1.8.1)
43
43
  rainbow (3.1.1)
44
44
  rake (13.0.6)
45
- regexp_parser (2.10.0)
45
+ regexp_parser (2.11.0)
46
46
  reline (0.6.2)
47
47
  io-console (~> 0.5)
48
48
  rexml (3.4.1)
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
- [![npm](https://img.shields.io/badge/gem-v2.0.119-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.119)
9
+ [![npm](https://img.shields.io/badge/gem-v2.0.121-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.121)
10
10
  [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
11
11
 
12
12
  </div>
@@ -66,11 +66,11 @@ Connect brokerage accounts to your app for live positions and trading
66
66
  * [`snaptrade.trading.get_order_impact`](#snaptradetradingget_order_impact)
67
67
  * [`snaptrade.trading.get_user_account_quotes`](#snaptradetradingget_user_account_quotes)
68
68
  * [`snaptrade.trading.place_bracket_order`](#snaptradetradingplace_bracket_order)
69
+ * [`snaptrade.trading.place_crypto_order`](#snaptradetradingplace_crypto_order)
69
70
  * [`snaptrade.trading.place_force_order`](#snaptradetradingplace_force_order)
70
71
  * [`snaptrade.trading.place_mleg_order`](#snaptradetradingplace_mleg_order)
71
72
  * [`snaptrade.trading.place_order`](#snaptradetradingplace_order)
72
- * [`snaptrade.trading.place_simple_order`](#snaptradetradingplace_simple_order)
73
- * [`snaptrade.trading.preview_simple_order`](#snaptradetradingpreview_simple_order)
73
+ * [`snaptrade.trading.preview_crypto_order`](#snaptradetradingpreview_crypto_order)
74
74
  * [`snaptrade.trading.replace_order`](#snaptradetradingreplace_order)
75
75
  * [`snaptrade.trading.search_cryptocurrency_pair_instruments`](#snaptradetradingsearch_cryptocurrency_pair_instruments)
76
76
  * [`snaptrade.transactions_and_reporting.get_activities`](#snaptradetransactions_and_reportingget_activities)
@@ -83,7 +83,7 @@ Connect brokerage accounts to your app for live positions and trading
83
83
  Add to Gemfile:
84
84
 
85
85
  ```ruby
86
- gem 'snaptrade', '~> 2.0.119'
86
+ gem 'snaptrade', '~> 2.0.121'
87
87
  ```
88
88
 
89
89
  ## Getting Started<a id="getting-started"></a>
@@ -1612,7 +1612,7 @@ The search query for symbols.
1612
1612
 
1613
1613
  ### `snaptrade.trading.cancel_order`<a id="snaptradetradingcancel_order"></a>
1614
1614
 
1615
- Cancels an order in the specified account.
1615
+ Cancels an order in the specified account. Accepts order IDs for all asset types.
1616
1616
 
1617
1617
 
1618
1618
  #### 🛠️ Usage<a id="🛠️-usage"></a>
@@ -1650,7 +1650,9 @@ the brokerage system.
1650
1650
 
1651
1651
 
1652
1652
  ### `snaptrade.trading.cancel_user_account_order`<a id="snaptradetradingcancel_user_account_order"></a>
1653
+ ![Deprecated](https://img.shields.io/badge/deprecated-yellow)
1653
1654
 
1655
+ **This endpoint is deprecated. Please switch to [the new cancel order endpoint](/reference/Trading/Trading_cancelOrder) **
1654
1656
  Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
1655
1657
 
1656
1658
 
@@ -1933,6 +1935,88 @@ Must be `null` if `notional_value` is provided.
1933
1935
  ---
1934
1936
 
1935
1937
 
1938
+ ### `snaptrade.trading.place_crypto_order`<a id="snaptradetradingplace_crypto_order"></a>
1939
+
1940
+ Places an order in the specified account.
1941
+ This endpoint does not compute the impact to the account balance from the order before submitting the order.
1942
+
1943
+
1944
+ #### 🛠️ Usage<a id="🛠️-usage"></a>
1945
+
1946
+ ```ruby
1947
+ result = snaptrade.trading.place_crypto_order(
1948
+ instrument: {
1949
+ "symbol" => "BTC",
1950
+ "type" => "CRYPTOCURRENCY",
1951
+ },
1952
+ side: "BUY",
1953
+ type: "MARKET",
1954
+ time_in_force: "GTC",
1955
+ amount: "123.45",
1956
+ user_id: "snaptrade-user-123",
1957
+ user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
1958
+ account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
1959
+ limit_price: "123.45",
1960
+ stop_price: "123.45",
1961
+ post_only: false,
1962
+ expiration_date: "2024-01-01T00:00:00Z",
1963
+ )
1964
+ p result
1965
+ ```
1966
+
1967
+ #### ⚙️ Parameters<a id="⚙️-parameters"></a>
1968
+
1969
+ ##### instrument: [`CryptoTradingInstrument`](./lib/snaptrade/models/crypto_trading_instrument.rb)<a id="instrument-cryptotradinginstrumentlibsnaptrademodelscrypto_trading_instrumentrb"></a>
1970
+ ##### side: [`ActionStrict`](./lib/snaptrade/models/action_strict.rb)<a id="side-actionstrictlibsnaptrademodelsaction_strictrb"></a>
1971
+ The action describes the intent or side of a trade. This is either `BUY` or
1972
+ `SELL`.
1973
+
1974
+ ##### type: [`CryptoOrderFormType`](./lib/snaptrade/models/crypto_order_form_type.rb)<a id="type-cryptoorderformtypelibsnaptrademodelscrypto_order_form_typerb"></a>
1975
+ The type of order to place.
1976
+
1977
+ ##### time_in_force: [`CryptoOrderFormTimeInForce`](./lib/snaptrade/models/crypto_order_form_time_in_force.rb)<a id="time_in_force-cryptoorderformtimeinforcelibsnaptrademodelscrypto_order_form_time_in_forcerb"></a>
1978
+ The Time in Force type for the order. This field indicates how long the order
1979
+ will remain active before it is executed or expires. - `GTC` - Good Til
1980
+ Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or
1981
+ Kill. The order must be executed in its entirety immediately or be canceled
1982
+ completely. - `IOC` - Immediate Or Cancel. The order must be executed
1983
+ immediately. Any portion of the order that cannot be filled immediately will be
1984
+ canceled. - `GTD` - Good Til Date. The order is valid until the specified date.
1985
+
1986
+ ##### amount: `Float`<a id="amount-float"></a>
1987
+ The amount of the base currency to buy or sell.
1988
+
1989
+ ##### user_id: `String`<a id="user_id-string"></a>
1990
+ ##### user_secret: `String`<a id="user_secret-string"></a>
1991
+ ##### account_id: `String`<a id="account_id-string"></a>
1992
+ ##### limit_price: `Float`<a id="limit_price-float"></a>
1993
+ The limit price. Required if the order type is LIMIT, STOP_LOSS_LIMIT or
1994
+ TAKE_PROFIT_LIMIT.
1995
+
1996
+ ##### stop_price: `Float`<a id="stop_price-float"></a>
1997
+ The stop price. Required if the order type is STOP_LOSS_MARKET, STOP_LOSS_LIMIT,
1998
+ TAKE_PROFIT_MARKET or TAKE_PROFIT_LIMIT.
1999
+
2000
+ ##### post_only: `Boolean`<a id="post_only-boolean"></a>
2001
+ Valid and required only for order type LIMIT. If true orders that would be
2002
+ filled immediately are rejected to avoid incurring TAKER fees.
2003
+
2004
+ ##### expiration_date: `Time`<a id="expiration_date-time"></a>
2005
+ The expiration date of the order. Required if the time_in_force is GTD.
2006
+
2007
+ #### 🔄 Return<a id="🔄-return"></a>
2008
+
2009
+ [OrderUpdatedResponse](./lib/snaptrade/models/order_updated_response.rb)
2010
+
2011
+ #### 🌐 Endpoint<a id="🌐-endpoint"></a>
2012
+
2013
+ `/accounts/{accountId}/trading/crypto` `POST`
2014
+
2015
+ [🔙 **Back to Table of Contents**](#table-of-contents)
2016
+
2017
+ ---
2018
+
2019
+
1936
2020
  ### `snaptrade.trading.place_force_order`<a id="snaptradetradingplace_force_order"></a>
1937
2021
 
1938
2022
  Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds.
@@ -1953,7 +2037,7 @@ result = snaptrade.trading.place_force_order(
1953
2037
  user_id: "snaptrade-user-123",
1954
2038
  user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
1955
2039
  universal_symbol_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
1956
- symbol: "AAPL 131124C00240000",
2040
+ symbol: "AAPL",
1957
2041
  price: 31.33,
1958
2042
  stop: 31.33,
1959
2043
  units: 10.5,
@@ -1995,12 +2079,8 @@ The universal symbol ID of the security to trade. Must be 'null' if `symbol` is
1995
2079
  provided, otherwise must be provided.
1996
2080
 
1997
2081
  ##### symbol: `String`<a id="symbol-string"></a>
1998
- The security's trading ticker symbol. This currently supports stock symbols and
1999
- Options symbols in the 21 character OCC format. For example `AAPL
2000
- 131124C00240000` represents a call option on AAPL expiring on 2024-11-13 with a
2001
- strike price of $240. For more information on the OCC format, see
2002
- [here](https://en.wikipedia.org/wiki/Option_symbol#OCC_format). If 'symbol' is
2003
- provided, then 'universal_symbol_id' must be 'null'.
2082
+ The security's trading ticker symbol. If 'symbol' is provided, then
2083
+ 'universal_symbol_id' must be 'null'.
2004
2084
 
2005
2085
  ##### price: `Float`<a id="price-float"></a>
2006
2086
  The limit price for `Limit` and `StopLimit` orders.
@@ -2144,89 +2224,7 @@ before responding to the request.
2144
2224
  ---
2145
2225
 
2146
2226
 
2147
- ### `snaptrade.trading.place_simple_order`<a id="snaptradetradingplace_simple_order"></a>
2148
-
2149
- Places an order in the specified account.
2150
- This endpoint does not compute the impact to the account balance from the order before submitting the order.
2151
-
2152
-
2153
- #### 🛠️ Usage<a id="🛠️-usage"></a>
2154
-
2155
- ```ruby
2156
- result = snaptrade.trading.place_simple_order(
2157
- instrument: {
2158
- "symbol" => "AAPL",
2159
- "type" => "EQUITY",
2160
- },
2161
- side: "BUY",
2162
- type: "MARKET",
2163
- time_in_force: "GTC",
2164
- amount: "123.45",
2165
- user_id: "snaptrade-user-123",
2166
- user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
2167
- account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
2168
- limit_price: "123.45",
2169
- stop_price: "123.45",
2170
- post_only: false,
2171
- expiration_date: "2024-01-01T00:00:00Z",
2172
- )
2173
- p result
2174
- ```
2175
-
2176
- #### ⚙️ Parameters<a id="⚙️-parameters"></a>
2177
-
2178
- ##### instrument: [`TradingInstrument`](./lib/snaptrade/models/trading_instrument.rb)<a id="instrument-tradinginstrumentlibsnaptrademodelstrading_instrumentrb"></a>
2179
- ##### side: [`ActionStrict`](./lib/snaptrade/models/action_strict.rb)<a id="side-actionstrictlibsnaptrademodelsaction_strictrb"></a>
2180
- The action describes the intent or side of a trade. This is either `BUY` or
2181
- `SELL`.
2182
-
2183
- ##### type: [`SimpleOrderFormType`](./lib/snaptrade/models/simple_order_form_type.rb)<a id="type-simpleorderformtypelibsnaptrademodelssimple_order_form_typerb"></a>
2184
- The type of order to place.
2185
-
2186
- ##### time_in_force: [`SimpleOrderFormTimeInForce`](./lib/snaptrade/models/simple_order_form_time_in_force.rb)<a id="time_in_force-simpleorderformtimeinforcelibsnaptrademodelssimple_order_form_time_in_forcerb"></a>
2187
- The Time in Force type for the order. This field indicates how long the order
2188
- will remain active before it is executed or expires. - `GTC` - Good Til
2189
- Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or
2190
- Kill. The order must be executed in its entirety immediately or be canceled
2191
- completely. - `IOC` - Immediate Or Cancel. The order must be executed
2192
- immediately. Any portion of the order that cannot be filled immediately will be
2193
- canceled. - `GTD` - Good Til Date. The order is valid until the specified date.
2194
-
2195
- ##### amount: `Float`<a id="amount-float"></a>
2196
- The amount of the base currency to buy or sell.
2197
-
2198
- ##### user_id: `String`<a id="user_id-string"></a>
2199
- ##### user_secret: `String`<a id="user_secret-string"></a>
2200
- ##### account_id: `String`<a id="account_id-string"></a>
2201
- ##### limit_price: `Float`<a id="limit_price-float"></a>
2202
- The limit price. Required if the order type is LIMIT, STOP_LOSS_LIMIT or
2203
- TAKE_PROFIT_LIMIT.
2204
-
2205
- ##### stop_price: `Float`<a id="stop_price-float"></a>
2206
- The stop price. Required if the order type is STOP_LOSS_MARKET, STOP_LOSS_LIMIT,
2207
- TAKE_PROFIT_MARKET or TAKE_PROFIT_LIMIT.
2208
-
2209
- ##### post_only: `Boolean`<a id="post_only-boolean"></a>
2210
- Valid and required only for order type LIMIT. If true orders that would be
2211
- filled immediately are rejected to avoid incurring TAKER fees.
2212
-
2213
- ##### expiration_date: `Time`<a id="expiration_date-time"></a>
2214
- The expiration date of the order. Required if the time_in_force is GTD.
2215
-
2216
- #### 🔄 Return<a id="🔄-return"></a>
2217
-
2218
- [OrderUpdatedResponse](./lib/snaptrade/models/order_updated_response.rb)
2219
-
2220
- #### 🌐 Endpoint<a id="🌐-endpoint"></a>
2221
-
2222
- `/accounts/{accountId}/trading/simple` `POST`
2223
-
2224
- [🔙 **Back to Table of Contents**](#table-of-contents)
2225
-
2226
- ---
2227
-
2228
-
2229
- ### `snaptrade.trading.preview_simple_order`<a id="snaptradetradingpreview_simple_order"></a>
2227
+ ### `snaptrade.trading.preview_crypto_order`<a id="snaptradetradingpreview_crypto_order"></a>
2230
2228
 
2231
2229
  Previews an order using the specified account.
2232
2230
 
@@ -2234,10 +2232,10 @@ Previews an order using the specified account.
2234
2232
  #### 🛠️ Usage<a id="🛠️-usage"></a>
2235
2233
 
2236
2234
  ```ruby
2237
- result = snaptrade.trading.preview_simple_order(
2235
+ result = snaptrade.trading.preview_crypto_order(
2238
2236
  instrument: {
2239
- "symbol" => "AAPL",
2240
- "type" => "EQUITY",
2237
+ "symbol" => "BTC",
2238
+ "type" => "CRYPTOCURRENCY",
2241
2239
  },
2242
2240
  side: "BUY",
2243
2241
  type: "MARKET",
@@ -2256,15 +2254,15 @@ p result
2256
2254
 
2257
2255
  #### ⚙️ Parameters<a id="⚙️-parameters"></a>
2258
2256
 
2259
- ##### instrument: [`TradingInstrument`](./lib/snaptrade/models/trading_instrument.rb)<a id="instrument-tradinginstrumentlibsnaptrademodelstrading_instrumentrb"></a>
2257
+ ##### instrument: [`CryptoTradingInstrument`](./lib/snaptrade/models/crypto_trading_instrument.rb)<a id="instrument-cryptotradinginstrumentlibsnaptrademodelscrypto_trading_instrumentrb"></a>
2260
2258
  ##### side: [`ActionStrict`](./lib/snaptrade/models/action_strict.rb)<a id="side-actionstrictlibsnaptrademodelsaction_strictrb"></a>
2261
2259
  The action describes the intent or side of a trade. This is either `BUY` or
2262
2260
  `SELL`.
2263
2261
 
2264
- ##### type: [`SimpleOrderFormType`](./lib/snaptrade/models/simple_order_form_type.rb)<a id="type-simpleorderformtypelibsnaptrademodelssimple_order_form_typerb"></a>
2262
+ ##### type: [`CryptoOrderFormType`](./lib/snaptrade/models/crypto_order_form_type.rb)<a id="type-cryptoorderformtypelibsnaptrademodelscrypto_order_form_typerb"></a>
2265
2263
  The type of order to place.
2266
2264
 
2267
- ##### time_in_force: [`SimpleOrderFormTimeInForce`](./lib/snaptrade/models/simple_order_form_time_in_force.rb)<a id="time_in_force-simpleorderformtimeinforcelibsnaptrademodelssimple_order_form_time_in_forcerb"></a>
2265
+ ##### time_in_force: [`CryptoOrderFormTimeInForce`](./lib/snaptrade/models/crypto_order_form_time_in_force.rb)<a id="time_in_force-cryptoorderformtimeinforcelibsnaptrademodelscrypto_order_form_time_in_forcerb"></a>
2268
2266
  The Time in Force type for the order. This field indicates how long the order
2269
2267
  will remain active before it is executed or expires. - `GTC` - Good Til
2270
2268
  Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or
@@ -2296,11 +2294,11 @@ The expiration date of the order. Required if the time_in_force is GTD.
2296
2294
 
2297
2295
  #### 🔄 Return<a id="🔄-return"></a>
2298
2296
 
2299
- [SimpleOrderPreview](./lib/snaptrade/models/simple_order_preview.rb)
2297
+ [CryptoOrderPreview](./lib/snaptrade/models/crypto_order_preview.rb)
2300
2298
 
2301
2299
  #### 🌐 Endpoint<a id="🌐-endpoint"></a>
2302
2300
 
2303
- `/accounts/{accountId}/trading/simple/preview` `POST`
2301
+ `/accounts/{accountId}/trading/crypto/preview` `POST`
2304
2302
 
2305
2303
  [🔙 **Back to Table of Contents**](#table-of-contents)
2306
2304
 
@@ -2318,11 +2316,11 @@ returned in the response going forward. Only supported on some brokerages
2318
2316
 
2319
2317
  ```ruby
2320
2318
  result = snaptrade.trading.replace_order(
2319
+ brokerage_order_id: "66a033fa-da74-4fcf-b527-feefdec9257e",
2321
2320
  action: "BUY",
2322
2321
  order_type: "Market",
2323
2322
  time_in_force: "Day",
2324
2323
  account_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
2325
- brokerage_order_id: "66a033fa-da74-4fcf-b527-feefdec9257e",
2326
2324
  user_id: "snaptrade-user-123",
2327
2325
  user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
2328
2326
  price: 31.33,
@@ -2335,6 +2333,10 @@ p result
2335
2333
 
2336
2334
  #### ⚙️ Parameters<a id="⚙️-parameters"></a>
2337
2335
 
2336
+ ##### brokerage_order_id: `String`<a id="brokerage_order_id-string"></a>
2337
+ Order ID returned by brokerage. This is the unique identifier for the order in
2338
+ the brokerage system.
2339
+
2338
2340
  ##### action: [`ActionStrict`](./lib/snaptrade/models/action_strict.rb)<a id="action-actionstrictlibsnaptrademodelsaction_strictrb"></a>
2339
2341
  The action describes the intent or side of a trade. This is either `BUY` or
2340
2342
  `SELL`.
@@ -2357,9 +2359,6 @@ immediately will be canceled.
2357
2359
  ##### account_id: `String`<a id="account_id-string"></a>
2358
2360
  The ID of the account to execute the trade on.
2359
2361
 
2360
- ##### brokerage_order_id: `String`<a id="brokerage_order_id-string"></a>
2361
- The Brokerage Order ID of the order to replace.
2362
-
2363
2362
  ##### user_id: `String`<a id="user_id-string"></a>
2364
2363
  ##### user_secret: `String`<a id="user_secret-string"></a>
2365
2364
  ##### price: `Float`<a id="price-float"></a>
@@ -2378,7 +2377,7 @@ The price at which a stop order is triggered for `Stop` and `StopLimit` orders.
2378
2377
 
2379
2378
  #### 🌐 Endpoint<a id="🌐-endpoint"></a>
2380
2379
 
2381
- `/accounts/{accountId}/trading/simple/{brokerageOrderId}/replace` `PATCH`
2380
+ `/accounts/{accountId}/trading/replace` `POST`
2382
2381
 
2383
2382
  [🔙 **Back to Table of Contents**](#table-of-contents)
2384
2383