snaptrade 2.0.119 → 2.0.120

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: c508e9897f0acab217bc22c8d928b14dc18dfa713028fa9cf11ee6fe716f6ac1
4
+ data.tar.gz: 9da7426881e3e422093e9c16f154b40db9004891d61bc33aa102737174332816
5
5
  SHA512:
6
- metadata.gz: e24567932a3cb2c2aa19c1219e3ebc26708beab6a2a5c84cf06b5f4468526c6466a4029202743227245a6d0eafea43fa02fdd7ddcb6e2b88bed363f7c1623fa0
7
- data.tar.gz: b8409aaf5fcb21bd3a9a591f0cdaa93500211ad4bd359f6edd929fcbfac82450402a477f14c321b8d6cc73d44a491c85d7fc0b15da597b10f92e731e7c641432
6
+ metadata.gz: 96db44a39411f328184933dfab187562a563f88b895012adc08900626a19c3e04514d98404e7b2e2850a73192ffd171e16301a903c239a72355fe0db63b8b7f6
7
+ data.tar.gz: 5f408ade219f544fdbf07c28d9e992fe7bc234a2e3abf650b8ed1deabce0595cc700e9b6af39a1766f22e38d25fd05a9b53b1ecc481761d5681471354a1019d5
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.120)
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.120-blue)](https://rubygems.org/gems/snaptrade/versions/2.0.120)
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.120'
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.
@@ -2144,89 +2228,7 @@ before responding to the request.
2144
2228
  ---
2145
2229
 
2146
2230
 
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>
2231
+ ### `snaptrade.trading.preview_crypto_order`<a id="snaptradetradingpreview_crypto_order"></a>
2230
2232
 
2231
2233
  Previews an order using the specified account.
2232
2234
 
@@ -2234,10 +2236,10 @@ Previews an order using the specified account.
2234
2236
  #### 🛠️ Usage<a id="🛠️-usage"></a>
2235
2237
 
2236
2238
  ```ruby
2237
- result = snaptrade.trading.preview_simple_order(
2239
+ result = snaptrade.trading.preview_crypto_order(
2238
2240
  instrument: {
2239
- "symbol" => "AAPL",
2240
- "type" => "EQUITY",
2241
+ "symbol" => "BTC",
2242
+ "type" => "CRYPTOCURRENCY",
2241
2243
  },
2242
2244
  side: "BUY",
2243
2245
  type: "MARKET",
@@ -2256,15 +2258,15 @@ p result
2256
2258
 
2257
2259
  #### ⚙️ Parameters<a id="⚙️-parameters"></a>
2258
2260
 
2259
- ##### instrument: [`TradingInstrument`](./lib/snaptrade/models/trading_instrument.rb)<a id="instrument-tradinginstrumentlibsnaptrademodelstrading_instrumentrb"></a>
2261
+ ##### instrument: [`CryptoTradingInstrument`](./lib/snaptrade/models/crypto_trading_instrument.rb)<a id="instrument-cryptotradinginstrumentlibsnaptrademodelscrypto_trading_instrumentrb"></a>
2260
2262
  ##### side: [`ActionStrict`](./lib/snaptrade/models/action_strict.rb)<a id="side-actionstrictlibsnaptrademodelsaction_strictrb"></a>
2261
2263
  The action describes the intent or side of a trade. This is either `BUY` or
2262
2264
  `SELL`.
2263
2265
 
2264
- ##### type: [`SimpleOrderFormType`](./lib/snaptrade/models/simple_order_form_type.rb)<a id="type-simpleorderformtypelibsnaptrademodelssimple_order_form_typerb"></a>
2266
+ ##### type: [`CryptoOrderFormType`](./lib/snaptrade/models/crypto_order_form_type.rb)<a id="type-cryptoorderformtypelibsnaptrademodelscrypto_order_form_typerb"></a>
2265
2267
  The type of order to place.
2266
2268
 
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>
2269
+ ##### 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
2270
  The Time in Force type for the order. This field indicates how long the order
2269
2271
  will remain active before it is executed or expires. - `GTC` - Good Til
2270
2272
  Canceled. The order is valid until it is executed or canceled. - `FOK` - Fill Or
@@ -2296,11 +2298,11 @@ The expiration date of the order. Required if the time_in_force is GTD.
2296
2298
 
2297
2299
  #### 🔄 Return<a id="🔄-return"></a>
2298
2300
 
2299
- [SimpleOrderPreview](./lib/snaptrade/models/simple_order_preview.rb)
2301
+ [CryptoOrderPreview](./lib/snaptrade/models/crypto_order_preview.rb)
2300
2302
 
2301
2303
  #### 🌐 Endpoint<a id="🌐-endpoint"></a>
2302
2304
 
2303
- `/accounts/{accountId}/trading/simple/preview` `POST`
2305
+ `/accounts/{accountId}/trading/crypto/preview` `POST`
2304
2306
 
2305
2307
  [🔙 **Back to Table of Contents**](#table-of-contents)
2306
2308
 
@@ -2318,11 +2320,11 @@ returned in the response going forward. Only supported on some brokerages
2318
2320
 
2319
2321
  ```ruby
2320
2322
  result = snaptrade.trading.replace_order(
2323
+ brokerage_order_id: "66a033fa-da74-4fcf-b527-feefdec9257e",
2321
2324
  action: "BUY",
2322
2325
  order_type: "Market",
2323
2326
  time_in_force: "Day",
2324
2327
  account_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
2325
- brokerage_order_id: "66a033fa-da74-4fcf-b527-feefdec9257e",
2326
2328
  user_id: "snaptrade-user-123",
2327
2329
  user_secret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
2328
2330
  price: 31.33,
@@ -2335,6 +2337,10 @@ p result
2335
2337
 
2336
2338
  #### ⚙️ Parameters<a id="⚙️-parameters"></a>
2337
2339
 
2340
+ ##### brokerage_order_id: `String`<a id="brokerage_order_id-string"></a>
2341
+ Order ID returned by brokerage. This is the unique identifier for the order in
2342
+ the brokerage system.
2343
+
2338
2344
  ##### action: [`ActionStrict`](./lib/snaptrade/models/action_strict.rb)<a id="action-actionstrictlibsnaptrademodelsaction_strictrb"></a>
2339
2345
  The action describes the intent or side of a trade. This is either `BUY` or
2340
2346
  `SELL`.
@@ -2357,9 +2363,6 @@ immediately will be canceled.
2357
2363
  ##### account_id: `String`<a id="account_id-string"></a>
2358
2364
  The ID of the account to execute the trade on.
2359
2365
 
2360
- ##### brokerage_order_id: `String`<a id="brokerage_order_id-string"></a>
2361
- The Brokerage Order ID of the order to replace.
2362
-
2363
2366
  ##### user_id: `String`<a id="user_id-string"></a>
2364
2367
  ##### user_secret: `String`<a id="user_secret-string"></a>
2365
2368
  ##### price: `Float`<a id="price-float"></a>
@@ -2378,7 +2381,7 @@ The price at which a stop order is triggered for `Stop` and `StopLimit` orders.
2378
2381
 
2379
2382
  #### 🌐 Endpoint<a id="🌐-endpoint"></a>
2380
2383
 
2381
- `/accounts/{accountId}/trading/simple/{brokerageOrderId}/replace` `PATCH`
2384
+ `/accounts/{accountId}/trading/replace` `POST`
2382
2385
 
2383
2386
  [🔙 **Back to Table of Contents**](#table-of-contents)
2384
2387