snaptrade-typescript-sdk 9.0.199 → 10.0.1

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.
Files changed (427) hide show
  1. package/README.md +42 -2
  2. package/dist/chunk-e9Ob2GDo.mjs +26 -0
  3. package/dist/index.cjs +6594 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +1 -0
  6. package/dist/index.d.mts +10422 -0
  7. package/dist/index.d.ts +1 -5
  8. package/dist/index.mjs +6527 -0
  9. package/dist/index.mjs.map +1 -0
  10. package/package.json +27 -13
  11. package/dist/api/account-information-api-generated.d.ts +0 -950
  12. package/dist/api/account-information-api-generated.js +0 -1372
  13. package/dist/api/account-information-api.d.ts +0 -4
  14. package/dist/api/account-information-api.js +0 -22
  15. package/dist/api/api-status-api-generated.d.ts +0 -59
  16. package/dist/api/api-status-api-generated.js +0 -133
  17. package/dist/api/api-status-api.d.ts +0 -4
  18. package/dist/api/api-status-api.js +0 -22
  19. package/dist/api/authentication-api-generated.d.ts +0 -241
  20. package/dist/api/authentication-api-generated.js +0 -482
  21. package/dist/api/authentication-api.d.ts +0 -4
  22. package/dist/api/authentication-api.js +0 -22
  23. package/dist/api/connections-api-generated.d.ts +0 -576
  24. package/dist/api/connections-api-generated.js +0 -868
  25. package/dist/api/connections-api.d.ts +0 -4
  26. package/dist/api/connections-api.js +0 -22
  27. package/dist/api/options-api-generated.d.ts +0 -90
  28. package/dist/api/options-api-generated.js +0 -158
  29. package/dist/api/options-api.d.ts +0 -4
  30. package/dist/api/options-api.js +0 -22
  31. package/dist/api/reference-data-api-generated.d.ts +0 -497
  32. package/dist/api/reference-data-api-generated.js +0 -973
  33. package/dist/api/reference-data-api.d.ts +0 -4
  34. package/dist/api/reference-data-api.js +0 -22
  35. package/dist/api/trading-api-generated.d.ts +0 -1054
  36. package/dist/api/trading-api-generated.js +0 -1684
  37. package/dist/api/trading-api.d.ts +0 -4
  38. package/dist/api/trading-api.js +0 -22
  39. package/dist/api/transactions-and-reporting-api-generated.d.ts +0 -215
  40. package/dist/api/transactions-and-reporting-api-generated.js +0 -299
  41. package/dist/api/transactions-and-reporting-api.d.ts +0 -4
  42. package/dist/api/transactions-and-reporting-api.js +0 -22
  43. package/dist/api.d.ts +0 -8
  44. package/dist/api.js +0 -36
  45. package/dist/base.d.ts +0 -44
  46. package/dist/base.js +0 -60
  47. package/dist/browser.js +0 -2
  48. package/dist/browser.js.LICENSE.txt +0 -1
  49. package/dist/client-custom.d.ts +0 -4
  50. package/dist/client-custom.js +0 -7
  51. package/dist/client.d.ts +0 -14
  52. package/dist/client.js +0 -31
  53. package/dist/common.d.ts +0 -61
  54. package/dist/common.js +0 -220
  55. package/dist/configuration.d.ts +0 -98
  56. package/dist/configuration.js +0 -53
  57. package/dist/error.d.ts +0 -46
  58. package/dist/error.js +0 -105
  59. package/dist/index.js +0 -33
  60. package/dist/jest.config.d.ts +0 -3
  61. package/dist/jest.config.js +0 -13
  62. package/dist/mock.test.d.ts +0 -1
  63. package/dist/mock.test.js +0 -29
  64. package/dist/models/account-balance-total.d.ts +0 -19
  65. package/dist/models/account-balance-total.js +0 -2
  66. package/dist/models/account-balance.d.ts +0 -14
  67. package/dist/models/account-balance.js +0 -2
  68. package/dist/models/account-holdings-account.d.ts +0 -51
  69. package/dist/models/account-holdings-account.js +0 -2
  70. package/dist/models/account-holdings.d.ts +0 -37
  71. package/dist/models/account-holdings.js +0 -2
  72. package/dist/models/account-information-get-user-account-order-detail-request.d.ts +0 -13
  73. package/dist/models/account-information-get-user-account-order-detail-request.js +0 -2
  74. package/dist/models/account-order-record-child-brokerage-order-ids.d.ts +0 -19
  75. package/dist/models/account-order-record-child-brokerage-order-ids.js +0 -2
  76. package/dist/models/account-order-record-leg-instrument.d.ts +0 -38
  77. package/dist/models/account-order-record-leg-instrument.js +0 -2
  78. package/dist/models/account-order-record-leg.d.ts +0 -58
  79. package/dist/models/account-order-record-leg.js +0 -2
  80. package/dist/models/account-order-record-option-symbol.d.ts +0 -52
  81. package/dist/models/account-order-record-option-symbol.js +0 -2
  82. package/dist/models/account-order-record-quote-currency.d.ts +0 -25
  83. package/dist/models/account-order-record-quote-currency.js +0 -2
  84. package/dist/models/account-order-record-quote-universal-symbol.d.ts +0 -73
  85. package/dist/models/account-order-record-quote-universal-symbol.js +0 -2
  86. package/dist/models/account-order-record-status-v2.d.ts +0 -6
  87. package/dist/models/account-order-record-status-v2.js +0 -2
  88. package/dist/models/account-order-record-status.d.ts +0 -6
  89. package/dist/models/account-order-record-status.js +0 -2
  90. package/dist/models/account-order-record-trailing-stop.d.ts +0 -21
  91. package/dist/models/account-order-record-trailing-stop.js +0 -2
  92. package/dist/models/account-order-record-universal-symbol.d.ts +0 -73
  93. package/dist/models/account-order-record-universal-symbol.js +0 -2
  94. package/dist/models/account-order-record-v2.d.ts +0 -97
  95. package/dist/models/account-order-record-v2.js +0 -2
  96. package/dist/models/account-order-record.d.ts +0 -168
  97. package/dist/models/account-order-record.js +0 -2
  98. package/dist/models/account-orders-v2-response.d.ts +0 -15
  99. package/dist/models/account-orders-v2-response.js +0 -2
  100. package/dist/models/account-position.d.ts +0 -52
  101. package/dist/models/account-position.js +0 -2
  102. package/dist/models/account-simple.d.ts +0 -39
  103. package/dist/models/account-simple.js +0 -2
  104. package/dist/models/account-sync-status.d.ts +0 -21
  105. package/dist/models/account-sync-status.js +0 -2
  106. package/dist/models/account-universal-activity-currency.d.ts +0 -25
  107. package/dist/models/account-universal-activity-currency.js +0 -2
  108. package/dist/models/account-universal-activity-option-symbol.d.ts +0 -52
  109. package/dist/models/account-universal-activity-option-symbol.js +0 -2
  110. package/dist/models/account-universal-activity-symbol.d.ts +0 -65
  111. package/dist/models/account-universal-activity-symbol.js +0 -2
  112. package/dist/models/account-universal-activity.d.ts +0 -107
  113. package/dist/models/account-universal-activity.js +0 -2
  114. package/dist/models/account-value-history-item.d.ts +0 -20
  115. package/dist/models/account-value-history-item.js +0 -2
  116. package/dist/models/account-value-history-response.d.ts +0 -21
  117. package/dist/models/account-value-history-response.js +0 -2
  118. package/dist/models/account.d.ts +0 -126
  119. package/dist/models/account.js +0 -2
  120. package/dist/models/action-strict-with-options.d.ts +0 -6
  121. package/dist/models/action-strict-with-options.js +0 -2
  122. package/dist/models/action-strict.d.ts +0 -6
  123. package/dist/models/action-strict.js +0 -2
  124. package/dist/models/adr-instrument.d.ts +0 -59
  125. package/dist/models/adr-instrument.js +0 -2
  126. package/dist/models/all-account-positions-response.d.ts +0 -15
  127. package/dist/models/all-account-positions-response.js +0 -2
  128. package/dist/models/authentication-login-snap-trade-user200-response.d.ts +0 -7
  129. package/dist/models/authentication-login-snap-trade-user200-response.js +0 -2
  130. package/dist/models/balance-currency.d.ts +0 -25
  131. package/dist/models/balance-currency.js +0 -2
  132. package/dist/models/balance.d.ts +0 -27
  133. package/dist/models/balance.js +0 -2
  134. package/dist/models/brokerage-authorization-disabled-confirmation.d.ts +0 -14
  135. package/dist/models/brokerage-authorization-disabled-confirmation.js +0 -2
  136. package/dist/models/brokerage-authorization-refresh-confirmation.d.ts +0 -14
  137. package/dist/models/brokerage-authorization-refresh-confirmation.js +0 -2
  138. package/dist/models/brokerage-authorization-transactions-sync-confirmation.d.ts +0 -14
  139. package/dist/models/brokerage-authorization-transactions-sync-confirmation.js +0 -2
  140. package/dist/models/brokerage-authorization-type-read-only-brokerage.d.ts +0 -26
  141. package/dist/models/brokerage-authorization-type-read-only-brokerage.js +0 -2
  142. package/dist/models/brokerage-authorization-type-read-only.d.ts +0 -36
  143. package/dist/models/brokerage-authorization-type-read-only.js +0 -2
  144. package/dist/models/brokerage-authorization.d.ts +0 -73
  145. package/dist/models/brokerage-authorization.js +0 -2
  146. package/dist/models/brokerage-instrument.d.ts +0 -38
  147. package/dist/models/brokerage-instrument.js +0 -2
  148. package/dist/models/brokerage-instruments-response.d.ts +0 -15
  149. package/dist/models/brokerage-instruments-response.js +0 -2
  150. package/dist/models/brokerage-type.d.ts +0 -20
  151. package/dist/models/brokerage-type.js +0 -2
  152. package/dist/models/brokerage.d.ts +0 -122
  153. package/dist/models/brokerage.js +0 -2
  154. package/dist/models/cancel-order-response.d.ts +0 -22
  155. package/dist/models/cancel-order-response.js +0 -2
  156. package/dist/models/cef-instrument.d.ts +0 -59
  157. package/dist/models/cef-instrument.js +0 -2
  158. package/dist/models/child-brokerage-order-ids.d.ts +0 -20
  159. package/dist/models/child-brokerage-order-ids.js +0 -2
  160. package/dist/models/complex-order-leg.d.ts +0 -62
  161. package/dist/models/complex-order-leg.js +0 -2
  162. package/dist/models/complex-order-response.d.ts +0 -22
  163. package/dist/models/complex-order-response.js +0 -2
  164. package/dist/models/connections-session-events200-response-inner.d.ts +0 -6
  165. package/dist/models/connections-session-events200-response-inner.js +0 -2
  166. package/dist/models/crypto-instrument.d.ts +0 -59
  167. package/dist/models/crypto-instrument.js +0 -2
  168. package/dist/models/crypto-order-form.d.ts +0 -66
  169. package/dist/models/crypto-order-form.js +0 -2
  170. package/dist/models/crypto-order-preview-estimated-fee.d.ts +0 -20
  171. package/dist/models/crypto-order-preview-estimated-fee.js +0 -2
  172. package/dist/models/crypto-order-preview.d.ts +0 -15
  173. package/dist/models/crypto-order-preview.js +0 -2
  174. package/dist/models/crypto-trading-instrument.d.ts +0 -22
  175. package/dist/models/crypto-trading-instrument.js +0 -2
  176. package/dist/models/cryptocurrency-pair-quote.d.ts +0 -32
  177. package/dist/models/cryptocurrency-pair-quote.js +0 -2
  178. package/dist/models/cryptocurrency-pair.d.ts +0 -32
  179. package/dist/models/cryptocurrency-pair.js +0 -2
  180. package/dist/models/currency.d.ts +0 -26
  181. package/dist/models/currency.js +0 -2
  182. package/dist/models/delete-connection-confirmation.d.ts +0 -20
  183. package/dist/models/delete-connection-confirmation.js +0 -2
  184. package/dist/models/delete-user-response.d.ts +0 -26
  185. package/dist/models/delete-user-response.js +0 -2
  186. package/dist/models/dividend-at-date.d.ts +0 -26
  187. package/dist/models/dividend-at-date.js +0 -2
  188. package/dist/models/encrypted-response-encrypted-message-data.d.ts +0 -26
  189. package/dist/models/encrypted-response-encrypted-message-data.js +0 -2
  190. package/dist/models/encrypted-response.d.ts +0 -20
  191. package/dist/models/encrypted-response.js +0 -2
  192. package/dist/models/etf-instrument.d.ts +0 -59
  193. package/dist/models/etf-instrument.js +0 -2
  194. package/dist/models/exchange-rate-pairs.d.ts +0 -27
  195. package/dist/models/exchange-rate-pairs.js +0 -2
  196. package/dist/models/exchange.d.ts +0 -56
  197. package/dist/models/exchange.js +0 -2
  198. package/dist/models/figi-instrument.d.ts +0 -20
  199. package/dist/models/figi-instrument.js +0 -2
  200. package/dist/models/future-instrument.d.ts +0 -64
  201. package/dist/models/future-instrument.js +0 -2
  202. package/dist/models/holdings-status.d.ts +0 -19
  203. package/dist/models/holdings-status.js +0 -2
  204. package/dist/models/index.d.ts +0 -173
  205. package/dist/models/index.js +0 -189
  206. package/dist/models/instrument.d.ts +0 -33
  207. package/dist/models/instrument.js +0 -2
  208. package/dist/models/login-redirect-uri.d.ts +0 -19
  209. package/dist/models/login-redirect-uri.js +0 -2
  210. package/dist/models/manual-trade-and-impact.d.ts +0 -29
  211. package/dist/models/manual-trade-and-impact.js +0 -2
  212. package/dist/models/manual-trade-balance.d.ts +0 -28
  213. package/dist/models/manual-trade-balance.js +0 -2
  214. package/dist/models/manual-trade-form-bracket.d.ts +0 -67
  215. package/dist/models/manual-trade-form-bracket.js +0 -2
  216. package/dist/models/manual-trade-form-complex.d.ts +0 -28
  217. package/dist/models/manual-trade-form-complex.js +0 -2
  218. package/dist/models/manual-trade-form-notional-value.d.ts +0 -6
  219. package/dist/models/manual-trade-form-notional-value.js +0 -2
  220. package/dist/models/manual-trade-form-with-options.d.ts +0 -78
  221. package/dist/models/manual-trade-form-with-options.js +0 -2
  222. package/dist/models/manual-trade-form.d.ts +0 -65
  223. package/dist/models/manual-trade-form.js +0 -2
  224. package/dist/models/manual-trade-impact.d.ts +0 -38
  225. package/dist/models/manual-trade-impact.js +0 -2
  226. package/dist/models/manual-trade-replace-form.d.ts +0 -58
  227. package/dist/models/manual-trade-replace-form.js +0 -2
  228. package/dist/models/manual-trade-symbol.d.ts +0 -49
  229. package/dist/models/manual-trade-symbol.js +0 -2
  230. package/dist/models/manual-trade.d.ts +0 -60
  231. package/dist/models/manual-trade.js +0 -2
  232. package/dist/models/mleg-action-strict.d.ts +0 -6
  233. package/dist/models/mleg-action-strict.js +0 -2
  234. package/dist/models/mleg-instrument-type.d.ts +0 -6
  235. package/dist/models/mleg-instrument-type.js +0 -2
  236. package/dist/models/mleg-leg.d.ts +0 -28
  237. package/dist/models/mleg-leg.js +0 -2
  238. package/dist/models/mleg-order-response.d.ts +0 -21
  239. package/dist/models/mleg-order-response.js +0 -2
  240. package/dist/models/mleg-order-type-strict.d.ts +0 -6
  241. package/dist/models/mleg-order-type-strict.js +0 -2
  242. package/dist/models/mleg-price-effect-strict.d.ts +0 -6
  243. package/dist/models/mleg-price-effect-strict.js +0 -2
  244. package/dist/models/mleg-trade-form.d.ts +0 -47
  245. package/dist/models/mleg-trade-form.js +0 -2
  246. package/dist/models/mleg-trading-instrument.d.ts +0 -21
  247. package/dist/models/mleg-trading-instrument.js +0 -2
  248. package/dist/models/model400-failed-request-response.d.ts +0 -20
  249. package/dist/models/model400-failed-request-response.js +0 -2
  250. package/dist/models/model401-failed-request-response.d.ts +0 -20
  251. package/dist/models/model401-failed-request-response.js +0 -2
  252. package/dist/models/model402-brokerage-auth-already-disabled-exception.d.ts +0 -20
  253. package/dist/models/model402-brokerage-auth-already-disabled-exception.js +0 -2
  254. package/dist/models/model402-brokerage-auth-disabled-response.d.ts +0 -20
  255. package/dist/models/model402-brokerage-auth-disabled-response.js +0 -2
  256. package/dist/models/model403-failed-request-response.d.ts +0 -20
  257. package/dist/models/model403-failed-request-response.js +0 -2
  258. package/dist/models/model403-feature-not-enabled-response.d.ts +0 -20
  259. package/dist/models/model403-feature-not-enabled-response.js +0 -2
  260. package/dist/models/model404-failed-request-response.d.ts +0 -20
  261. package/dist/models/model404-failed-request-response.js +0 -2
  262. package/dist/models/model425-failed-request-response.d.ts +0 -20
  263. package/dist/models/model425-failed-request-response.js +0 -2
  264. package/dist/models/model500-unexpected-exception-response.d.ts +0 -26
  265. package/dist/models/model500-unexpected-exception-response.js +0 -2
  266. package/dist/models/monthly-dividends.d.ts +0 -21
  267. package/dist/models/monthly-dividends.js +0 -2
  268. package/dist/models/mutual-fund-instrument.d.ts +0 -59
  269. package/dist/models/mutual-fund-instrument.js +0 -2
  270. package/dist/models/net-contributions.d.ts +0 -26
  271. package/dist/models/net-contributions.js +0 -2
  272. package/dist/models/net-dividend.d.ts +0 -27
  273. package/dist/models/net-dividend.js +0 -2
  274. package/dist/models/notional-value.d.ts +0 -6
  275. package/dist/models/notional-value.js +0 -2
  276. package/dist/models/option-brokerage-symbol.d.ts +0 -29
  277. package/dist/models/option-brokerage-symbol.js +0 -2
  278. package/dist/models/option-chain-inner-chain-per-root-inner-chain-per-strike-price-inner.d.ts +0 -26
  279. package/dist/models/option-chain-inner-chain-per-root-inner-chain-per-strike-price-inner.js +0 -2
  280. package/dist/models/option-chain-inner-chain-per-root-inner.d.ts +0 -27
  281. package/dist/models/option-chain-inner-chain-per-root-inner.js +0 -2
  282. package/dist/models/option-chain-inner.d.ts +0 -39
  283. package/dist/models/option-chain-inner.js +0 -2
  284. package/dist/models/option-impact.d.ts +0 -28
  285. package/dist/models/option-impact.js +0 -2
  286. package/dist/models/option-instrument.d.ts +0 -60
  287. package/dist/models/option-instrument.js +0 -2
  288. package/dist/models/option-leg.d.ts +0 -28
  289. package/dist/models/option-leg.js +0 -2
  290. package/dist/models/option-quote-greeks.d.ts +0 -32
  291. package/dist/models/option-quote-greeks.js +0 -2
  292. package/dist/models/option-quote.d.ts +0 -39
  293. package/dist/models/option-quote.js +0 -2
  294. package/dist/models/option-strategy-legs-inner.d.ts +0 -31
  295. package/dist/models/option-strategy-legs-inner.js +0 -2
  296. package/dist/models/option-strategy.d.ts +0 -40
  297. package/dist/models/option-strategy.js +0 -2
  298. package/dist/models/options-position-currency.d.ts +0 -25
  299. package/dist/models/options-position-currency.js +0 -2
  300. package/dist/models/options-position.d.ts +0 -41
  301. package/dist/models/options-position.js +0 -2
  302. package/dist/models/options-symbol.d.ts +0 -53
  303. package/dist/models/options-symbol.js +0 -2
  304. package/dist/models/order-type-strict.d.ts +0 -6
  305. package/dist/models/order-type-strict.js +0 -2
  306. package/dist/models/order-updated-response-order.d.ts +0 -167
  307. package/dist/models/order-updated-response-order.js +0 -2
  308. package/dist/models/order-updated-response.d.ts +0 -21
  309. package/dist/models/order-updated-response.js +0 -2
  310. package/dist/models/other-instrument.d.ts +0 -59
  311. package/dist/models/other-instrument.js +0 -2
  312. package/dist/models/paginated-universal-activity.d.ts +0 -22
  313. package/dist/models/paginated-universal-activity.js +0 -2
  314. package/dist/models/pagination-details.d.ts +0 -26
  315. package/dist/models/pagination-details.js +0 -2
  316. package/dist/models/partner-data.d.ts +0 -82
  317. package/dist/models/partner-data.js +0 -2
  318. package/dist/models/past-value.d.ts +0 -26
  319. package/dist/models/past-value.js +0 -2
  320. package/dist/models/performance-custom.d.ts +0 -127
  321. package/dist/models/performance-custom.js +0 -2
  322. package/dist/models/position-currency.d.ts +0 -25
  323. package/dist/models/position-currency.js +0 -2
  324. package/dist/models/position-symbol.d.ts +0 -50
  325. package/dist/models/position-symbol.js +0 -2
  326. package/dist/models/position.d.ts +0 -66
  327. package/dist/models/position.js +0 -2
  328. package/dist/models/rate-of-return-object.d.ts +0 -28
  329. package/dist/models/rate-of-return-object.js +0 -2
  330. package/dist/models/rate-of-return-response.d.ts +0 -15
  331. package/dist/models/rate-of-return-response.js +0 -2
  332. package/dist/models/recent-orders-response.d.ts +0 -15
  333. package/dist/models/recent-orders-response.js +0 -2
  334. package/dist/models/security-type.d.ts +0 -33
  335. package/dist/models/security-type.js +0 -2
  336. package/dist/models/session-event.d.ts +0 -52
  337. package/dist/models/session-event.js +0 -2
  338. package/dist/models/simple-order-form.d.ts +0 -67
  339. package/dist/models/simple-order-form.js +0 -2
  340. package/dist/models/snap-trade-holdings-account.d.ts +0 -60
  341. package/dist/models/snap-trade-holdings-account.js +0 -2
  342. package/dist/models/snap-trade-holdings-total-value.d.ts +0 -20
  343. package/dist/models/snap-trade-holdings-total-value.js +0 -2
  344. package/dist/models/snap-trade-login-user-request-body.d.ts +0 -58
  345. package/dist/models/snap-trade-login-user-request-body.js +0 -2
  346. package/dist/models/snap-trade-register-user-request-body.d.ts +0 -13
  347. package/dist/models/snap-trade-register-user-request-body.js +0 -2
  348. package/dist/models/status.d.ts +0 -26
  349. package/dist/models/status.js +0 -2
  350. package/dist/models/stock-instrument-figi-instrument.d.ts +0 -19
  351. package/dist/models/stock-instrument-figi-instrument.js +0 -2
  352. package/dist/models/stock-instrument.d.ts +0 -59
  353. package/dist/models/stock-instrument.js +0 -2
  354. package/dist/models/stop-loss.d.ts +0 -20
  355. package/dist/models/stop-loss.js +0 -2
  356. package/dist/models/strategy-order-record.d.ts +0 -77
  357. package/dist/models/strategy-order-record.js +0 -2
  358. package/dist/models/strategy-quotes-greek.d.ts +0 -38
  359. package/dist/models/strategy-quotes-greek.js +0 -2
  360. package/dist/models/strategy-quotes.d.ts +0 -46
  361. package/dist/models/strategy-quotes.js +0 -2
  362. package/dist/models/sub-period-return-rate.d.ts +0 -26
  363. package/dist/models/sub-period-return-rate.js +0 -2
  364. package/dist/models/symbol-currency.d.ts +0 -25
  365. package/dist/models/symbol-currency.js +0 -2
  366. package/dist/models/symbol-exchange.d.ts +0 -55
  367. package/dist/models/symbol-exchange.js +0 -2
  368. package/dist/models/symbol-query.d.ts +0 -13
  369. package/dist/models/symbol-query.js +0 -2
  370. package/dist/models/symbol.d.ts +0 -66
  371. package/dist/models/symbol.js +0 -2
  372. package/dist/models/symbols-quotes-inner.d.ts +0 -44
  373. package/dist/models/symbols-quotes-inner.js +0 -2
  374. package/dist/models/take-profit.d.ts +0 -14
  375. package/dist/models/take-profit.js +0 -2
  376. package/dist/models/tax-lot.d.ts +0 -50
  377. package/dist/models/tax-lot.js +0 -2
  378. package/dist/models/time-in-force-strict.d.ts +0 -6
  379. package/dist/models/time-in-force-strict.js +0 -2
  380. package/dist/models/trade-detection-cancel-subscription-response.d.ts +0 -14
  381. package/dist/models/trade-detection-cancel-subscription-response.js +0 -2
  382. package/dist/models/trade-detection-subscription.d.ts +0 -26
  383. package/dist/models/trade-detection-subscription.js +0 -2
  384. package/dist/models/trading-instrument.d.ts +0 -22
  385. package/dist/models/trading-instrument.js +0 -2
  386. package/dist/models/trading-search-cryptocurrency-pair-instruments200-response.d.ts +0 -15
  387. package/dist/models/trading-search-cryptocurrency-pair-instruments200-response.js +0 -2
  388. package/dist/models/trading-session.d.ts +0 -6
  389. package/dist/models/trading-session.js +0 -2
  390. package/dist/models/trailing-stop.d.ts +0 -22
  391. package/dist/models/trailing-stop.js +0 -2
  392. package/dist/models/transactions-status.d.ts +0 -25
  393. package/dist/models/transactions-status.js +0 -2
  394. package/dist/models/underlying-option-instrument.d.ts +0 -27
  395. package/dist/models/underlying-option-instrument.js +0 -2
  396. package/dist/models/underlying-symbol-exchange.d.ts +0 -61
  397. package/dist/models/underlying-symbol-exchange.js +0 -2
  398. package/dist/models/underlying-symbol-type.d.ts +0 -32
  399. package/dist/models/underlying-symbol-type.js +0 -2
  400. package/dist/models/underlying-symbol.d.ts +0 -74
  401. package/dist/models/underlying-symbol.js +0 -2
  402. package/dist/models/universal-activity.d.ts +0 -114
  403. package/dist/models/universal-activity.js +0 -2
  404. package/dist/models/universal-symbol.d.ts +0 -74
  405. package/dist/models/universal-symbol.js +0 -2
  406. package/dist/models/user-idand-secret.d.ts +0 -19
  407. package/dist/models/user-idand-secret.js +0 -2
  408. package/dist/models/usexchange.d.ts +0 -62
  409. package/dist/models/usexchange.js +0 -2
  410. package/dist/models/validated-trade-body.d.ts +0 -13
  411. package/dist/models/validated-trade-body.js +0 -2
  412. package/dist/operationParameterMap.d.ts +0 -8
  413. package/dist/operationParameterMap.js +0 -966
  414. package/dist/pagination/page-types.d.ts +0 -16
  415. package/dist/pagination/page-types.js +0 -12
  416. package/dist/pagination/page.d.ts +0 -25
  417. package/dist/pagination/page.js +0 -32
  418. package/dist/pagination/pageable.d.ts +0 -47
  419. package/dist/pagination/pageable.js +0 -70
  420. package/dist/pagination/paginate.d.ts +0 -6
  421. package/dist/pagination/paginate.js +0 -39
  422. package/dist/requestAfterHook.d.ts +0 -8
  423. package/dist/requestAfterHook.js +0 -82
  424. package/dist/requestBeforeHook.d.ts +0 -10
  425. package/dist/requestBeforeHook.js +0 -8
  426. package/dist/requestBeforeUrlHook.d.ts +0 -7
  427. package/dist/requestBeforeUrlHook.js +0 -5
