snaptrade-typescript-sdk 2.4.0 → 4.0.0

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 (402) hide show
  1. package/.konfig/generate-id.txt +1 -1
  2. package/.konfigignore +3 -1
  3. package/README.md +107 -23
  4. package/api/account-information-api.ts +1075 -0
  5. package/api/api-disclaimer-api.ts +190 -0
  6. package/api/api-status-api.ts +128 -0
  7. package/api/authentication-api.ts +591 -0
  8. package/api/connections-api.ts +425 -0
  9. package/api/error-logs-api.ts +175 -0
  10. package/api/options-api.ts +758 -0
  11. package/api/portfolio-management-api.ts +3402 -0
  12. package/api/reference-data-api.ts +1076 -0
  13. package/api/trading-api.ts +1339 -0
  14. package/api/transactions-and-reporting-api.ts +391 -0
  15. package/api.ts +12 -11530
  16. package/base.ts +1 -2
  17. package/client.ts +55 -0
  18. package/common.ts +16 -54
  19. package/configuration.ts +33 -10
  20. package/dist/api/account-information-api.d.ts +525 -0
  21. package/dist/api/account-information-api.js +1049 -0
  22. package/dist/api/api-disclaimer-api.d.ts +102 -0
  23. package/dist/api/api-disclaimer-api.js +245 -0
  24. package/dist/api/api-status-api.d.ts +70 -0
  25. package/dist/api/api-status-api.js +203 -0
  26. package/dist/api/authentication-api.d.ts +280 -0
  27. package/dist/api/authentication-api.js +659 -0
  28. package/dist/api/connections-api.d.ts +214 -0
  29. package/dist/api/connections-api.js +470 -0
  30. package/dist/api/error-logs-api.d.ts +94 -0
  31. package/dist/api/error-logs-api.js +240 -0
  32. package/dist/api/options-api.d.ts +381 -0
  33. package/dist/api/options-api.js +728 -0
  34. package/dist/api/portfolio-management-api.d.ts +1624 -0
  35. package/dist/api/portfolio-management-api.js +3574 -0
  36. package/dist/api/reference-data-api.d.ts +481 -0
  37. package/dist/api/reference-data-api.js +1244 -0
  38. package/dist/api/trading-api.d.ts +662 -0
  39. package/dist/api/trading-api.js +1276 -0
  40. package/dist/api/transactions-and-reporting-api.d.ts +204 -0
  41. package/dist/api/transactions-and-reporting-api.js +387 -0
  42. package/dist/api.d.ts +12 -7363
  43. package/dist/api.js +24 -9175
  44. package/dist/base.d.ts +1 -1
  45. package/dist/base.js +1 -2
  46. package/dist/client.d.ts +27 -0
  47. package/dist/client.js +34 -0
  48. package/dist/common.d.ts +1 -6
  49. package/dist/common.js +26 -81
  50. package/dist/configuration.d.ts +21 -6
  51. package/dist/configuration.js +13 -8
  52. package/dist/index.d.ts +3 -1
  53. package/dist/index.js +3 -2
  54. package/dist/index.test.js +84 -14
  55. package/dist/jest.config.js +0 -1
  56. package/dist/models/account-holdings.d.ts +47 -0
  57. package/dist/models/account-holdings.js +15 -0
  58. package/dist/models/account-order-record-status.d.ts +39 -0
  59. package/dist/models/account-order-record-status.js +43 -0
  60. package/dist/models/account-order-record.d.ts +126 -0
  61. package/dist/models/account-order-record.js +15 -0
  62. package/dist/models/account-simple.d.ts +37 -0
  63. package/dist/models/account-simple.js +15 -0
  64. package/dist/models/account.d.ts +76 -0
  65. package/dist/models/account.js +15 -0
  66. package/dist/models/action.d.ts +21 -0
  67. package/dist/models/action.js +25 -0
  68. package/dist/models/apidisclaimer-accept-request.d.ts +24 -0
  69. package/dist/models/apidisclaimer-accept-request.js +15 -0
  70. package/dist/models/authentication-login-snap-trade-user200-response.d.ts +18 -0
  71. package/dist/models/authentication-login-snap-trade-user200-response.js +15 -0
  72. package/dist/models/balance.d.ts +32 -0
  73. package/dist/models/balance.js +15 -0
  74. package/dist/models/brokerage-authorization-type-read-only-brokerage.d.ts +37 -0
  75. package/dist/models/brokerage-authorization-type-read-only-brokerage.js +15 -0
  76. package/dist/models/brokerage-authorization-type-read-only.d.ts +56 -0
  77. package/dist/models/brokerage-authorization-type-read-only.js +26 -0
  78. package/dist/models/brokerage-authorization-type.d.ts +30 -0
  79. package/dist/models/brokerage-authorization-type.js +20 -0
  80. package/dist/models/brokerage-authorization.d.ts +76 -0
  81. package/dist/models/brokerage-authorization.js +15 -0
  82. package/dist/models/brokerage-symbol.d.ts +51 -0
  83. package/dist/models/brokerage-symbol.js +15 -0
  84. package/dist/models/brokerage-type.d.ts +31 -0
  85. package/dist/models/brokerage-type.js +15 -0
  86. package/dist/models/brokerage.d.ts +128 -0
  87. package/dist/models/brokerage.js +15 -0
  88. package/dist/models/calculated-trade.d.ts +32 -0
  89. package/dist/models/calculated-trade.js +15 -0
  90. package/dist/models/cash-restriction.d.ts +54 -0
  91. package/dist/models/cash-restriction.js +20 -0
  92. package/dist/models/currency.d.ts +37 -0
  93. package/dist/models/currency.js +15 -0
  94. package/dist/models/delete-user-response.d.ts +31 -0
  95. package/dist/models/delete-user-response.js +15 -0
  96. package/dist/models/dividend-at-date.d.ts +37 -0
  97. package/dist/models/dividend-at-date.js +15 -0
  98. package/dist/models/encrypted-response-encrypted-message-data.d.ts +37 -0
  99. package/dist/models/encrypted-response-encrypted-message-data.js +15 -0
  100. package/dist/models/encrypted-response.d.ts +31 -0
  101. package/dist/models/encrypted-response.js +15 -0
  102. package/dist/models/exchange-rate-pairs.d.ts +38 -0
  103. package/dist/models/exchange-rate-pairs.js +15 -0
  104. package/dist/models/exchange.d.ts +67 -0
  105. package/dist/models/exchange.js +15 -0
  106. package/dist/models/excluded-asset.d.ts +26 -0
  107. package/dist/models/excluded-asset.js +15 -0
  108. package/dist/models/index.d.ts +102 -0
  109. package/dist/models/index.js +118 -0
  110. package/dist/models/jwt.d.ts +25 -0
  111. package/dist/models/jwt.js +15 -0
  112. package/dist/models/login-redirect-uri.d.ts +30 -0
  113. package/dist/models/login-redirect-uri.js +15 -0
  114. package/dist/models/manual-trade-and-impact.d.ts +39 -0
  115. package/dist/models/manual-trade-and-impact.js +15 -0
  116. package/dist/models/manual-trade-balance.d.ts +39 -0
  117. package/dist/models/manual-trade-balance.js +15 -0
  118. package/dist/models/manual-trade-form.d.ts +69 -0
  119. package/dist/models/manual-trade-form.js +15 -0
  120. package/dist/models/manual-trade-symbol.d.ts +56 -0
  121. package/dist/models/manual-trade-symbol.js +15 -0
  122. package/dist/models/manual-trade.d.ts +72 -0
  123. package/dist/models/manual-trade.js +15 -0
  124. package/dist/models/model-asset-class-details.d.ts +32 -0
  125. package/dist/models/model-asset-class-details.js +15 -0
  126. package/dist/models/model-asset-class-target.d.ts +26 -0
  127. package/dist/models/model-asset-class-target.js +15 -0
  128. package/dist/models/model-asset-class.d.ts +31 -0
  129. package/dist/models/model-asset-class.js +15 -0
  130. package/dist/models/model-portfolio-asset-class.d.ts +32 -0
  131. package/dist/models/model-portfolio-asset-class.js +15 -0
  132. package/dist/models/model-portfolio-details.d.ts +39 -0
  133. package/dist/models/model-portfolio-details.js +15 -0
  134. package/dist/models/model-portfolio-security.d.ts +32 -0
  135. package/dist/models/model-portfolio-security.js +15 -0
  136. package/dist/models/model-portfolio.d.ts +43 -0
  137. package/dist/models/model-portfolio.js +21 -0
  138. package/dist/models/model400-failed-request-response.d.ts +31 -0
  139. package/dist/models/model400-failed-request-response.js +15 -0
  140. package/dist/models/model401-failed-request-response.d.ts +31 -0
  141. package/dist/models/model401-failed-request-response.js +15 -0
  142. package/dist/models/model403-failed-request-response.d.ts +31 -0
  143. package/dist/models/model403-failed-request-response.js +15 -0
  144. package/dist/models/model404-failed-request-response.d.ts +31 -0
  145. package/dist/models/model404-failed-request-response.js +15 -0
  146. package/dist/models/monthly-dividends.d.ts +32 -0
  147. package/dist/models/monthly-dividends.js +15 -0
  148. package/dist/models/net-contributions.d.ts +37 -0
  149. package/dist/models/net-contributions.js +15 -0
  150. package/dist/models/net-dividend.d.ts +38 -0
  151. package/dist/models/net-dividend.js +15 -0
  152. package/dist/models/option-chain-inner-chain-per-root-inner-chain-per-strike-price-inner.d.ts +37 -0
  153. package/dist/models/option-chain-inner-chain-per-root-inner-chain-per-strike-price-inner.js +15 -0
  154. package/dist/models/option-chain-inner-chain-per-root-inner.d.ts +38 -0
  155. package/dist/models/option-chain-inner-chain-per-root-inner.js +15 -0
  156. package/dist/models/option-chain-inner.d.ts +50 -0
  157. package/dist/models/option-chain-inner.js +15 -0
  158. package/dist/models/option-leg.d.ts +44 -0
  159. package/dist/models/option-leg.js +22 -0
  160. package/dist/models/option-strategy-legs-inner.d.ts +42 -0
  161. package/dist/models/option-strategy-legs-inner.js +15 -0
  162. package/dist/models/option-strategy.d.ts +51 -0
  163. package/dist/models/option-strategy.js +15 -0
  164. package/dist/models/options-get-option-strategy-request.d.ts +41 -0
  165. package/dist/models/options-get-option-strategy-request.js +19 -0
  166. package/dist/models/options-holdings.d.ts +57 -0
  167. package/dist/models/options-holdings.js +15 -0
  168. package/dist/models/options-place-option-strategy-request.d.ts +48 -0
  169. package/dist/models/options-place-option-strategy-request.js +26 -0
  170. package/dist/models/options-position.d.ts +63 -0
  171. package/dist/models/options-position.js +15 -0
  172. package/dist/models/options-symbol.d.ts +86 -0
  173. package/dist/models/options-symbol.js +15 -0
  174. package/dist/models/order-type.d.ts +23 -0
  175. package/dist/models/order-type.js +27 -0
  176. package/dist/models/partner-data.d.ts +92 -0
  177. package/dist/models/partner-data.js +15 -0
  178. package/dist/models/past-value.d.ts +37 -0
  179. package/dist/models/past-value.js +15 -0
  180. package/dist/models/performance-custom.d.ts +138 -0
  181. package/dist/models/performance-custom.js +15 -0
  182. package/dist/models/portfolio-group-info.d.ts +93 -0
  183. package/dist/models/portfolio-group-info.js +15 -0
  184. package/dist/models/portfolio-group-position.d.ts +38 -0
  185. package/dist/models/portfolio-group-position.js +15 -0
  186. package/dist/models/portfolio-group-settings.d.ts +50 -0
  187. package/dist/models/portfolio-group-settings.js +15 -0
  188. package/dist/models/portfolio-group.d.ts +31 -0
  189. package/dist/models/portfolio-group.js +15 -0
  190. package/dist/models/position-symbol.d.ts +56 -0
  191. package/dist/models/position-symbol.js +15 -0
  192. package/dist/models/position.d.ts +56 -0
  193. package/dist/models/position.js +15 -0
  194. package/dist/models/redirect-tokenand-pin.d.ts +31 -0
  195. package/dist/models/redirect-tokenand-pin.js +15 -0
  196. package/dist/models/security-type.d.ts +43 -0
  197. package/dist/models/security-type.js +15 -0
  198. package/dist/models/snap-trade-apidisclaimer-accept-status.d.ts +31 -0
  199. package/dist/models/snap-trade-apidisclaimer-accept-status.js +15 -0
  200. package/dist/models/snap-trade-holdings-account.d.ts +64 -0
  201. package/dist/models/snap-trade-holdings-account.js +15 -0
  202. package/dist/models/snap-trade-holdings-total-value.d.ts +31 -0
  203. package/dist/models/snap-trade-holdings-total-value.js +15 -0
  204. package/dist/models/snap-trade-login-user-request-body.d.ts +53 -0
  205. package/dist/models/snap-trade-login-user-request-body.js +20 -0
  206. package/dist/models/snap-trade-register-user-request-body.d.ts +30 -0
  207. package/dist/models/snap-trade-register-user-request-body.js +15 -0
  208. package/dist/models/status.d.ts +37 -0
  209. package/dist/models/status.js +15 -0
  210. package/dist/models/strategy-impact-legs-inner.d.ts +61 -0
  211. package/dist/models/strategy-impact-legs-inner.js +15 -0
  212. package/dist/models/strategy-impact.d.ts +86 -0
  213. package/dist/models/strategy-impact.js +15 -0
  214. package/dist/models/strategy-order-place-orders-inner-legs-inner.d.ts +61 -0
  215. package/dist/models/strategy-order-place-orders-inner-legs-inner.js +15 -0
  216. package/dist/models/strategy-order-place-orders-inner.d.ts +278 -0
  217. package/dist/models/strategy-order-place-orders-inner.js +15 -0
  218. package/dist/models/strategy-order-place.d.ts +32 -0
  219. package/dist/models/strategy-order-place.js +15 -0
  220. package/dist/models/strategy-order-record.d.ts +120 -0
  221. package/dist/models/strategy-order-record.js +47 -0
  222. package/dist/models/strategy-quotes-greek.d.ts +49 -0
  223. package/dist/models/strategy-quotes-greek.js +15 -0
  224. package/dist/models/strategy-quotes.d.ts +57 -0
  225. package/dist/models/strategy-quotes.js +15 -0
  226. package/dist/models/sub-period-return-rate.d.ts +37 -0
  227. package/dist/models/sub-period-return-rate.js +15 -0
  228. package/dist/models/symbol-query.d.ts +24 -0
  229. package/dist/models/symbol-query.js +15 -0
  230. package/dist/models/symbol.d.ts +51 -0
  231. package/dist/models/symbol.js +15 -0
  232. package/dist/models/symbols-quotes.d.ts +56 -0
  233. package/dist/models/symbols-quotes.js +15 -0
  234. package/dist/models/target-asset.d.ts +55 -0
  235. package/dist/models/target-asset.js +15 -0
  236. package/dist/models/time-in-force.d.ts +22 -0
  237. package/dist/models/time-in-force.js +26 -0
  238. package/dist/models/trade-execution-status.d.ts +91 -0
  239. package/dist/models/trade-execution-status.js +27 -0
  240. package/dist/models/trade-impact.d.ts +51 -0
  241. package/dist/models/trade-impact.js +15 -0
  242. package/dist/models/trade.d.ts +74 -0
  243. package/dist/models/trade.js +20 -0
  244. package/dist/models/trading-place-ocoorder-request.d.ts +30 -0
  245. package/dist/models/trading-place-ocoorder-request.js +15 -0
  246. package/dist/models/underlying-symbol.d.ts +64 -0
  247. package/dist/models/underlying-symbol.js +15 -0
  248. package/dist/models/universal-activity.d.ts +134 -0
  249. package/dist/models/universal-activity.js +36 -0
  250. package/dist/models/universal-symbol-ticker.d.ts +70 -0
  251. package/dist/models/universal-symbol-ticker.js +15 -0
  252. package/dist/models/universal-symbol.d.ts +69 -0
  253. package/dist/models/universal-symbol.js +15 -0
  254. package/dist/models/user-error-log.d.ts +55 -0
  255. package/dist/models/user-error-log.js +15 -0
  256. package/dist/models/user-idand-secret.d.ts +31 -0
  257. package/dist/models/user-idand-secret.js +15 -0
  258. package/dist/models/user-settings.d.ts +80 -0
  259. package/dist/models/user-settings.js +15 -0
  260. package/dist/models/usexchange.d.ts +73 -0
  261. package/dist/models/usexchange.js +15 -0
  262. package/dist/pagination/page.d.ts +31 -0
  263. package/dist/pagination/page.js +58 -0
  264. package/dist/pagination/pageable.d.ts +53 -0
  265. package/dist/pagination/pageable.js +128 -0
  266. package/dist/pagination/paginate.d.ts +17 -0
  267. package/dist/pagination/paginate.js +78 -0
  268. package/dist/requestAfterHook.d.ts +8 -0
  269. package/dist/requestAfterHook.js +45 -0
  270. package/dist/requestBeforeHook.d.ts +8 -0
  271. package/dist/requestBeforeHook.js +8 -0
  272. package/docs/AccountInformationApi.md +485 -0
  273. package/docs/ApiDisclaimerApi.md +69 -0
  274. package/docs/ApiStatusApi.md +60 -0
  275. package/docs/AuthenticationApi.md +307 -0
  276. package/docs/ConnectionsApi.md +186 -0
  277. package/docs/ErrorLogsApi.md +65 -0
  278. package/docs/OptionsApi.md +321 -0
  279. package/docs/PortfolioManagementApi.md +1866 -0
  280. package/docs/ReferenceDataApi.md +597 -0
  281. package/docs/TradingApi.md +629 -0
  282. package/docs/TransactionsAndReportingApi.md +141 -0
  283. package/index.test.ts +62 -13
  284. package/index.ts +3 -3
  285. package/models/account-holdings.ts +61 -0
  286. package/models/account-order-record-status.ts +48 -0
  287. package/models/account-order-record.ts +142 -0
  288. package/models/account-simple.ts +43 -0
  289. package/models/account.ts +82 -0
  290. package/models/action.ts +30 -0
  291. package/models/apidisclaimer-accept-request.ts +29 -0
  292. package/models/authentication-login-snap-trade-user200-response.ts +31 -0
  293. package/models/balance.ts +40 -0
  294. package/models/brokerage-authorization-type-read-only-brokerage.ts +43 -0
  295. package/models/brokerage-authorization-type-read-only.ts +68 -0
  296. package/models/brokerage-authorization-type.ts +39 -0
  297. package/models/brokerage-authorization.ts +82 -0
  298. package/models/brokerage-symbol.ts +61 -0
  299. package/models/brokerage-type.ts +37 -0
  300. package/models/brokerage.ts +136 -0
  301. package/models/calculated-trade.ts +40 -0
  302. package/models/cash-restriction.ts +63 -0
  303. package/models/currency.ts +43 -0
  304. package/models/delete-user-response.ts +37 -0
  305. package/models/dividend-at-date.ts +43 -0
  306. package/models/encrypted-response-encrypted-message-data.ts +43 -0
  307. package/models/encrypted-response.ts +38 -0
  308. package/models/exchange-rate-pairs.ts +46 -0
  309. package/models/exchange.ts +73 -0
  310. package/models/excluded-asset.ts +34 -0
  311. package/models/index.ts +102 -0
  312. package/models/jwt.ts +31 -0
  313. package/models/login-redirect-uri.ts +35 -0
  314. package/models/manual-trade-and-impact.ts +49 -0
  315. package/models/manual-trade-balance.ts +49 -0
  316. package/models/manual-trade-form.ts +80 -0
  317. package/models/manual-trade-symbol.ts +64 -0
  318. package/models/manual-trade.ts +88 -0
  319. package/models/model-asset-class-details.ts +41 -0
  320. package/models/model-asset-class-target.ts +34 -0
  321. package/models/model-asset-class.ts +37 -0
  322. package/models/model-portfolio-asset-class.ts +40 -0
  323. package/models/model-portfolio-details.ts +50 -0
  324. package/models/model-portfolio-security.ts +40 -0
  325. package/models/model-portfolio.ts +52 -0
  326. package/models/model400-failed-request-response.ts +37 -0
  327. package/models/model401-failed-request-response.ts +37 -0
  328. package/models/model403-failed-request-response.ts +37 -0
  329. package/models/model404-failed-request-response.ts +37 -0
  330. package/models/monthly-dividends.ts +40 -0
  331. package/models/net-contributions.ts +43 -0
  332. package/models/net-dividend.ts +46 -0
  333. package/models/option-chain-inner-chain-per-root-inner-chain-per-strike-price-inner.ts +43 -0
  334. package/models/option-chain-inner-chain-per-root-inner.ts +46 -0
  335. package/models/option-chain-inner.ts +58 -0
  336. package/models/option-leg.ts +53 -0
  337. package/models/option-strategy-legs-inner.ts +47 -0
  338. package/models/option-strategy.ts +61 -0
  339. package/models/options-get-option-strategy-request.ts +51 -0
  340. package/models/options-holdings.ts +67 -0
  341. package/models/options-place-option-strategy-request.ts +57 -0
  342. package/models/options-position.ts +73 -0
  343. package/models/options-symbol.ts +94 -0
  344. package/models/order-type.ts +32 -0
  345. package/models/partner-data.ts +100 -0
  346. package/models/past-value.ts +43 -0
  347. package/models/performance-custom.ts +154 -0
  348. package/models/portfolio-group-info.ts +115 -0
  349. package/models/portfolio-group-position.ts +46 -0
  350. package/models/portfolio-group-settings.ts +58 -0
  351. package/models/portfolio-group.ts +37 -0
  352. package/models/position-symbol.ts +64 -0
  353. package/models/position.ts +64 -0
  354. package/models/redirect-tokenand-pin.ts +37 -0
  355. package/models/security-type.ts +49 -0
  356. package/models/snap-trade-apidisclaimer-accept-status.ts +37 -0
  357. package/models/snap-trade-holdings-account.ts +70 -0
  358. package/models/snap-trade-holdings-total-value.ts +37 -0
  359. package/models/snap-trade-login-user-request-body.ts +61 -0
  360. package/models/snap-trade-register-user-request-body.ts +35 -0
  361. package/models/status.ts +43 -0
  362. package/models/strategy-impact-legs-inner.ts +67 -0
  363. package/models/strategy-impact.ts +94 -0
  364. package/models/strategy-order-place-orders-inner-legs-inner.ts +67 -0
  365. package/models/strategy-order-place-orders-inner.ts +286 -0
  366. package/models/strategy-order-place.ts +40 -0
  367. package/models/strategy-order-record.ts +133 -0
  368. package/models/strategy-quotes-greek.ts +55 -0
  369. package/models/strategy-quotes.ts +67 -0
  370. package/models/sub-period-return-rate.ts +43 -0
  371. package/models/symbol-query.ts +29 -0
  372. package/models/symbol.ts +61 -0
  373. package/models/symbols-quotes.ts +64 -0
  374. package/models/target-asset.ts +62 -0
  375. package/models/time-in-force.ts +31 -0
  376. package/models/trade-execution-status.ts +105 -0
  377. package/models/trade-impact.ts +61 -0
  378. package/models/trade.ts +88 -0
  379. package/models/trading-place-ocoorder-request.ts +35 -0
  380. package/models/underlying-symbol.ts +76 -0
  381. package/models/universal-activity.ts +151 -0
  382. package/models/universal-symbol-ticker.ts +82 -0
  383. package/models/universal-symbol.ts +80 -0
  384. package/models/user-error-log.ts +61 -0
  385. package/models/user-idand-secret.ts +37 -0
  386. package/models/user-settings.ts +88 -0
  387. package/models/usexchange.ts +79 -0
  388. package/package.json +1 -1
  389. package/pagination/page.ts +50 -0
  390. package/pagination/pageable.ts +107 -0
  391. package/pagination/paginate.ts +40 -0
  392. package/requestAfterHook.ts +53 -0
  393. package/requestBeforeHook.ts +14 -0
  394. package/tsconfig.json +0 -1
  395. package/dist/api.js.map +0 -1
  396. package/dist/base.js.map +0 -1
  397. package/dist/common.js.map +0 -1
  398. package/dist/configuration.js.map +0 -1
  399. package/dist/index.js.map +0 -1
  400. package/dist/index.test.js.map +0 -1
  401. package/dist/jest.config.js.map +0 -1
  402. package/git_push.sh +0 -57
@@ -0,0 +1,141 @@
1
+ # TransactionsAndReportingApi
2
+
3
+ All URIs are relative to *https://api.snaptrade.com/api/v1*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**getActivities**](TransactionsAndReportingApi.md#getActivities) | **GET** /activities | Get transaction history for a user
8
+ [**getReportingCustomRange**](TransactionsAndReportingApi.md#getReportingCustomRange) | **GET** /performance/custom | Get performance information for a specific timeframe
9
+
10
+
11
+ # **getActivities**
12
+ > Array<UniversalActivity> getActivities()
13
+
14
+ Returns activities (transactions) for a user. Specifing start and end date is highly recommended for automatic calls for better performance
15
+
16
+ ### Example
17
+
18
+
19
+ ```typescript
20
+ import { Snaptrade } from "snaptrade-typescript-sdk"
21
+
22
+ const snaptrade = new Snaptrade({
23
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
24
+ // basePath: "https://api.snaptrade.com/api/v1",
25
+ consumerKey: "YOUR_CONSUMER_KEY",
26
+ clientId: "YOUR_CLIENT_ID",
27
+ })
28
+
29
+ const response = await snaptrade.transactionsAndReporting.getActivities({
30
+ 'userId': "John.doe@snaptrade.com",
31
+ 'userSecret': "USERSECRET123",
32
+ 'startDate': "2022-01-24T00:00:00.000Z",
33
+ 'endDate': "2022-01-24T00:00:00.000Z",
34
+ 'accounts': "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
35
+ })
36
+ console.log(response)
37
+
38
+ ```
39
+
40
+
41
+ ### Parameters
42
+
43
+ Name | Type | Description | Notes
44
+ ------------- | ------------- | ------------- | -------------
45
+ **userId** | [**string**] | | defaults to undefined
46
+ **userSecret** | [**string**] | | defaults to undefined
47
+ **startDate** | [**string**] | | (optional) defaults to undefined
48
+ **endDate** | [**string**] | | (optional) defaults to undefined
49
+ **accounts** | [**string**] | Optional comma seperated list of account IDs used to filter the request on specific accounts | (optional) defaults to undefined
50
+
51
+
52
+ ### Return type
53
+
54
+ **Array<UniversalActivity>**
55
+
56
+ ### Authorization
57
+
58
+ [PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
59
+
60
+ ### HTTP request headers
61
+
62
+ - **Content-Type**: Not defined
63
+ - **Accept**: application/json
64
+
65
+
66
+ ### HTTP response details
67
+ | Status code | Description | Response headers |
68
+ |-------------|-------------|------------------|
69
+ **200** | Successfully retrieved transaction history | - |
70
+ **0** | Unexpected error | - |
71
+
72
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
73
+
74
+ # **getReportingCustomRange**
75
+ > PerformanceCustom getReportingCustomRange()
76
+
77
+ Returns performance information (contributions, dividends, rate of return, etc) for a specific timeframe. Total Equity Timeframe and Rate of Returns are experimental and should not be trusted to be 100% accurate
78
+
79
+ ### Example
80
+
81
+
82
+ ```typescript
83
+ import { Snaptrade } from "snaptrade-typescript-sdk"
84
+
85
+ const snaptrade = new Snaptrade({
86
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
87
+ // basePath: "https://api.snaptrade.com/api/v1",
88
+ consumerKey: "YOUR_CONSUMER_KEY",
89
+ clientId: "YOUR_CLIENT_ID",
90
+ })
91
+
92
+ const response = await snaptrade.transactionsAndReporting.getReportingCustomRange({
93
+ 'startDate': "2022-01-24T00:00:00.000Z",
94
+ 'endDate': "2022-01-24T00:00:00.000Z",
95
+ 'userId': "John.doe@snaptrade.com",
96
+ 'userSecret': "USERSECRET123",
97
+ 'accounts': "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
98
+ 'detailed': true,
99
+ 'frequency': "monthly",
100
+ })
101
+ console.log(response)
102
+
103
+ ```
104
+
105
+
106
+ ### Parameters
107
+
108
+ Name | Type | Description | Notes
109
+ ------------- | ------------- | ------------- | -------------
110
+ **startDate** | [**string**] | | defaults to undefined
111
+ **endDate** | [**string**] | | defaults to undefined
112
+ **userId** | [**string**] | | defaults to undefined
113
+ **userSecret** | [**string**] | | defaults to undefined
114
+ **accounts** | [**string**] | Optional comma seperated list of account IDs used to filter the request on specific accounts | (optional) defaults to undefined
115
+ **detailed** | [**boolean**] | Optional, increases frequency of data points for the total value and contribution charts if set to true | (optional) defaults to undefined
116
+ **frequency** | [**string**] | Optional frequency for the rate of return chart (defaults to monthly). Possible values are daily, weekly, monthly, quarterly, yearly. | (optional) defaults to undefined
117
+
118
+
119
+ ### Return type
120
+
121
+ **PerformanceCustom**
122
+
123
+ ### Authorization
124
+
125
+ [PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
126
+
127
+ ### HTTP request headers
128
+
129
+ - **Content-Type**: Not defined
130
+ - **Accept**: application/json
131
+
132
+
133
+ ### HTTP response details
134
+ | Status code | Description | Response headers |
135
+ |-------------|-------------|------------------|
136
+ **200** | Successfully retrieved performance data | - |
137
+ **0** | Unexpected error | - |
138
+
139
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
140
+
141
+
package/index.test.ts CHANGED
@@ -1,5 +1,4 @@
1
- import { APIStatusApi, AuthenticationApi, AccountInformationApi } from "./api";
2
- import { Configuration } from "./configuration";
1
+ import { Snaptrade } from "./index";
3
2
 
4
3
  function uuid() {
5
4
  var d = new Date().getTime(); //Timestamp
@@ -24,23 +23,23 @@ function uuid() {
24
23
  }
25
24
 
26
25
  it("getting started", async () => {
27
- // 1) Initialize a configuration with your clientID and consumerKey.
28
- const config = new Configuration({
26
+ // 1) Initialize a client with your clientID and consumerKey.
27
+ const snaptrade = new Snaptrade({
29
28
  consumerKey: process.env.SNAPTRADE_CONSUMER_KEY,
30
29
  clientId: process.env.SNAPTRADE_CLIENT_ID,
31
30
  });
32
31
 
33
32
  // 2) Check that the client is able to make a request to the API server.
34
- const apiStatusApiInst = new APIStatusApi(config);
35
- const status = await apiStatusApiInst.check();
33
+ const status = await snaptrade.apiStatus.check();
36
34
  console.log("status:", status.data);
37
35
 
38
36
  // 3) Create a new user on SnapTrade
39
37
  const userId = uuid();
40
- const authenticationApiInst = new AuthenticationApi(config);
41
38
  const { userSecret } = (
42
- await authenticationApiInst.registerSnapTradeUser({
43
- userId,
39
+ await snaptrade.authentication.registerSnapTradeUser({
40
+ requestBody: {
41
+ userId,
42
+ },
44
43
  })
45
44
  ).data;
46
45
 
@@ -50,21 +49,71 @@ it("getting started", async () => {
50
49
 
51
50
  // 4) Get a redirect URI. Users will need this to connect
52
51
  const data = (
53
- await authenticationApiInst.loginSnapTradeUser(userId, userSecret)
52
+ await snaptrade.authentication.loginSnapTradeUser({ userId, userSecret })
54
53
  ).data;
55
54
  if (!("redirectURI" in data)) throw Error("Should have gotten redirect URI");
56
55
  console.log("redirectURI:", data.redirectURI);
57
56
 
58
57
  // 5) Obtaining account holdings data
59
- const accountInformationApi = new AccountInformationApi(config);
60
58
  const holdings = (
61
- await accountInformationApi.getAllUserHoldings(userId, userSecret)
59
+ await snaptrade.accountInformation.getAllUserHoldings({
60
+ userId,
61
+ userSecret,
62
+ })
62
63
  ).data;
63
64
  console.log("holdings:", holdings);
64
65
 
65
66
  // 6) Deleting a user
66
67
  const deleteResponse = (
67
- await authenticationApiInst.deleteSnapTradeUser(userId)
68
+ await snaptrade.authentication.deleteSnapTradeUser({ userId })
68
69
  ).data;
69
70
  console.log("deleteResponse:", deleteResponse);
70
71
  });
72
+
73
+ it("getUserAccountBalance", async () => {
74
+ const snaptrade = new Snaptrade({
75
+ consumerKey: process.env.SNAPTRADE_CONSUMER_KEY,
76
+ clientId: process.env.SNAPTRADE_CLIENT_ID,
77
+ });
78
+ const userId = process.env.SNAPTRADE_TEST_USER_ID;
79
+ const userSecret = process.env.SNAPTRADE_TEST_USER_SECRET;
80
+ const accounts = await snaptrade.accountInformation.listUserAccounts({
81
+ userId,
82
+ userSecret,
83
+ });
84
+ console.log(accounts.data);
85
+ const response = await snaptrade.accountInformation.getUserAccountBalance({
86
+ accountId: accounts.data[0].id,
87
+ userId,
88
+ userSecret,
89
+ });
90
+ console.log(response.data);
91
+ });
92
+
93
+ it.skip("getOptionsChain", async () => {
94
+ const snaptrade = new Snaptrade({
95
+ consumerKey: process.env.SNAPTRADE_CONSUMER_KEY,
96
+ clientId: process.env.SNAPTRADE_CLIENT_ID,
97
+ });
98
+ const userId = process.env.SNAPTRADE_TEST_USER_ID;
99
+ const userSecret = process.env.SNAPTRADE_TEST_USER_SECRET;
100
+ const accounts = await snaptrade.accountInformation.listUserAccounts({
101
+ userId,
102
+ userSecret,
103
+ });
104
+ console.log(accounts.data);
105
+ const accountId = accounts.data[0].id;
106
+ const symbols = await snaptrade.referenceData.getSymbols({
107
+ requestBody: { substring: "apple" },
108
+ });
109
+ console.log(symbols);
110
+ const symbol = symbols.data[0].id;
111
+ console.log(symbol);
112
+ const response = await snaptrade.options.getOptionsChain({
113
+ accountId,
114
+ userId,
115
+ userSecret,
116
+ symbol,
117
+ });
118
+ console.log(response.data);
119
+ });
package/index.ts CHANGED
@@ -7,12 +7,12 @@
7
7
  * The version of the OpenAPI document: 1.0.0
8
8
  * Contact: api@snaptrade.com
9
9
  *
10
- * NOTE: This class is auto generated by Konfig (https://konfigthis.com).
10
+ * NOTE: This file is auto generated by Konfig (https://konfigthis.com).
11
11
  * https://konfigthis.com
12
12
  * Do not edit the class manually.
13
13
  */
14
14
 
15
-
16
15
  export * from "./api";
17
16
  export * from "./configuration";
18
-
17
+ export * from "./models";
18
+ export * from "./client";
@@ -0,0 +1,61 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * SnapTrade
5
+ * Connect brokerage accounts to your app for live positions and trading
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: api@snaptrade.com
9
+ *
10
+ * NOTE: This file is auto generated by Konfig (https://konfigthis.com).
11
+ * https://konfigthis.com
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ // May contain unused imports in some cases
16
+ // @ts-ignore
17
+ import { Balance } from './balance';
18
+ // May contain unused imports in some cases
19
+ // @ts-ignore
20
+ import { Position } from './position';
21
+ // May contain unused imports in some cases
22
+ // @ts-ignore
23
+ import { SnapTradeHoldingsAccount } from './snap-trade-holdings-account';
24
+ // May contain unused imports in some cases
25
+ // @ts-ignore
26
+ import { SnapTradeHoldingsTotalValue } from './snap-trade-holdings-total-value';
27
+
28
+ /**
29
+ * Account Holdings
30
+ * @export
31
+ * @interface AccountHoldings
32
+ */
33
+ export interface AccountHoldings {
34
+ [key: string]: any;
35
+
36
+ /**
37
+ *
38
+ * @type {SnapTradeHoldingsAccount}
39
+ * @memberof AccountHoldings
40
+ */
41
+ 'account'?: SnapTradeHoldingsAccount;
42
+ /**
43
+ *
44
+ * @type {Array<Balance>}
45
+ * @memberof AccountHoldings
46
+ */
47
+ 'balances'?: Array<Balance>;
48
+ /**
49
+ *
50
+ * @type {Array<Position>}
51
+ * @memberof AccountHoldings
52
+ */
53
+ 'positions'?: Array<Position>;
54
+ /**
55
+ *
56
+ * @type {SnapTradeHoldingsTotalValue}
57
+ * @memberof AccountHoldings
58
+ */
59
+ 'total_value'?: SnapTradeHoldingsTotalValue;
60
+ }
61
+
@@ -0,0 +1,48 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * SnapTrade
5
+ * Connect brokerage accounts to your app for live positions and trading
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: api@snaptrade.com
9
+ *
10
+ * NOTE: This file is auto generated by Konfig (https://konfigthis.com).
11
+ * https://konfigthis.com
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ /**
17
+ *
18
+ * @export
19
+ * @enum {string}
20
+ */
21
+
22
+ export const AccountOrderRecordStatus = {
23
+ None: 'NONE',
24
+ Pending: 'PENDING',
25
+ Accepted: 'ACCEPTED',
26
+ Failed: 'FAILED',
27
+ Rejected: 'REJECTED',
28
+ Canceled: 'CANCELED',
29
+ PartialCanceled: 'PARTIAL_CANCELED',
30
+ CancelPending: 'CANCEL_PENDING',
31
+ Executed: 'EXECUTED',
32
+ Partial: 'PARTIAL',
33
+ ReplacePending: 'REPLACE_PENDING',
34
+ Replaced: 'REPLACED',
35
+ Stopped: 'STOPPED',
36
+ Suspended: 'SUSPENDED',
37
+ Expired: 'EXPIRED',
38
+ Queued: 'QUEUED',
39
+ Triggered: 'TRIGGERED',
40
+ Activated: 'ACTIVATED',
41
+ PendingRiskReview: 'PENDING_RISK_REVIEW',
42
+ ContingentOrder: 'CONTINGENT_ORDER'
43
+ } as const;
44
+
45
+ export type AccountOrderRecordStatus = typeof AccountOrderRecordStatus[keyof typeof AccountOrderRecordStatus];
46
+
47
+
48
+
@@ -0,0 +1,142 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * SnapTrade
5
+ * Connect brokerage accounts to your app for live positions and trading
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: api@snaptrade.com
9
+ *
10
+ * NOTE: This file is auto generated by Konfig (https://konfigthis.com).
11
+ * https://konfigthis.com
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ // May contain unused imports in some cases
16
+ // @ts-ignore
17
+ import { AccountOrderRecordStatus } from './account-order-record-status';
18
+ // May contain unused imports in some cases
19
+ // @ts-ignore
20
+ import { Action } from './action';
21
+ // May contain unused imports in some cases
22
+ // @ts-ignore
23
+ import { OrderType } from './order-type';
24
+ // May contain unused imports in some cases
25
+ // @ts-ignore
26
+ import { TimeInForce } from './time-in-force';
27
+ // May contain unused imports in some cases
28
+ // @ts-ignore
29
+ import { UniversalSymbol } from './universal-symbol';
30
+
31
+ /**
32
+ * Record of order in brokerageaccount
33
+ * @export
34
+ * @interface AccountOrderRecord
35
+ */
36
+ export interface AccountOrderRecord {
37
+ [key: string]: any;
38
+
39
+ /**
40
+ * Order id returned by brokerage
41
+ * @type {string}
42
+ * @memberof AccountOrderRecord
43
+ */
44
+ 'brokerage_order_id'?: string;
45
+ /**
46
+ *
47
+ * @type {AccountOrderRecordStatus}
48
+ * @memberof AccountOrderRecord
49
+ */
50
+ 'status'?: AccountOrderRecordStatus;
51
+ /**
52
+ *
53
+ * @type {string}
54
+ * @memberof AccountOrderRecord
55
+ */
56
+ 'symbol'?: string;
57
+ /**
58
+ *
59
+ * @type {UniversalSymbol}
60
+ * @memberof AccountOrderRecord
61
+ */
62
+ 'universal_symbol'?: UniversalSymbol;
63
+ /**
64
+ *
65
+ * @type {Action}
66
+ * @memberof AccountOrderRecord
67
+ */
68
+ 'action'?: Action;
69
+ /**
70
+ * Trade Units
71
+ * @type {number}
72
+ * @memberof AccountOrderRecord
73
+ */
74
+ 'total_quantity'?: number;
75
+ /**
76
+ * Trade Units
77
+ * @type {number}
78
+ * @memberof AccountOrderRecord
79
+ */
80
+ 'open_quantity'?: number;
81
+ /**
82
+ * Trade Units
83
+ * @type {number}
84
+ * @memberof AccountOrderRecord
85
+ */
86
+ 'canceled_quantity'?: number;
87
+ /**
88
+ * Trade Units
89
+ * @type {number}
90
+ * @memberof AccountOrderRecord
91
+ */
92
+ 'filled_quantity'?: number;
93
+ /**
94
+ * Trade Price if limit or stop limit order
95
+ * @type {number}
96
+ * @memberof AccountOrderRecord
97
+ */
98
+ 'execution_price'?: number;
99
+ /**
100
+ * Trade Price if limit or stop limit order
101
+ * @type {number}
102
+ * @memberof AccountOrderRecord
103
+ */
104
+ 'limit_price'?: number;
105
+ /**
106
+ * Trade Price if limit or stop limit order
107
+ * @type {number}
108
+ * @memberof AccountOrderRecord
109
+ */
110
+ 'stop_price'?: number;
111
+ /**
112
+ *
113
+ * @type {OrderType}
114
+ * @memberof AccountOrderRecord
115
+ */
116
+ 'order_type'?: OrderType;
117
+ /**
118
+ *
119
+ * @type {TimeInForce}
120
+ * @memberof AccountOrderRecord
121
+ */
122
+ 'time_in_force'?: TimeInForce;
123
+ /**
124
+ * Time
125
+ * @type {string}
126
+ * @memberof AccountOrderRecord
127
+ */
128
+ 'time_placed'?: string;
129
+ /**
130
+ * Time
131
+ * @type {string}
132
+ * @memberof AccountOrderRecord
133
+ */
134
+ 'time_updated'?: string;
135
+ /**
136
+ * Time
137
+ * @type {string}
138
+ * @memberof AccountOrderRecord
139
+ */
140
+ 'expiry_date'?: string;
141
+ }
142
+
@@ -0,0 +1,43 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * SnapTrade
5
+ * Connect brokerage accounts to your app for live positions and trading
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: api@snaptrade.com
9
+ *
10
+ * NOTE: This file is auto generated by Konfig (https://konfigthis.com).
11
+ * https://konfigthis.com
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ /**
17
+ * SnapTradeUser Investment Account
18
+ * @export
19
+ * @interface AccountSimple
20
+ */
21
+ export interface AccountSimple {
22
+ [key: string]: any;
23
+
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof AccountSimple
28
+ */
29
+ 'id'?: string;
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof AccountSimple
34
+ */
35
+ 'name'?: string;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof AccountSimple
40
+ */
41
+ 'number'?: string;
42
+ }
43
+
@@ -0,0 +1,82 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * SnapTrade
5
+ * Connect brokerage accounts to your app for live positions and trading
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: api@snaptrade.com
9
+ *
10
+ * NOTE: This file is auto generated by Konfig (https://konfigthis.com).
11
+ * https://konfigthis.com
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ // May contain unused imports in some cases
16
+ // @ts-ignore
17
+ import { CashRestriction } from './cash-restriction';
18
+
19
+ /**
20
+ * SnapTradeUser Investment Account
21
+ * @export
22
+ * @interface Account
23
+ */
24
+ export interface Account {
25
+ [key: string]: any;
26
+
27
+ /**
28
+ *
29
+ * @type {string}
30
+ * @memberof Account
31
+ */
32
+ 'id'?: string;
33
+ /**
34
+ *
35
+ * @type {string}
36
+ * @memberof Account
37
+ */
38
+ 'brokerage_authorization'?: string;
39
+ /**
40
+ *
41
+ * @type {string}
42
+ * @memberof Account
43
+ */
44
+ 'portfolio_group'?: string;
45
+ /**
46
+ *
47
+ * @type {string}
48
+ * @memberof Account
49
+ */
50
+ 'name'?: string;
51
+ /**
52
+ *
53
+ * @type {string}
54
+ * @memberof Account
55
+ */
56
+ 'number'?: string;
57
+ /**
58
+ *
59
+ * @type {string}
60
+ * @memberof Account
61
+ */
62
+ 'institution_name'?: string;
63
+ /**
64
+ *
65
+ * @type {string}
66
+ * @memberof Account
67
+ */
68
+ 'created_date'?: string;
69
+ /**
70
+ *
71
+ * @type {{ [key: string]: any; }}
72
+ * @memberof Account
73
+ */
74
+ 'meta'?: { [key: string]: any; };
75
+ /**
76
+ *
77
+ * @type {Array<CashRestriction>}
78
+ * @memberof Account
79
+ */
80
+ 'cash_restrictions'?: Array<CashRestriction>;
81
+ }
82
+
@@ -0,0 +1,30 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * SnapTrade
5
+ * Connect brokerage accounts to your app for live positions and trading
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: api@snaptrade.com
9
+ *
10
+ * NOTE: This file is auto generated by Konfig (https://konfigthis.com).
11
+ * https://konfigthis.com
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ /**
17
+ * Trade Action
18
+ * @export
19
+ * @enum {string}
20
+ */
21
+
22
+ export const Action = {
23
+ Buy: 'BUY',
24
+ Sell: 'SELL'
25
+ } as const;
26
+
27
+ export type Action = typeof Action[keyof typeof Action];
28
+
29
+
30
+