@@ -1,1684 +0,0 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- /*
5
- SnapTrade
6
-
7
- Connect brokerage accounts to your app for live positions and trading
8
-
9
- The version of the OpenAPI document: 1.0.0
10
- Contact: api@snaptrade.com
11
-
12
- NOTE: This file is auto generated by Konfig (https://konfigthis.com).
13
- */
14
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
- return new (P || (P = Promise))(function (resolve, reject) {
17
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
- step((generator = generator.apply(thisArg, _arguments || [])).next());
21
- });
22
- };
23
- Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.TradingApiGenerated = exports.TradingApiFactory = exports.TradingApiFp = exports.TradingApiAxiosParamCreator = void 0;
25
- const axios_1 = require("axios");
26
- // Some imports not used depending on template conditions
27
- // @ts-ignore
28
- const common_1 = require("../common");
29
- // @ts-ignore
30
- const base_1 = require("../base");
31
- const requestBeforeHook_1 = require("../requestBeforeHook");
32
- /**
33
- * TradingApi - axios parameter creator
34
- * @export
35
- */
36
- const TradingApiAxiosParamCreator = function (configuration) {
37
- return {
38
- /**
39
- * Cancels an order in the specified account. Accepts order IDs for all asset types.
40
- * @summary Cancel order
41
- * @param {string} userId
42
- * @param {string} userSecret
43
- * @param {string} accountId
44
- * @param {AccountInformationGetUserAccountOrderDetailRequest} accountInformationGetUserAccountOrderDetailRequest
45
- * @param {*} [options] Override http request option.
46
- * @throws {RequiredError}
47
- */
48
- cancelOrder: (userId, userSecret, accountId, accountInformationGetUserAccountOrderDetailRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
49
- // verify required parameter 'userId' is not null or undefined
50
- (0, common_1.assertParamExists)('cancelOrder', 'userId', userId);
51
- // verify required parameter 'userSecret' is not null or undefined
52
- (0, common_1.assertParamExists)('cancelOrder', 'userSecret', userSecret);
53
- // verify required parameter 'accountId' is not null or undefined
54
- (0, common_1.assertParamExists)('cancelOrder', 'accountId', accountId);
55
- // verify required parameter 'accountInformationGetUserAccountOrderDetailRequest' is not null or undefined
56
- (0, common_1.assertParamExists)('cancelOrder', 'accountInformationGetUserAccountOrderDetailRequest', accountInformationGetUserAccountOrderDetailRequest);
57
- const localVarPath = `/accounts/{accountId}/trading/cancel`
58
- .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
59
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
60
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
61
- let baseOptions;
62
- if (configuration) {
63
- baseOptions = configuration.baseOptions;
64
- }
65
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
66
- const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
67
- const localVarQueryParameter = {};
68
- // authentication PartnerClientId required
69
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
70
- // authentication PartnerSignature required
71
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
72
- // authentication PartnerTimestamp required
73
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
74
- if (userId !== undefined) {
75
- localVarQueryParameter['userId'] = userId;
76
- }
77
- if (userSecret !== undefined) {
78
- localVarQueryParameter['userSecret'] = userSecret;
79
- }
80
- localVarHeaderParameter['Content-Type'] = 'application/json';
81
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
82
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
83
- (0, requestBeforeHook_1.requestBeforeHook)({
84
- requestBody: accountInformationGetUserAccountOrderDetailRequest,
85
- queryParameters: localVarQueryParameter,
86
- requestConfig: localVarRequestOptions,
87
- path: localVarPath,
88
- configuration,
89
- pathTemplate: '/accounts/{accountId}/trading/cancel',
90
- httpMethod: 'POST'
91
- });
92
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(accountInformationGetUserAccountOrderDetailRequest, localVarRequestOptions, configuration);
93
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
94
- return {
95
- url: (0, common_1.toPathString)(localVarUrlObj),
96
- options: localVarRequestOptions,
97
- };
98
- }),
99
- /**
100
- * **This endpoint is deprecated. Please switch to [the new cancel order endpoint](/reference/Trading/Trading_cancelOrder) ** Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
101
- * @summary Cancel equity order
102
- * @param {string} userId
103
- * @param {string} userSecret
104
- * @param {string} accountId
105
- * @param {AccountInformationGetUserAccountOrderDetailRequest} accountInformationGetUserAccountOrderDetailRequest
106
- * @param {*} [options] Override http request option.
107
- * @deprecated
108
- * @throws {RequiredError}
109
- */
110
- cancelUserAccountOrder: (userId, userSecret, accountId, accountInformationGetUserAccountOrderDetailRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
111
- // verify required parameter 'userId' is not null or undefined
112
- (0, common_1.assertParamExists)('cancelUserAccountOrder', 'userId', userId);
113
- // verify required parameter 'userSecret' is not null or undefined
114
- (0, common_1.assertParamExists)('cancelUserAccountOrder', 'userSecret', userSecret);
115
- // verify required parameter 'accountId' is not null or undefined
116
- (0, common_1.assertParamExists)('cancelUserAccountOrder', 'accountId', accountId);
117
- // verify required parameter 'accountInformationGetUserAccountOrderDetailRequest' is not null or undefined
118
- (0, common_1.assertParamExists)('cancelUserAccountOrder', 'accountInformationGetUserAccountOrderDetailRequest', accountInformationGetUserAccountOrderDetailRequest);
119
- const localVarPath = `/accounts/{accountId}/orders/cancel`
120
- .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
121
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
122
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
123
- let baseOptions;
124
- if (configuration) {
125
- baseOptions = configuration.baseOptions;
126
- }
127
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
128
- const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
129
- const localVarQueryParameter = {};
130
- // authentication PartnerClientId required
131
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
132
- // authentication PartnerSignature required
133
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
134
- // authentication PartnerTimestamp required
135
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
136
- if (userId !== undefined) {
137
- localVarQueryParameter['userId'] = userId;
138
- }
139
- if (userSecret !== undefined) {
140
- localVarQueryParameter['userSecret'] = userSecret;
141
- }
142
- localVarHeaderParameter['Content-Type'] = 'application/json';
143
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
144
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
145
- (0, requestBeforeHook_1.requestBeforeHook)({
146
- requestBody: accountInformationGetUserAccountOrderDetailRequest,
147
- queryParameters: localVarQueryParameter,
148
- requestConfig: localVarRequestOptions,
149
- path: localVarPath,
150
- configuration,
151
- pathTemplate: '/accounts/{accountId}/orders/cancel',
152
- httpMethod: 'POST'
153
- });
154
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(accountInformationGetUserAccountOrderDetailRequest, localVarRequestOptions, configuration);
155
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
156
- return {
157
- url: (0, common_1.toPathString)(localVarUrlObj),
158
- options: localVarRequestOptions,
159
- };
160
- }),
161
- /**
162
- * Gets a quote for the specified account.
163
- * @summary Get crypto pair quote
164
- * @param {string} userId
165
- * @param {string} userSecret
166
- * @param {string} accountId
167
- * @param {string} instrumentSymbol
168
- * @param {*} [options] Override http request option.
169
- * @throws {RequiredError}
170
- */
171
- getCryptocurrencyPairQuote: (userId, userSecret, accountId, instrumentSymbol, options = {}) => __awaiter(this, void 0, void 0, function* () {
172
- // verify required parameter 'userId' is not null or undefined
173
- (0, common_1.assertParamExists)('getCryptocurrencyPairQuote', 'userId', userId);
174
- // verify required parameter 'userSecret' is not null or undefined
175
- (0, common_1.assertParamExists)('getCryptocurrencyPairQuote', 'userSecret', userSecret);
176
- // verify required parameter 'accountId' is not null or undefined
177
- (0, common_1.assertParamExists)('getCryptocurrencyPairQuote', 'accountId', accountId);
178
- // verify required parameter 'instrumentSymbol' is not null or undefined
179
- (0, common_1.assertParamExists)('getCryptocurrencyPairQuote', 'instrumentSymbol', instrumentSymbol);
180
- const localVarPath = `/accounts/{accountId}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote`
181
- .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)))
182
- .replace(`{${"instrumentSymbol"}}`, encodeURIComponent(String(instrumentSymbol !== undefined ? instrumentSymbol : `-instrumentSymbol-`)));
183
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
184
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
185
- let baseOptions;
186
- if (configuration) {
187
- baseOptions = configuration.baseOptions;
188
- }
189
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
190
- const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
191
- const localVarQueryParameter = {};
192
- // authentication PartnerClientId required
193
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
194
- // authentication PartnerSignature required
195
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
196
- // authentication PartnerTimestamp required
197
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
198
- if (userId !== undefined) {
199
- localVarQueryParameter['userId'] = userId;
200
- }
201
- if (userSecret !== undefined) {
202
- localVarQueryParameter['userSecret'] = userSecret;
203
- }
204
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
205
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
206
- (0, requestBeforeHook_1.requestBeforeHook)({
207
- queryParameters: localVarQueryParameter,
208
- requestConfig: localVarRequestOptions,
209
- path: localVarPath,
210
- configuration,
211
- pathTemplate: '/accounts/{accountId}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote',
212
- httpMethod: 'GET'
213
- });
214
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
215
- return {
216
- url: (0, common_1.toPathString)(localVarUrlObj),
217
- options: localVarRequestOptions,
218
- };
219
- }),
220
- /**
221
- * Simulates an option order with up to 4 legs and returns the estimated cost and transaction fees without placing it. Only supported for certain enabled brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for more information on which brokerages support this endpoint.
222
- * @summary Get option order impact
223
- * @param {string} userId
224
- * @param {string} userSecret
225
- * @param {string} accountId
226
- * @param {MlegTradeForm} mlegTradeForm
227
- * @param {*} [options] Override http request option.
228
- * @throws {RequiredError}
229
- */
230
- getOptionImpact: (userId, userSecret, accountId, mlegTradeForm, options = {}) => __awaiter(this, void 0, void 0, function* () {
231
- // verify required parameter 'userId' is not null or undefined
232
- (0, common_1.assertParamExists)('getOptionImpact', 'userId', userId);
233
- // verify required parameter 'userSecret' is not null or undefined
234
- (0, common_1.assertParamExists)('getOptionImpact', 'userSecret', userSecret);
235
- // verify required parameter 'accountId' is not null or undefined
236
- (0, common_1.assertParamExists)('getOptionImpact', 'accountId', accountId);
237
- // verify required parameter 'mlegTradeForm' is not null or undefined
238
- (0, common_1.assertParamExists)('getOptionImpact', 'mlegTradeForm', mlegTradeForm);
239
- const localVarPath = `/accounts/{accountId}/trading/options/impact`
240
- .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
241
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
242
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
243
- let baseOptions;
244
- if (configuration) {
245
- baseOptions = configuration.baseOptions;
246
- }
247
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
248
- const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
249
- const localVarQueryParameter = {};
250
- // authentication PartnerClientId required
251
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
252
- // authentication PartnerSignature required
253
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
254
- // authentication PartnerTimestamp required
255
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
256
- if (userId !== undefined) {
257
- localVarQueryParameter['userId'] = userId;
258
- }
259
- if (userSecret !== undefined) {
260
- localVarQueryParameter['userSecret'] = userSecret;
261
- }
262
- localVarHeaderParameter['Content-Type'] = 'application/json';
263
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
264
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
265
- (0, requestBeforeHook_1.requestBeforeHook)({
266
- requestBody: mlegTradeForm,
267
- queryParameters: localVarQueryParameter,
268
- requestConfig: localVarRequestOptions,
269
- path: localVarPath,
270
- configuration,
271
- pathTemplate: '/accounts/{accountId}/trading/options/impact',
272
- httpMethod: 'POST'
273
- });
274
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(mlegTradeForm, localVarRequestOptions, configuration);
275
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
276
- return {
277
- url: (0, common_1.toPathString)(localVarUrlObj),
278
- options: localVarRequestOptions,
279
- };
280
- }),
281
- /**
282
- * 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.
283
- * @summary Check equity order impact
284
- * @param {string} userId
285
- * @param {string} userSecret
286
- * @param {ManualTradeForm} manualTradeForm
287
- * @param {*} [options] Override http request option.
288
- * @throws {RequiredError}
289
- */
290
- getOrderImpact: (userId, userSecret, manualTradeForm, options = {}) => __awaiter(this, void 0, void 0, function* () {
291
- // verify required parameter 'userId' is not null or undefined
292
- (0, common_1.assertParamExists)('getOrderImpact', 'userId', userId);
293
- // verify required parameter 'userSecret' is not null or undefined
294
- (0, common_1.assertParamExists)('getOrderImpact', 'userSecret', userSecret);
295
- // verify required parameter 'manualTradeForm' is not null or undefined
296
- (0, common_1.assertParamExists)('getOrderImpact', 'manualTradeForm', manualTradeForm);
297
- const localVarPath = `/trade/impact`;
298
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
299
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
300
- let baseOptions;
301
- if (configuration) {
302
- baseOptions = configuration.baseOptions;
303
- }
304
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
305
- const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
306
- const localVarQueryParameter = {};
307
- // authentication PartnerClientId required
308
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
309
- // authentication PartnerSignature required
310
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
311
- // authentication PartnerTimestamp required
312
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
313
- if (userId !== undefined) {
314
- localVarQueryParameter['userId'] = userId;
315
- }
316
- if (userSecret !== undefined) {
317
- localVarQueryParameter['userSecret'] = userSecret;
318
- }
319
- localVarHeaderParameter['Content-Type'] = 'application/json';
320
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
321
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
322
- (0, requestBeforeHook_1.requestBeforeHook)({
323
- requestBody: manualTradeForm,
324
- queryParameters: localVarQueryParameter,
325
- requestConfig: localVarRequestOptions,
326
- path: localVarPath,
327
- configuration,
328
- pathTemplate: '/trade/impact',
329
- httpMethod: 'POST'
330
- });
331
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(manualTradeForm, localVarRequestOptions, configuration);
332
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
333
- return {
334
- url: (0, common_1.toPathString)(localVarUrlObj),
335
- options: localVarRequestOptions,
336
- };
337
- }),
338
- /**
339
- * Returns a quote for a single option contract. The option contract is specified using in the 21 character OCC format. For example `AAPL 251114C00240000` represents a call option on AAPL expiring on 2025-11-14 with a strike price of $240. For more information on the OCC format, see [here](https://en.wikipedia.org/wiki/Option_symbol#OCC_format) **Note:** These are derived values and are not suitable for trading purposes.
340
- * @summary Get option quote
341
- * @param {string} userId
342
- * @param {string} userSecret
343
- * @param {string} accountId
344
- * @param {string} symbol The OCC-formatted option symbol.
345
- * @param {*} [options] Override http request option.
346
- * @throws {RequiredError}
347
- */
348
- getUserAccountOptionQuotes: (userId, userSecret, accountId, symbol, options = {}) => __awaiter(this, void 0, void 0, function* () {
349
- // verify required parameter 'userId' is not null or undefined
350
- (0, common_1.assertParamExists)('getUserAccountOptionQuotes', 'userId', userId);
351
- // verify required parameter 'userSecret' is not null or undefined
352
- (0, common_1.assertParamExists)('getUserAccountOptionQuotes', 'userSecret', userSecret);
353
- // verify required parameter 'accountId' is not null or undefined
354
- (0, common_1.assertParamExists)('getUserAccountOptionQuotes', 'accountId', accountId);
355
- // verify required parameter 'symbol' is not null or undefined
356
- (0, common_1.assertParamExists)('getUserAccountOptionQuotes', 'symbol', symbol);
357
- const localVarPath = `/accounts/{accountId}/quotes/options`
358
- .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
359
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
360
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
361
- let baseOptions;
362
- if (configuration) {
363
- baseOptions = configuration.baseOptions;
364
- }
365
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
366
- const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
367
- const localVarQueryParameter = {};
368
- // authentication PartnerClientId required
369
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
370
- // authentication PartnerSignature required
371
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
372
- // authentication PartnerTimestamp required
373
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
374
- if (userId !== undefined) {
375
- localVarQueryParameter['userId'] = userId;
376
- }
377
- if (userSecret !== undefined) {
378
- localVarQueryParameter['userSecret'] = userSecret;
379
- }
380
- if (symbol !== undefined) {
381
- localVarQueryParameter['symbol'] = symbol;
382
- }
383
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
384
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
385
- (0, requestBeforeHook_1.requestBeforeHook)({
386
- queryParameters: localVarQueryParameter,
387
- requestConfig: localVarRequestOptions,
388
- path: localVarPath,
389
- configuration,
390
- pathTemplate: '/accounts/{accountId}/quotes/options',
391
- httpMethod: 'GET'
392
- });
393
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
394
- return {
395
- url: (0, common_1.toPathString)(localVarUrlObj),
396
- options: localVarRequestOptions,
397
- };
398
- }),
399
- /**
400
- * Returns a maximum of 10 quotes from the brokerage for the specified symbols and account. The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint. **This endpoint is not a substitute for a market data provider. Frequent polling of this endpoint may result in the disabling of your keys** This endpoint does not work for options quotes. This endpoint is disabled for free plans by default. Please contact support to enable this endpoint if needed.
401
- * @summary Get equity symbol quotes
402
- * @param {string} userId
403
- * @param {string} userSecret
404
- * @param {string} symbols List of Universal Symbol IDs or tickers to get quotes for. When providing multiple values, use a comma as separator. Maximum of 10 values allowed
405
- * @param {string} accountId
406
- * @param {boolean} [useTicker] Should be set to `True` if `symbols` are comprised of tickers. Defaults to `False` if not provided.
407
- * @param {*} [options] Override http request option.
408
- * @throws {RequiredError}
409
- */
410
- getUserAccountQuotes: (userId, userSecret, symbols, accountId, useTicker, options = {}) => __awaiter(this, void 0, void 0, function* () {
411
- // verify required parameter 'userId' is not null or undefined
412
- (0, common_1.assertParamExists)('getUserAccountQuotes', 'userId', userId);
413
- // verify required parameter 'userSecret' is not null or undefined
414
- (0, common_1.assertParamExists)('getUserAccountQuotes', 'userSecret', userSecret);
415
- // verify required parameter 'symbols' is not null or undefined
416
- (0, common_1.assertParamExists)('getUserAccountQuotes', 'symbols', symbols);
417
- // verify required parameter 'accountId' is not null or undefined
418
- (0, common_1.assertParamExists)('getUserAccountQuotes', 'accountId', accountId);
419
- const localVarPath = `/accounts/{accountId}/quotes`
420
- .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
421
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
422
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
423
- let baseOptions;
424
- if (configuration) {
425
- baseOptions = configuration.baseOptions;
426
- }
427
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
428
- const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
429
- const localVarQueryParameter = {};
430
- // authentication PartnerClientId required
431
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
432
- // authentication PartnerSignature required
433
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
434
- // authentication PartnerTimestamp required
435
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
436
- if (userId !== undefined) {
437
- localVarQueryParameter['userId'] = userId;
438
- }
439
- if (userSecret !== undefined) {
440
- localVarQueryParameter['userSecret'] = userSecret;
441
- }
442
- if (symbols !== undefined) {
443
- localVarQueryParameter['symbols'] = symbols;
444
- }
445
- if (useTicker !== undefined) {
446
- localVarQueryParameter['use_ticker'] = useTicker;
447
- }
448
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
449
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
450
- (0, requestBeforeHook_1.requestBeforeHook)({
451
- queryParameters: localVarQueryParameter,
452
- requestConfig: localVarRequestOptions,
453
- path: localVarPath,
454
- configuration,
455
- pathTemplate: '/accounts/{accountId}/quotes',
456
- httpMethod: 'GET'
457
- });
458
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
459
- return {
460
- url: (0, common_1.toPathString)(localVarUrlObj),
461
- options: localVarRequestOptions,
462
- };
463
- }),
464
- /**
465
- * Places a bracket order (entry order + OCO of stop loss and take profit). Disabled by default please contact support for use. Only supported on certain brokerages
466
- * @summary Place bracket order
467
- * @param {string} accountId The ID of the account to execute the trade on.
468
- * @param {string} userId
469
- * @param {string} userSecret
470
- * @param {ManualTradeFormBracket} manualTradeFormBracket
471
- * @param {*} [options] Override http request option.
472
- * @throws {RequiredError}
473
- */
474
- placeBracketOrder: (accountId, userId, userSecret, manualTradeFormBracket, options = {}) => __awaiter(this, void 0, void 0, function* () {
475
- // verify required parameter 'accountId' is not null or undefined
476
- (0, common_1.assertParamExists)('placeBracketOrder', 'accountId', accountId);
477
- // verify required parameter 'userId' is not null or undefined
478
- (0, common_1.assertParamExists)('placeBracketOrder', 'userId', userId);
479
- // verify required parameter 'userSecret' is not null or undefined
480
- (0, common_1.assertParamExists)('placeBracketOrder', 'userSecret', userSecret);
481
- // verify required parameter 'manualTradeFormBracket' is not null or undefined
482
- (0, common_1.assertParamExists)('placeBracketOrder', 'manualTradeFormBracket', manualTradeFormBracket);
483
- const localVarPath = `/accounts/{accountId}/trading/bracket`
484
- .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
485
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
486
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
487
- let baseOptions;
488
- if (configuration) {
489
- baseOptions = configuration.baseOptions;
490
- }
491
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
492
- const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
493
- const localVarQueryParameter = {};
494
- // authentication PartnerClientId required
495
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
496
- // authentication PartnerSignature required
497
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
498
- // authentication PartnerTimestamp required
499
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
500
- if (userId !== undefined) {
501
- localVarQueryParameter['userId'] = userId;
502
- }
503
- if (userSecret !== undefined) {
504
- localVarQueryParameter['userSecret'] = userSecret;
505
- }
506
- localVarHeaderParameter['Content-Type'] = 'application/json';
507
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
508
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
509
- (0, requestBeforeHook_1.requestBeforeHook)({
510
- requestBody: manualTradeFormBracket,
511
- queryParameters: localVarQueryParameter,
512
- requestConfig: localVarRequestOptions,
513
- path: localVarPath,
514
- configuration,
515
- pathTemplate: '/accounts/{accountId}/trading/bracket',
516
- httpMethod: 'POST'
517
- });
518
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(manualTradeFormBracket, localVarRequestOptions, configuration);
519
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
520
- return {
521
- url: (0, common_1.toPathString)(localVarUrlObj),
522
- options: localVarRequestOptions,
523
- };
524
- }),
525
- /**
526
- * Places a complex conditional order (OCO, OTO, or OTOCO). Disabled by default — contact support to enable. Only supported on certain brokerages. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
527
- * @summary Place complex order
528
- * @param {string} accountId The ID of the account to execute the trade on.
529
- * @param {string} userId
530
- * @param {string} userSecret
531
- * @param {ManualTradeFormComplex} manualTradeFormComplex
532
- * @param {*} [options] Override http request option.
533
- * @throws {RequiredError}
534
- */
535
- placeComplexOrder: (accountId, userId, userSecret, manualTradeFormComplex, options = {}) => __awaiter(this, void 0, void 0, function* () {
536
- // verify required parameter 'accountId' is not null or undefined
537
- (0, common_1.assertParamExists)('placeComplexOrder', 'accountId', accountId);
538
- // verify required parameter 'userId' is not null or undefined
539
- (0, common_1.assertParamExists)('placeComplexOrder', 'userId', userId);
540
- // verify required parameter 'userSecret' is not null or undefined
541
- (0, common_1.assertParamExists)('placeComplexOrder', 'userSecret', userSecret);
542
- // verify required parameter 'manualTradeFormComplex' is not null or undefined
543
- (0, common_1.assertParamExists)('placeComplexOrder', 'manualTradeFormComplex', manualTradeFormComplex);
544
- const localVarPath = `/accounts/{accountId}/trading/complex`
545
- .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
546
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
547
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
548
- let baseOptions;
549
- if (configuration) {
550
- baseOptions = configuration.baseOptions;
551
- }
552
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
553
- const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
554
- const localVarQueryParameter = {};
555
- // authentication PartnerClientId required
556
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
557
- // authentication PartnerSignature required
558
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
559
- // authentication PartnerTimestamp required
560
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
561
- if (userId !== undefined) {
562
- localVarQueryParameter['userId'] = userId;
563
- }
564
- if (userSecret !== undefined) {
565
- localVarQueryParameter['userSecret'] = userSecret;
566
- }
567
- localVarHeaderParameter['Content-Type'] = 'application/json';
568
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
569
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
570
- (0, requestBeforeHook_1.requestBeforeHook)({
571
- requestBody: manualTradeFormComplex,
572
- queryParameters: localVarQueryParameter,
573
- requestConfig: localVarRequestOptions,
574
- path: localVarPath,
575
- configuration,
576
- pathTemplate: '/accounts/{accountId}/trading/complex',
577
- httpMethod: 'POST'
578
- });
579
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(manualTradeFormComplex, localVarRequestOptions, configuration);
580
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
581
- return {
582
- url: (0, common_1.toPathString)(localVarUrlObj),
583
- options: localVarRequestOptions,
584
- };
585
- }),
586
- /**
587
- * 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.
588
- * @summary Place crypto order
589
- * @param {string} userId
590
- * @param {string} userSecret
591
- * @param {string} accountId
592
- * @param {CryptoOrderForm} cryptoOrderForm
593
- * @param {*} [options] Override http request option.
594
- * @throws {RequiredError}
595
- */
596
- placeCryptoOrder: (userId, userSecret, accountId, cryptoOrderForm, options = {}) => __awaiter(this, void 0, void 0, function* () {
597
- // verify required parameter 'userId' is not null or undefined
598
- (0, common_1.assertParamExists)('placeCryptoOrder', 'userId', userId);
599
- // verify required parameter 'userSecret' is not null or undefined
600
- (0, common_1.assertParamExists)('placeCryptoOrder', 'userSecret', userSecret);
601
- // verify required parameter 'accountId' is not null or undefined
602
- (0, common_1.assertParamExists)('placeCryptoOrder', 'accountId', accountId);
603
- // verify required parameter 'cryptoOrderForm' is not null or undefined
604
- (0, common_1.assertParamExists)('placeCryptoOrder', 'cryptoOrderForm', cryptoOrderForm);
605
- const localVarPath = `/accounts/{accountId}/trading/crypto`
606
- .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
607
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
608
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
609
- let baseOptions;
610
- if (configuration) {
611
- baseOptions = configuration.baseOptions;
612
- }
613
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
614
- const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
615
- const localVarQueryParameter = {};
616
- // authentication PartnerClientId required
617
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
618
- // authentication PartnerSignature required
619
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
620
- // authentication PartnerTimestamp required
621
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
622
- if (userId !== undefined) {
623
- localVarQueryParameter['userId'] = userId;
624
- }
625
- if (userSecret !== undefined) {
626
- localVarQueryParameter['userSecret'] = userSecret;
627
- }
628
- localVarHeaderParameter['Content-Type'] = 'application/json';
629
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
630
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
631
- (0, requestBeforeHook_1.requestBeforeHook)({
632
- requestBody: cryptoOrderForm,
633
- queryParameters: localVarQueryParameter,
634
- requestConfig: localVarRequestOptions,
635
- path: localVarPath,
636
- configuration,
637
- pathTemplate: '/accounts/{accountId}/trading/crypto',
638
- httpMethod: 'POST'
639
- });
640
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(cryptoOrderForm, localVarRequestOptions, configuration);
641
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
642
- return {
643
- url: (0, common_1.toPathString)(localVarUrlObj),
644
- options: localVarRequestOptions,
645
- };
646
- }),
647
- /**
648
- * 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. This endpoint does not compute the impact to the account balance from the order and any potential commissions before submitting the order to the brokerage. If that is desired, you can use the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). It\'s recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
649
- * @summary Place equity order
650
- * @param {string} userId
651
- * @param {string} userSecret
652
- * @param {ManualTradeFormWithOptions} manualTradeFormWithOptions
653
- * @param {*} [options] Override http request option.
654
- * @throws {RequiredError}
655
- */
656
- placeForceOrder: (userId, userSecret, manualTradeFormWithOptions, options = {}) => __awaiter(this, void 0, void 0, function* () {
657
- // verify required parameter 'userId' is not null or undefined
658
- (0, common_1.assertParamExists)('placeForceOrder', 'userId', userId);
659
- // verify required parameter 'userSecret' is not null or undefined
660
- (0, common_1.assertParamExists)('placeForceOrder', 'userSecret', userSecret);
661
- // verify required parameter 'manualTradeFormWithOptions' is not null or undefined
662
- (0, common_1.assertParamExists)('placeForceOrder', 'manualTradeFormWithOptions', manualTradeFormWithOptions);
663
- const localVarPath = `/trade/place`;
664
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
665
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
666
- let baseOptions;
667
- if (configuration) {
668
- baseOptions = configuration.baseOptions;
669
- }
670
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
671
- const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
672
- const localVarQueryParameter = {};
673
- // authentication PartnerClientId required
674
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
675
- // authentication PartnerSignature required
676
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
677
- // authentication PartnerTimestamp required
678
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
679
- if (userId !== undefined) {
680
- localVarQueryParameter['userId'] = userId;
681
- }
682
- if (userSecret !== undefined) {
683
- localVarQueryParameter['userSecret'] = userSecret;
684
- }
685
- localVarHeaderParameter['Content-Type'] = 'application/json';
686
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
687
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
688
- (0, requestBeforeHook_1.requestBeforeHook)({
689
- requestBody: manualTradeFormWithOptions,
690
- queryParameters: localVarQueryParameter,
691
- requestConfig: localVarRequestOptions,
692
- path: localVarPath,
693
- configuration,
694
- pathTemplate: '/trade/place',
695
- httpMethod: 'POST'
696
- });
697
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(manualTradeFormWithOptions, localVarRequestOptions, configuration);
698
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
699
- return {
700
- url: (0, common_1.toPathString)(localVarUrlObj),
701
- options: localVarRequestOptions,
702
- };
703
- }),
704
- /**
705
- * Places a multi-leg option order. Only supported on certain option trading brokerages. https://support.snaptrade.com/brokerages has information on brokerage trading support
706
- * @summary Place option order
707
- * @param {string} userId
708
- * @param {string} userSecret
709
- * @param {string} accountId
710
- * @param {MlegTradeForm} mlegTradeForm
711
- * @param {*} [options] Override http request option.
712
- * @throws {RequiredError}
713
- */
714
- placeMlegOrder: (userId, userSecret, accountId, mlegTradeForm, options = {}) => __awaiter(this, void 0, void 0, function* () {
715
- // verify required parameter 'userId' is not null or undefined
716
- (0, common_1.assertParamExists)('placeMlegOrder', 'userId', userId);
717
- // verify required parameter 'userSecret' is not null or undefined
718
- (0, common_1.assertParamExists)('placeMlegOrder', 'userSecret', userSecret);
719
- // verify required parameter 'accountId' is not null or undefined
720
- (0, common_1.assertParamExists)('placeMlegOrder', 'accountId', accountId);
721
- // verify required parameter 'mlegTradeForm' is not null or undefined
722
- (0, common_1.assertParamExists)('placeMlegOrder', 'mlegTradeForm', mlegTradeForm);
723
- const localVarPath = `/accounts/{accountId}/trading/options`
724
- .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
725
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
726
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
727
- let baseOptions;
728
- if (configuration) {
729
- baseOptions = configuration.baseOptions;
730
- }
731
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
732
- const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
733
- const localVarQueryParameter = {};
734
- // authentication PartnerClientId required
735
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
736
- // authentication PartnerSignature required
737
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
738
- // authentication PartnerTimestamp required
739
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
740
- if (userId !== undefined) {
741
- localVarQueryParameter['userId'] = userId;
742
- }
743
- if (userSecret !== undefined) {
744
- localVarQueryParameter['userSecret'] = userSecret;
745
- }
746
- localVarHeaderParameter['Content-Type'] = 'application/json';
747
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
748
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
749
- (0, requestBeforeHook_1.requestBeforeHook)({
750
- requestBody: mlegTradeForm,
751
- queryParameters: localVarQueryParameter,
752
- requestConfig: localVarRequestOptions,
753
- path: localVarPath,
754
- configuration,
755
- pathTemplate: '/accounts/{accountId}/trading/options',
756
- httpMethod: 'POST'
757
- });
758
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(mlegTradeForm, localVarRequestOptions, configuration);
759
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
760
- return {
761
- url: (0, common_1.toPathString)(localVarUrlObj),
762
- options: localVarRequestOptions,
763
- };
764
- }),
765
- /**
766
- * Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder). It\'s recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
767
- * @summary Place checked equity order
768
- * @param {string} tradeId Obtained from calling the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact)
769
- * @param {string} userId
770
- * @param {string} userSecret
771
- * @param {ValidatedTradeBody} [validatedTradeBody]
772
- * @param {*} [options] Override http request option.
773
- * @throws {RequiredError}
774
- */
775
- placeOrder: (tradeId, userId, userSecret, validatedTradeBody, options = {}) => __awaiter(this, void 0, void 0, function* () {
776
- // verify required parameter 'tradeId' is not null or undefined
777
- (0, common_1.assertParamExists)('placeOrder', 'tradeId', tradeId);
778
- // verify required parameter 'userId' is not null or undefined
779
- (0, common_1.assertParamExists)('placeOrder', 'userId', userId);
780
- // verify required parameter 'userSecret' is not null or undefined
781
- (0, common_1.assertParamExists)('placeOrder', 'userSecret', userSecret);
782
- const localVarPath = `/trade/{tradeId}`
783
- .replace(`{${"tradeId"}}`, encodeURIComponent(String(tradeId !== undefined ? tradeId : `-tradeId-`)));
784
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
785
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
786
- let baseOptions;
787
- if (configuration) {
788
- baseOptions = configuration.baseOptions;
789
- }
790
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
791
- const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
792
- const localVarQueryParameter = {};
793
- // authentication PartnerClientId required
794
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
795
- // authentication PartnerSignature required
796
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
797
- // authentication PartnerTimestamp required
798
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
799
- if (userId !== undefined) {
800
- localVarQueryParameter['userId'] = userId;
801
- }
802
- if (userSecret !== undefined) {
803
- localVarQueryParameter['userSecret'] = userSecret;
804
- }
805
- localVarHeaderParameter['Content-Type'] = 'application/json';
806
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
807
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
808
- (0, requestBeforeHook_1.requestBeforeHook)({
809
- requestBody: validatedTradeBody,
810
- queryParameters: localVarQueryParameter,
811
- requestConfig: localVarRequestOptions,
812
- path: localVarPath,
813
- configuration,
814
- pathTemplate: '/trade/{tradeId}',
815
- httpMethod: 'POST'
816
- });
817
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(validatedTradeBody, localVarRequestOptions, configuration);
818
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
819
- return {
820
- url: (0, common_1.toPathString)(localVarUrlObj),
821
- options: localVarRequestOptions,
822
- };
823
- }),
824
- /**
825
- * Previews an order using the specified account.
826
- * @summary Preview crypto order
827
- * @param {string} userId
828
- * @param {string} userSecret
829
- * @param {string} accountId
830
- * @param {CryptoOrderForm} cryptoOrderForm
831
- * @param {*} [options] Override http request option.
832
- * @throws {RequiredError}
833
- */
834
- previewCryptoOrder: (userId, userSecret, accountId, cryptoOrderForm, options = {}) => __awaiter(this, void 0, void 0, function* () {
835
- // verify required parameter 'userId' is not null or undefined
836
- (0, common_1.assertParamExists)('previewCryptoOrder', 'userId', userId);
837
- // verify required parameter 'userSecret' is not null or undefined
838
- (0, common_1.assertParamExists)('previewCryptoOrder', 'userSecret', userSecret);
839
- // verify required parameter 'accountId' is not null or undefined
840
- (0, common_1.assertParamExists)('previewCryptoOrder', 'accountId', accountId);
841
- // verify required parameter 'cryptoOrderForm' is not null or undefined
842
- (0, common_1.assertParamExists)('previewCryptoOrder', 'cryptoOrderForm', cryptoOrderForm);
843
- const localVarPath = `/accounts/{accountId}/trading/crypto/preview`
844
- .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
845
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
846
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
847
- let baseOptions;
848
- if (configuration) {
849
- baseOptions = configuration.baseOptions;
850
- }
851
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
852
- const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
853
- const localVarQueryParameter = {};
854
- // authentication PartnerClientId required
855
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
856
- // authentication PartnerSignature required
857
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
858
- // authentication PartnerTimestamp required
859
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
860
- if (userId !== undefined) {
861
- localVarQueryParameter['userId'] = userId;
862
- }
863
- if (userSecret !== undefined) {
864
- localVarQueryParameter['userSecret'] = userSecret;
865
- }
866
- localVarHeaderParameter['Content-Type'] = 'application/json';
867
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
868
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
869
- (0, requestBeforeHook_1.requestBeforeHook)({
870
- requestBody: cryptoOrderForm,
871
- queryParameters: localVarQueryParameter,
872
- requestConfig: localVarRequestOptions,
873
- path: localVarPath,
874
- configuration,
875
- pathTemplate: '/accounts/{accountId}/trading/crypto/preview',
876
- httpMethod: 'POST'
877
- });
878
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(cryptoOrderForm, localVarRequestOptions, configuration);
879
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
880
- return {
881
- url: (0, common_1.toPathString)(localVarUrlObj),
882
- options: localVarRequestOptions,
883
- };
884
- }),
885
- /**
886
- * 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
887
- * @summary Replace order
888
- * @param {string} accountId The ID of the account to execute the trade on.
889
- * @param {string} userId
890
- * @param {string} userSecret
891
- * @param {ManualTradeReplaceForm} manualTradeReplaceForm
892
- * @param {*} [options] Override http request option.
893
- * @throws {RequiredError}
894
- */
895
- replaceOrder: (accountId, userId, userSecret, manualTradeReplaceForm, options = {}) => __awaiter(this, void 0, void 0, function* () {
896
- // verify required parameter 'accountId' is not null or undefined
897
- (0, common_1.assertParamExists)('replaceOrder', 'accountId', accountId);
898
- // verify required parameter 'userId' is not null or undefined
899
- (0, common_1.assertParamExists)('replaceOrder', 'userId', userId);
900
- // verify required parameter 'userSecret' is not null or undefined
901
- (0, common_1.assertParamExists)('replaceOrder', 'userSecret', userSecret);
902
- // verify required parameter 'manualTradeReplaceForm' is not null or undefined
903
- (0, common_1.assertParamExists)('replaceOrder', 'manualTradeReplaceForm', manualTradeReplaceForm);
904
- const localVarPath = `/accounts/{accountId}/trading/replace`
905
- .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
906
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
907
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
908
- let baseOptions;
909
- if (configuration) {
910
- baseOptions = configuration.baseOptions;
911
- }
912
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
913
- const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
914
- const localVarQueryParameter = {};
915
- // authentication PartnerClientId required
916
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
917
- // authentication PartnerSignature required
918
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
919
- // authentication PartnerTimestamp required
920
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
921
- if (userId !== undefined) {
922
- localVarQueryParameter['userId'] = userId;
923
- }
924
- if (userSecret !== undefined) {
925
- localVarQueryParameter['userSecret'] = userSecret;
926
- }
927
- localVarHeaderParameter['Content-Type'] = 'application/json';
928
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
929
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
930
- (0, requestBeforeHook_1.requestBeforeHook)({
931
- requestBody: manualTradeReplaceForm,
932
- queryParameters: localVarQueryParameter,
933
- requestConfig: localVarRequestOptions,
934
- path: localVarPath,
935
- configuration,
936
- pathTemplate: '/accounts/{accountId}/trading/replace',
937
- httpMethod: 'POST'
938
- });
939
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(manualTradeReplaceForm, localVarRequestOptions, configuration);
940
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
941
- return {
942
- url: (0, common_1.toPathString)(localVarUrlObj),
943
- options: localVarRequestOptions,
944
- };
945
- }),
946
- /**
947
- * Searches cryptocurrency pairs instruments accessible to the specified account. Both `base` and `quote` are optional. Omit both for a full list of cryptocurrency pairs.
948
- * @summary Get crypto pairs
949
- * @param {string} userId
950
- * @param {string} userSecret
951
- * @param {string} accountId
952
- * @param {string} [base]
953
- * @param {string} [quote]
954
- * @param {*} [options] Override http request option.
955
- * @throws {RequiredError}
956
- */
957
- searchCryptocurrencyPairInstruments: (userId, userSecret, accountId, base, quote, options = {}) => __awaiter(this, void 0, void 0, function* () {
958
- // verify required parameter 'userId' is not null or undefined
959
- (0, common_1.assertParamExists)('searchCryptocurrencyPairInstruments', 'userId', userId);
960
- // verify required parameter 'userSecret' is not null or undefined
961
- (0, common_1.assertParamExists)('searchCryptocurrencyPairInstruments', 'userSecret', userSecret);
962
- // verify required parameter 'accountId' is not null or undefined
963
- (0, common_1.assertParamExists)('searchCryptocurrencyPairInstruments', 'accountId', accountId);
964
- const localVarPath = `/accounts/{accountId}/trading/instruments/cryptocurrencyPairs`
965
- .replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
966
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
967
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
968
- let baseOptions;
969
- if (configuration) {
970
- baseOptions = configuration.baseOptions;
971
- }
972
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
973
- const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
974
- const localVarQueryParameter = {};
975
- // authentication PartnerClientId required
976
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
977
- // authentication PartnerSignature required
978
- yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
979
- // authentication PartnerTimestamp required
980
- yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
981
- if (userId !== undefined) {
982
- localVarQueryParameter['userId'] = userId;
983
- }
984
- if (userSecret !== undefined) {
985
- localVarQueryParameter['userSecret'] = userSecret;
986
- }
987
- if (base !== undefined) {
988
- localVarQueryParameter['base'] = base;
989
- }
990
- if (quote !== undefined) {
991
- localVarQueryParameter['quote'] = quote;
992
- }
993
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
994
- localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
995
- (0, requestBeforeHook_1.requestBeforeHook)({
996
- queryParameters: localVarQueryParameter,
997
- requestConfig: localVarRequestOptions,
998
- path: localVarPath,
999
- configuration,
1000
- pathTemplate: '/accounts/{accountId}/trading/instruments/cryptocurrencyPairs',
1001
- httpMethod: 'GET'
1002
- });
1003
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1004
- return {
1005
- url: (0, common_1.toPathString)(localVarUrlObj),
1006
- options: localVarRequestOptions,
1007
- };
1008
- }),
1009
- };
1010
- };
1011
- exports.TradingApiAxiosParamCreator = TradingApiAxiosParamCreator;
1012
- /**
1013
- * TradingApi - functional programming interface
1014
- * @export
1015
- */
1016
- const TradingApiFp = function (configuration) {
1017
- const localVarAxiosParamCreator = (0, exports.TradingApiAxiosParamCreator)(configuration);
1018
- return {
1019
- /**
1020
- * Cancels an order in the specified account. Accepts order IDs for all asset types.
1021
- * @summary Cancel order
1022
- * @param {TradingApiCancelOrderRequest} requestParameters Request parameters.
1023
- * @param {*} [options] Override http request option.
1024
- * @throws {RequiredError}
1025
- */
1026
- cancelOrder(requestParameters, options) {
1027
- return __awaiter(this, void 0, void 0, function* () {
1028
- const accountInformationGetUserAccountOrderDetailRequest = {
1029
- brokerage_order_id: requestParameters.brokerage_order_id
1030
- };
1031
- const localVarAxiosArgs = yield localVarAxiosParamCreator.cancelOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, accountInformationGetUserAccountOrderDetailRequest, options);
1032
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1033
- });
1034
- },
1035
- /**
1036
- * **This endpoint is deprecated. Please switch to [the new cancel order endpoint](/reference/Trading/Trading_cancelOrder) ** Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
1037
- * @summary Cancel equity order
1038
- * @param {TradingApiCancelUserAccountOrderRequest} requestParameters Request parameters.
1039
- * @param {*} [options] Override http request option.
1040
- * @deprecated
1041
- * @throws {RequiredError}
1042
- */
1043
- cancelUserAccountOrder(requestParameters, options) {
1044
- return __awaiter(this, void 0, void 0, function* () {
1045
- const accountInformationGetUserAccountOrderDetailRequest = {
1046
- brokerage_order_id: requestParameters.brokerage_order_id
1047
- };
1048
- const localVarAxiosArgs = yield localVarAxiosParamCreator.cancelUserAccountOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, accountInformationGetUserAccountOrderDetailRequest, options);
1049
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1050
- });
1051
- },
1052
- /**
1053
- * Gets a quote for the specified account.
1054
- * @summary Get crypto pair quote
1055
- * @param {TradingApiGetCryptocurrencyPairQuoteRequest} requestParameters Request parameters.
1056
- * @param {*} [options] Override http request option.
1057
- * @throws {RequiredError}
1058
- */
1059
- getCryptocurrencyPairQuote(requestParameters, options) {
1060
- return __awaiter(this, void 0, void 0, function* () {
1061
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getCryptocurrencyPairQuote(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.instrumentSymbol, options);
1062
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1063
- });
1064
- },
1065
- /**
1066
- * Simulates an option order with up to 4 legs and returns the estimated cost and transaction fees without placing it. Only supported for certain enabled brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for more information on which brokerages support this endpoint.
1067
- * @summary Get option order impact
1068
- * @param {TradingApiGetOptionImpactRequest} requestParameters Request parameters.
1069
- * @param {*} [options] Override http request option.
1070
- * @throws {RequiredError}
1071
- */
1072
- getOptionImpact(requestParameters, options) {
1073
- return __awaiter(this, void 0, void 0, function* () {
1074
- const mlegTradeForm = {
1075
- order_type: requestParameters.order_type,
1076
- time_in_force: requestParameters.time_in_force,
1077
- limit_price: requestParameters.limit_price,
1078
- stop_price: requestParameters.stop_price,
1079
- price_effect: requestParameters.price_effect,
1080
- legs: requestParameters.legs
1081
- };
1082
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getOptionImpact(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, mlegTradeForm, options);
1083
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1084
- });
1085
- },
1086
- /**
1087
- * 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.
1088
- * @summary Check equity order impact
1089
- * @param {TradingApiGetOrderImpactRequest} requestParameters Request parameters.
1090
- * @param {*} [options] Override http request option.
1091
- * @throws {RequiredError}
1092
- */
1093
- getOrderImpact(requestParameters, options) {
1094
- return __awaiter(this, void 0, void 0, function* () {
1095
- const manualTradeForm = {
1096
- account_id: requestParameters.account_id,
1097
- action: requestParameters.action,
1098
- universal_symbol_id: requestParameters.universal_symbol_id,
1099
- order_type: requestParameters.order_type,
1100
- time_in_force: requestParameters.time_in_force,
1101
- price: requestParameters.price,
1102
- stop: requestParameters.stop,
1103
- units: requestParameters.units,
1104
- notional_value: requestParameters.notional_value
1105
- };
1106
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getOrderImpact(requestParameters.userId, requestParameters.userSecret, manualTradeForm, options);
1107
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1108
- });
1109
- },
1110
- /**
1111
- * Returns a quote for a single option contract. The option contract is specified using in the 21 character OCC format. For example `AAPL 251114C00240000` represents a call option on AAPL expiring on 2025-11-14 with a strike price of $240. For more information on the OCC format, see [here](https://en.wikipedia.org/wiki/Option_symbol#OCC_format) **Note:** These are derived values and are not suitable for trading purposes.
1112
- * @summary Get option quote
1113
- * @param {TradingApiGetUserAccountOptionQuotesRequest} requestParameters Request parameters.
1114
- * @param {*} [options] Override http request option.
1115
- * @throws {RequiredError}
1116
- */
1117
- getUserAccountOptionQuotes(requestParameters, options) {
1118
- return __awaiter(this, void 0, void 0, function* () {
1119
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getUserAccountOptionQuotes(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.symbol, options);
1120
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1121
- });
1122
- },
1123
- /**
1124
- * Returns a maximum of 10 quotes from the brokerage for the specified symbols and account. The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint. **This endpoint is not a substitute for a market data provider. Frequent polling of this endpoint may result in the disabling of your keys** This endpoint does not work for options quotes. This endpoint is disabled for free plans by default. Please contact support to enable this endpoint if needed.
1125
- * @summary Get equity symbol quotes
1126
- * @param {TradingApiGetUserAccountQuotesRequest} requestParameters Request parameters.
1127
- * @param {*} [options] Override http request option.
1128
- * @throws {RequiredError}
1129
- */
1130
- getUserAccountQuotes(requestParameters, options) {
1131
- return __awaiter(this, void 0, void 0, function* () {
1132
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getUserAccountQuotes(requestParameters.userId, requestParameters.userSecret, requestParameters.symbols, requestParameters.accountId, requestParameters.useTicker, options);
1133
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1134
- });
1135
- },
1136
- /**
1137
- * Places a bracket order (entry order + OCO of stop loss and take profit). Disabled by default please contact support for use. Only supported on certain brokerages
1138
- * @summary Place bracket order
1139
- * @param {TradingApiPlaceBracketOrderRequest} requestParameters Request parameters.
1140
- * @param {*} [options] Override http request option.
1141
- * @throws {RequiredError}
1142
- */
1143
- placeBracketOrder(requestParameters, options) {
1144
- return __awaiter(this, void 0, void 0, function* () {
1145
- const manualTradeFormBracket = {
1146
- action: requestParameters.action,
1147
- instrument: requestParameters.instrument,
1148
- order_type: requestParameters.order_type,
1149
- time_in_force: requestParameters.time_in_force,
1150
- price: requestParameters.price,
1151
- stop: requestParameters.stop,
1152
- units: requestParameters.units,
1153
- stop_loss: requestParameters.stop_loss,
1154
- take_profit: requestParameters.take_profit
1155
- };
1156
- const localVarAxiosArgs = yield localVarAxiosParamCreator.placeBracketOrder(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, manualTradeFormBracket, options);
1157
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1158
- });
1159
- },
1160
- /**
1161
- * Places a complex conditional order (OCO, OTO, or OTOCO). Disabled by default — contact support to enable. Only supported on certain brokerages. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
1162
- * @summary Place complex order
1163
- * @param {TradingApiPlaceComplexOrderRequest} requestParameters Request parameters.
1164
- * @param {*} [options] Override http request option.
1165
- * @throws {RequiredError}
1166
- */
1167
- placeComplexOrder(requestParameters, options) {
1168
- return __awaiter(this, void 0, void 0, function* () {
1169
- const manualTradeFormComplex = {
1170
- type: requestParameters.type,
1171
- orders: requestParameters.orders,
1172
- client_order_id: requestParameters.client_order_id
1173
- };
1174
- const localVarAxiosArgs = yield localVarAxiosParamCreator.placeComplexOrder(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, manualTradeFormComplex, options);
1175
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1176
- });
1177
- },
1178
- /**
1179
- * 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.
1180
- * @summary Place crypto order
1181
- * @param {TradingApiPlaceCryptoOrderRequest} requestParameters Request parameters.
1182
- * @param {*} [options] Override http request option.
1183
- * @throws {RequiredError}
1184
- */
1185
- placeCryptoOrder(requestParameters, options) {
1186
- return __awaiter(this, void 0, void 0, function* () {
1187
- const cryptoOrderForm = {
1188
- instrument: requestParameters.instrument,
1189
- side: requestParameters.side,
1190
- type: requestParameters.type,
1191
- time_in_force: requestParameters.time_in_force,
1192
- amount: requestParameters.amount,
1193
- limit_price: requestParameters.limit_price,
1194
- stop_price: requestParameters.stop_price,
1195
- post_only: requestParameters.post_only,
1196
- expiration_date: requestParameters.expiration_date
1197
- };
1198
- const localVarAxiosArgs = yield localVarAxiosParamCreator.placeCryptoOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, cryptoOrderForm, options);
1199
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1200
- });
1201
- },
1202
- /**
1203
- * 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. This endpoint does not compute the impact to the account balance from the order and any potential commissions before submitting the order to the brokerage. If that is desired, you can use the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). It\'s recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
1204
- * @summary Place equity order
1205
- * @param {TradingApiPlaceForceOrderRequest} requestParameters Request parameters.
1206
- * @param {*} [options] Override http request option.
1207
- * @throws {RequiredError}
1208
- */
1209
- placeForceOrder(requestParameters, options) {
1210
- return __awaiter(this, void 0, void 0, function* () {
1211
- const manualTradeFormWithOptions = {
1212
- account_id: requestParameters.account_id,
1213
- action: requestParameters.action,
1214
- universal_symbol_id: requestParameters.universal_symbol_id,
1215
- symbol: requestParameters.symbol,
1216
- order_type: requestParameters.order_type,
1217
- time_in_force: requestParameters.time_in_force,
1218
- trading_session: requestParameters.trading_session,
1219
- price: requestParameters.price,
1220
- stop: requestParameters.stop,
1221
- units: requestParameters.units,
1222
- notional_value: requestParameters.notional_value
1223
- };
1224
- const localVarAxiosArgs = yield localVarAxiosParamCreator.placeForceOrder(requestParameters.userId, requestParameters.userSecret, manualTradeFormWithOptions, options);
1225
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1226
- });
1227
- },
1228
- /**
1229
- * Places a multi-leg option order. Only supported on certain option trading brokerages. https://support.snaptrade.com/brokerages has information on brokerage trading support
1230
- * @summary Place option order
1231
- * @param {TradingApiPlaceMlegOrderRequest} requestParameters Request parameters.
1232
- * @param {*} [options] Override http request option.
1233
- * @throws {RequiredError}
1234
- */
1235
- placeMlegOrder(requestParameters, options) {
1236
- return __awaiter(this, void 0, void 0, function* () {
1237
- const mlegTradeForm = {
1238
- order_type: requestParameters.order_type,
1239
- time_in_force: requestParameters.time_in_force,
1240
- limit_price: requestParameters.limit_price,
1241
- stop_price: requestParameters.stop_price,
1242
- price_effect: requestParameters.price_effect,
1243
- legs: requestParameters.legs
1244
- };
1245
- const localVarAxiosArgs = yield localVarAxiosParamCreator.placeMlegOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, mlegTradeForm, options);
1246
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1247
- });
1248
- },
1249
- /**
1250
- * Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder). It\'s recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
1251
- * @summary Place checked equity order
1252
- * @param {TradingApiPlaceOrderRequest} requestParameters Request parameters.
1253
- * @param {*} [options] Override http request option.
1254
- * @throws {RequiredError}
1255
- */
1256
- placeOrder(requestParameters, options) {
1257
- return __awaiter(this, void 0, void 0, function* () {
1258
- const validatedTradeBody = {
1259
- wait_to_confirm: requestParameters.wait_to_confirm
1260
- };
1261
- const localVarAxiosArgs = yield localVarAxiosParamCreator.placeOrder(requestParameters.tradeId, requestParameters.userId, requestParameters.userSecret, validatedTradeBody, options);
1262
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1263
- });
1264
- },
1265
- /**
1266
- * Previews an order using the specified account.
1267
- * @summary Preview crypto order
1268
- * @param {TradingApiPreviewCryptoOrderRequest} requestParameters Request parameters.
1269
- * @param {*} [options] Override http request option.
1270
- * @throws {RequiredError}
1271
- */
1272
- previewCryptoOrder(requestParameters, options) {
1273
- return __awaiter(this, void 0, void 0, function* () {
1274
- const cryptoOrderForm = {
1275
- instrument: requestParameters.instrument,
1276
- side: requestParameters.side,
1277
- type: requestParameters.type,
1278
- time_in_force: requestParameters.time_in_force,
1279
- amount: requestParameters.amount,
1280
- limit_price: requestParameters.limit_price,
1281
- stop_price: requestParameters.stop_price,
1282
- post_only: requestParameters.post_only,
1283
- expiration_date: requestParameters.expiration_date
1284
- };
1285
- const localVarAxiosArgs = yield localVarAxiosParamCreator.previewCryptoOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, cryptoOrderForm, options);
1286
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1287
- });
1288
- },
1289
- /**
1290
- * 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
1291
- * @summary Replace order
1292
- * @param {TradingApiReplaceOrderRequest} requestParameters Request parameters.
1293
- * @param {*} [options] Override http request option.
1294
- * @throws {RequiredError}
1295
- */
1296
- replaceOrder(requestParameters, options) {
1297
- return __awaiter(this, void 0, void 0, function* () {
1298
- const manualTradeReplaceForm = {
1299
- brokerage_order_id: requestParameters.brokerage_order_id,
1300
- action: requestParameters.action,
1301
- order_type: requestParameters.order_type,
1302
- time_in_force: requestParameters.time_in_force,
1303
- price: requestParameters.price,
1304
- symbol: requestParameters.symbol,
1305
- stop: requestParameters.stop,
1306
- units: requestParameters.units
1307
- };
1308
- const localVarAxiosArgs = yield localVarAxiosParamCreator.replaceOrder(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, manualTradeReplaceForm, options);
1309
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1310
- });
1311
- },
1312
- /**
1313
- * Searches cryptocurrency pairs instruments accessible to the specified account. Both `base` and `quote` are optional. Omit both for a full list of cryptocurrency pairs.
1314
- * @summary Get crypto pairs
1315
- * @param {TradingApiSearchCryptocurrencyPairInstrumentsRequest} requestParameters Request parameters.
1316
- * @param {*} [options] Override http request option.
1317
- * @throws {RequiredError}
1318
- */
1319
- searchCryptocurrencyPairInstruments(requestParameters, options) {
1320
- return __awaiter(this, void 0, void 0, function* () {
1321
- const localVarAxiosArgs = yield localVarAxiosParamCreator.searchCryptocurrencyPairInstruments(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.base, requestParameters.quote, options);
1322
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1323
- });
1324
- },
1325
- };
1326
- };
1327
- exports.TradingApiFp = TradingApiFp;
1328
- /**
1329
- * TradingApi - factory interface
1330
- * @export
1331
- */
1332
- const TradingApiFactory = function (configuration, basePath, axios) {
1333
- const localVarFp = (0, exports.TradingApiFp)(configuration);
1334
- return {
1335
- /**
1336
- * Cancels an order in the specified account. Accepts order IDs for all asset types.
1337
- * @summary Cancel order
1338
- * @param {TradingApiCancelOrderRequest} requestParameters Request parameters.
1339
- * @param {*} [options] Override http request option.
1340
- * @throws {RequiredError}
1341
- */
1342
- cancelOrder(requestParameters, options) {
1343
- return localVarFp.cancelOrder(requestParameters, options).then((request) => request(axios, basePath));
1344
- },
1345
- /**
1346
- * **This endpoint is deprecated. Please switch to [the new cancel order endpoint](/reference/Trading/Trading_cancelOrder) ** Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
1347
- * @summary Cancel equity order
1348
- * @param {TradingApiCancelUserAccountOrderRequest} requestParameters Request parameters.
1349
- * @param {*} [options] Override http request option.
1350
- * @deprecated
1351
- * @throws {RequiredError}
1352
- */
1353
- cancelUserAccountOrder(requestParameters, options) {
1354
- return localVarFp.cancelUserAccountOrder(requestParameters, options).then((request) => request(axios, basePath));
1355
- },
1356
- /**
1357
- * Gets a quote for the specified account.
1358
- * @summary Get crypto pair quote
1359
- * @param {TradingApiGetCryptocurrencyPairQuoteRequest} requestParameters Request parameters.
1360
- * @param {*} [options] Override http request option.
1361
- * @throws {RequiredError}
1362
- */
1363
- getCryptocurrencyPairQuote(requestParameters, options) {
1364
- return localVarFp.getCryptocurrencyPairQuote(requestParameters, options).then((request) => request(axios, basePath));
1365
- },
1366
- /**
1367
- * Simulates an option order with up to 4 legs and returns the estimated cost and transaction fees without placing it. Only supported for certain enabled brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for more information on which brokerages support this endpoint.
1368
- * @summary Get option order impact
1369
- * @param {TradingApiGetOptionImpactRequest} requestParameters Request parameters.
1370
- * @param {*} [options] Override http request option.
1371
- * @throws {RequiredError}
1372
- */
1373
- getOptionImpact(requestParameters, options) {
1374
- return localVarFp.getOptionImpact(requestParameters, options).then((request) => request(axios, basePath));
1375
- },
1376
- /**
1377
- * 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.
1378
- * @summary Check equity order impact
1379
- * @param {TradingApiGetOrderImpactRequest} requestParameters Request parameters.
1380
- * @param {*} [options] Override http request option.
1381
- * @throws {RequiredError}
1382
- */
1383
- getOrderImpact(requestParameters, options) {
1384
- return localVarFp.getOrderImpact(requestParameters, options).then((request) => request(axios, basePath));
1385
- },
1386
- /**
1387
- * Returns a quote for a single option contract. The option contract is specified using in the 21 character OCC format. For example `AAPL 251114C00240000` represents a call option on AAPL expiring on 2025-11-14 with a strike price of $240. For more information on the OCC format, see [here](https://en.wikipedia.org/wiki/Option_symbol#OCC_format) **Note:** These are derived values and are not suitable for trading purposes.
1388
- * @summary Get option quote
1389
- * @param {TradingApiGetUserAccountOptionQuotesRequest} requestParameters Request parameters.
1390
- * @param {*} [options] Override http request option.
1391
- * @throws {RequiredError}
1392
- */
1393
- getUserAccountOptionQuotes(requestParameters, options) {
1394
- return localVarFp.getUserAccountOptionQuotes(requestParameters, options).then((request) => request(axios, basePath));
1395
- },
1396
- /**
1397
- * Returns a maximum of 10 quotes from the brokerage for the specified symbols and account. The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint. **This endpoint is not a substitute for a market data provider. Frequent polling of this endpoint may result in the disabling of your keys** This endpoint does not work for options quotes. This endpoint is disabled for free plans by default. Please contact support to enable this endpoint if needed.
1398
- * @summary Get equity symbol quotes
1399
- * @param {TradingApiGetUserAccountQuotesRequest} requestParameters Request parameters.
1400
- * @param {*} [options] Override http request option.
1401
- * @throws {RequiredError}
1402
- */
1403
- getUserAccountQuotes(requestParameters, options) {
1404
- return localVarFp.getUserAccountQuotes(requestParameters, options).then((request) => request(axios, basePath));
1405
- },
1406
- /**
1407
- * Places a bracket order (entry order + OCO of stop loss and take profit). Disabled by default please contact support for use. Only supported on certain brokerages
1408
- * @summary Place bracket order
1409
- * @param {TradingApiPlaceBracketOrderRequest} requestParameters Request parameters.
1410
- * @param {*} [options] Override http request option.
1411
- * @throws {RequiredError}
1412
- */
1413
- placeBracketOrder(requestParameters, options) {
1414
- return localVarFp.placeBracketOrder(requestParameters, options).then((request) => request(axios, basePath));
1415
- },
1416
- /**
1417
- * Places a complex conditional order (OCO, OTO, or OTOCO). Disabled by default — contact support to enable. Only supported on certain brokerages. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
1418
- * @summary Place complex order
1419
- * @param {TradingApiPlaceComplexOrderRequest} requestParameters Request parameters.
1420
- * @param {*} [options] Override http request option.
1421
- * @throws {RequiredError}
1422
- */
1423
- placeComplexOrder(requestParameters, options) {
1424
- return localVarFp.placeComplexOrder(requestParameters, options).then((request) => request(axios, basePath));
1425
- },
1426
- /**
1427
- * 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.
1428
- * @summary Place crypto order
1429
- * @param {TradingApiPlaceCryptoOrderRequest} requestParameters Request parameters.
1430
- * @param {*} [options] Override http request option.
1431
- * @throws {RequiredError}
1432
- */
1433
- placeCryptoOrder(requestParameters, options) {
1434
- return localVarFp.placeCryptoOrder(requestParameters, options).then((request) => request(axios, basePath));
1435
- },
1436
- /**
1437
- * 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. This endpoint does not compute the impact to the account balance from the order and any potential commissions before submitting the order to the brokerage. If that is desired, you can use the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). It\'s recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
1438
- * @summary Place equity order
1439
- * @param {TradingApiPlaceForceOrderRequest} requestParameters Request parameters.
1440
- * @param {*} [options] Override http request option.
1441
- * @throws {RequiredError}
1442
- */
1443
- placeForceOrder(requestParameters, options) {
1444
- return localVarFp.placeForceOrder(requestParameters, options).then((request) => request(axios, basePath));
1445
- },
1446
- /**
1447
- * Places a multi-leg option order. Only supported on certain option trading brokerages. https://support.snaptrade.com/brokerages has information on brokerage trading support
1448
- * @summary Place option order
1449
- * @param {TradingApiPlaceMlegOrderRequest} requestParameters Request parameters.
1450
- * @param {*} [options] Override http request option.
1451
- * @throws {RequiredError}
1452
- */
1453
- placeMlegOrder(requestParameters, options) {
1454
- return localVarFp.placeMlegOrder(requestParameters, options).then((request) => request(axios, basePath));
1455
- },
1456
- /**
1457
- * Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder). It\'s recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
1458
- * @summary Place checked equity order
1459
- * @param {TradingApiPlaceOrderRequest} requestParameters Request parameters.
1460
- * @param {*} [options] Override http request option.
1461
- * @throws {RequiredError}
1462
- */
1463
- placeOrder(requestParameters, options) {
1464
- return localVarFp.placeOrder(requestParameters, options).then((request) => request(axios, basePath));
1465
- },
1466
- /**
1467
- * Previews an order using the specified account.
1468
- * @summary Preview crypto order
1469
- * @param {TradingApiPreviewCryptoOrderRequest} requestParameters Request parameters.
1470
- * @param {*} [options] Override http request option.
1471
- * @throws {RequiredError}
1472
- */
1473
- previewCryptoOrder(requestParameters, options) {
1474
- return localVarFp.previewCryptoOrder(requestParameters, options).then((request) => request(axios, basePath));
1475
- },
1476
- /**
1477
- * 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
1478
- * @summary Replace order
1479
- * @param {TradingApiReplaceOrderRequest} requestParameters Request parameters.
1480
- * @param {*} [options] Override http request option.
1481
- * @throws {RequiredError}
1482
- */
1483
- replaceOrder(requestParameters, options) {
1484
- return localVarFp.replaceOrder(requestParameters, options).then((request) => request(axios, basePath));
1485
- },
1486
- /**
1487
- * Searches cryptocurrency pairs instruments accessible to the specified account. Both `base` and `quote` are optional. Omit both for a full list of cryptocurrency pairs.
1488
- * @summary Get crypto pairs
1489
- * @param {TradingApiSearchCryptocurrencyPairInstrumentsRequest} requestParameters Request parameters.
1490
- * @param {*} [options] Override http request option.
1491
- * @throws {RequiredError}
1492
- */
1493
- searchCryptocurrencyPairInstruments(requestParameters, options) {
1494
- return localVarFp.searchCryptocurrencyPairInstruments(requestParameters, options).then((request) => request(axios, basePath));
1495
- },
1496
- };
1497
- };
1498
- exports.TradingApiFactory = TradingApiFactory;
1499
- /**
1500
- * TradingApiGenerated - object-oriented interface
1501
- * @export
1502
- * @class TradingApiGenerated
1503
- * @extends {BaseAPI}
1504
- */
1505
- class TradingApiGenerated extends base_1.BaseAPI {
1506
- /**
1507
- * Cancels an order in the specified account. Accepts order IDs for all asset types.
1508
- * @summary Cancel order
1509
- * @param {TradingApiCancelOrderRequest} requestParameters Request parameters.
1510
- * @param {*} [options] Override http request option.
1511
- * @throws {RequiredError}
1512
- * @memberof TradingApiGenerated
1513
- */
1514
- cancelOrder(requestParameters, options) {
1515
- return (0, exports.TradingApiFp)(this.configuration).cancelOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
1516
- }
1517
- /**
1518
- * **This endpoint is deprecated. Please switch to [the new cancel order endpoint](/reference/Trading/Trading_cancelOrder) ** Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
1519
- * @summary Cancel equity order
1520
- * @param {TradingApiCancelUserAccountOrderRequest} requestParameters Request parameters.
1521
- * @param {*} [options] Override http request option.
1522
- * @deprecated
1523
- * @throws {RequiredError}
1524
- * @memberof TradingApiGenerated
1525
- */
1526
- cancelUserAccountOrder(requestParameters, options) {
1527
- return (0, exports.TradingApiFp)(this.configuration).cancelUserAccountOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
1528
- }
1529
- /**
1530
- * Gets a quote for the specified account.
1531
- * @summary Get crypto pair quote
1532
- * @param {TradingApiGetCryptocurrencyPairQuoteRequest} requestParameters Request parameters.
1533
- * @param {*} [options] Override http request option.
1534
- * @throws {RequiredError}
1535
- * @memberof TradingApiGenerated
1536
- */
1537
- getCryptocurrencyPairQuote(requestParameters, options) {
1538
- return (0, exports.TradingApiFp)(this.configuration).getCryptocurrencyPairQuote(requestParameters, options).then((request) => request(this.axios, this.basePath));
1539
- }
1540
- /**
1541
- * Simulates an option order with up to 4 legs and returns the estimated cost and transaction fees without placing it. Only supported for certain enabled brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for more information on which brokerages support this endpoint.
1542
- * @summary Get option order impact
1543
- * @param {TradingApiGetOptionImpactRequest} requestParameters Request parameters.
1544
- * @param {*} [options] Override http request option.
1545
- * @throws {RequiredError}
1546
- * @memberof TradingApiGenerated
1547
- */
1548
- getOptionImpact(requestParameters, options) {
1549
- return (0, exports.TradingApiFp)(this.configuration).getOptionImpact(requestParameters, options).then((request) => request(this.axios, this.basePath));
1550
- }
1551
- /**
1552
- * 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.
1553
- * @summary Check equity order impact
1554
- * @param {TradingApiGetOrderImpactRequest} requestParameters Request parameters.
1555
- * @param {*} [options] Override http request option.
1556
- * @throws {RequiredError}
1557
- * @memberof TradingApiGenerated
1558
- */
1559
- getOrderImpact(requestParameters, options) {
1560
- return (0, exports.TradingApiFp)(this.configuration).getOrderImpact(requestParameters, options).then((request) => request(this.axios, this.basePath));
1561
- }
1562
- /**
1563
- * Returns a quote for a single option contract. The option contract is specified using in the 21 character OCC format. For example `AAPL 251114C00240000` represents a call option on AAPL expiring on 2025-11-14 with a strike price of $240. For more information on the OCC format, see [here](https://en.wikipedia.org/wiki/Option_symbol#OCC_format) **Note:** These are derived values and are not suitable for trading purposes.
1564
- * @summary Get option quote
1565
- * @param {TradingApiGetUserAccountOptionQuotesRequest} requestParameters Request parameters.
1566
- * @param {*} [options] Override http request option.
1567
- * @throws {RequiredError}
1568
- * @memberof TradingApiGenerated
1569
- */
1570
- getUserAccountOptionQuotes(requestParameters, options) {
1571
- return (0, exports.TradingApiFp)(this.configuration).getUserAccountOptionQuotes(requestParameters, options).then((request) => request(this.axios, this.basePath));
1572
- }
1573
- /**
1574
- * Returns a maximum of 10 quotes from the brokerage for the specified symbols and account. The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint. **This endpoint is not a substitute for a market data provider. Frequent polling of this endpoint may result in the disabling of your keys** This endpoint does not work for options quotes. This endpoint is disabled for free plans by default. Please contact support to enable this endpoint if needed.
1575
- * @summary Get equity symbol quotes
1576
- * @param {TradingApiGetUserAccountQuotesRequest} requestParameters Request parameters.
1577
- * @param {*} [options] Override http request option.
1578
- * @throws {RequiredError}
1579
- * @memberof TradingApiGenerated
1580
- */
1581
- getUserAccountQuotes(requestParameters, options) {
1582
- return (0, exports.TradingApiFp)(this.configuration).getUserAccountQuotes(requestParameters, options).then((request) => request(this.axios, this.basePath));
1583
- }
1584
- /**
1585
- * Places a bracket order (entry order + OCO of stop loss and take profit). Disabled by default please contact support for use. Only supported on certain brokerages
1586
- * @summary Place bracket order
1587
- * @param {TradingApiPlaceBracketOrderRequest} requestParameters Request parameters.
1588
- * @param {*} [options] Override http request option.
1589
- * @throws {RequiredError}
1590
- * @memberof TradingApiGenerated
1591
- */
1592
- placeBracketOrder(requestParameters, options) {
1593
- return (0, exports.TradingApiFp)(this.configuration).placeBracketOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
1594
- }
1595
- /**
1596
- * Places a complex conditional order (OCO, OTO, or OTOCO). Disabled by default — contact support to enable. Only supported on certain brokerages. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
1597
- * @summary Place complex order
1598
- * @param {TradingApiPlaceComplexOrderRequest} requestParameters Request parameters.
1599
- * @param {*} [options] Override http request option.
1600
- * @throws {RequiredError}
1601
- * @memberof TradingApiGenerated
1602
- */
1603
- placeComplexOrder(requestParameters, options) {
1604
- return (0, exports.TradingApiFp)(this.configuration).placeComplexOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
1605
- }
1606
- /**
1607
- * 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.
1608
- * @summary Place crypto order
1609
- * @param {TradingApiPlaceCryptoOrderRequest} requestParameters Request parameters.
1610
- * @param {*} [options] Override http request option.
1611
- * @throws {RequiredError}
1612
- * @memberof TradingApiGenerated
1613
- */
1614
- placeCryptoOrder(requestParameters, options) {
1615
- return (0, exports.TradingApiFp)(this.configuration).placeCryptoOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
1616
- }
1617
- /**
1618
- * 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. This endpoint does not compute the impact to the account balance from the order and any potential commissions before submitting the order to the brokerage. If that is desired, you can use the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). It\'s recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
1619
- * @summary Place equity order
1620
- * @param {TradingApiPlaceForceOrderRequest} requestParameters Request parameters.
1621
- * @param {*} [options] Override http request option.
1622
- * @throws {RequiredError}
1623
- * @memberof TradingApiGenerated
1624
- */
1625
- placeForceOrder(requestParameters, options) {
1626
- return (0, exports.TradingApiFp)(this.configuration).placeForceOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
1627
- }
1628
- /**
1629
- * Places a multi-leg option order. Only supported on certain option trading brokerages. https://support.snaptrade.com/brokerages has information on brokerage trading support
1630
- * @summary Place option order
1631
- * @param {TradingApiPlaceMlegOrderRequest} requestParameters Request parameters.
1632
- * @param {*} [options] Override http request option.
1633
- * @throws {RequiredError}
1634
- * @memberof TradingApiGenerated
1635
- */
1636
- placeMlegOrder(requestParameters, options) {
1637
- return (0, exports.TradingApiFp)(this.configuration).placeMlegOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
1638
- }
1639
- /**
1640
- * Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder). It\'s recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
1641
- * @summary Place checked equity order
1642
- * @param {TradingApiPlaceOrderRequest} requestParameters Request parameters.
1643
- * @param {*} [options] Override http request option.
1644
- * @throws {RequiredError}
1645
- * @memberof TradingApiGenerated
1646
- */
1647
- placeOrder(requestParameters, options) {
1648
- return (0, exports.TradingApiFp)(this.configuration).placeOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
1649
- }
1650
- /**
1651
- * Previews an order using the specified account.
1652
- * @summary Preview crypto order
1653
- * @param {TradingApiPreviewCryptoOrderRequest} requestParameters Request parameters.
1654
- * @param {*} [options] Override http request option.
1655
- * @throws {RequiredError}
1656
- * @memberof TradingApiGenerated
1657
- */
1658
- previewCryptoOrder(requestParameters, options) {
1659
- return (0, exports.TradingApiFp)(this.configuration).previewCryptoOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
1660
- }
1661
- /**
1662
- * 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
1663
- * @summary Replace order
1664
- * @param {TradingApiReplaceOrderRequest} requestParameters Request parameters.
1665
- * @param {*} [options] Override http request option.
1666
- * @throws {RequiredError}
1667
- * @memberof TradingApiGenerated
1668
- */
1669
- replaceOrder(requestParameters, options) {
1670
- return (0, exports.TradingApiFp)(this.configuration).replaceOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
1671
- }
1672
- /**
1673
- * Searches cryptocurrency pairs instruments accessible to the specified account. Both `base` and `quote` are optional. Omit both for a full list of cryptocurrency pairs.
1674
- * @summary Get crypto pairs
1675
- * @param {TradingApiSearchCryptocurrencyPairInstrumentsRequest} requestParameters Request parameters.
1676
- * @param {*} [options] Override http request option.
1677
- * @throws {RequiredError}
1678
- * @memberof TradingApiGenerated
1679
- */
1680
- searchCryptocurrencyPairInstruments(requestParameters, options) {
1681
- return (0, exports.TradingApiFp)(this.configuration).searchCryptocurrencyPairInstruments(requestParameters, options).then((request) => request(this.axios, this.basePath));
1682
- }
1683
- }
1684
- exports.TradingApiGenerated = TradingApiGenerated;