snaptrade-typescript-sdk 9.0.200 → 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.
- package/README.md +40 -2
- package/dist/chunk-e9Ob2GDo.mjs +26 -0
- package/dist/index.cjs +6594 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.mts +10422 -0
- package/dist/index.d.ts +1 -5
- package/dist/index.mjs +6527 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +27 -13
- package/dist/api/account-information-api-generated.d.ts +0 -950
- package/dist/api/account-information-api-generated.js +0 -1372
- package/dist/api/account-information-api.d.ts +0 -4
- package/dist/api/account-information-api.js +0 -22
- package/dist/api/api-status-api-generated.d.ts +0 -59
- package/dist/api/api-status-api-generated.js +0 -133
- package/dist/api/api-status-api.d.ts +0 -4
- package/dist/api/api-status-api.js +0 -22
- package/dist/api/authentication-api-generated.d.ts +0 -241
- package/dist/api/authentication-api-generated.js +0 -482
- package/dist/api/authentication-api.d.ts +0 -4
- package/dist/api/authentication-api.js +0 -22
- package/dist/api/connections-api-generated.d.ts +0 -576
- package/dist/api/connections-api-generated.js +0 -868
- package/dist/api/connections-api.d.ts +0 -4
- package/dist/api/connections-api.js +0 -22
- package/dist/api/options-api-generated.d.ts +0 -90
- package/dist/api/options-api-generated.js +0 -158
- package/dist/api/options-api.d.ts +0 -4
- package/dist/api/options-api.js +0 -22
- package/dist/api/reference-data-api-generated.d.ts +0 -497
- package/dist/api/reference-data-api-generated.js +0 -973
- package/dist/api/reference-data-api.d.ts +0 -4
- package/dist/api/reference-data-api.js +0 -22
- package/dist/api/trading-api-generated.d.ts +0 -1058
- package/dist/api/trading-api-generated.js +0 -1688
- package/dist/api/trading-api.d.ts +0 -4
- package/dist/api/trading-api.js +0 -22
- package/dist/api/transactions-and-reporting-api-generated.d.ts +0 -215
- package/dist/api/transactions-and-reporting-api-generated.js +0 -299
- package/dist/api/transactions-and-reporting-api.d.ts +0 -4
- package/dist/api/transactions-and-reporting-api.js +0 -22
- package/dist/api.d.ts +0 -8
- package/dist/api.js +0 -36
- package/dist/base.d.ts +0 -44
- package/dist/base.js +0 -60
- package/dist/browser.js +0 -2
- package/dist/browser.js.LICENSE.txt +0 -1
- package/dist/client-custom.d.ts +0 -4
- package/dist/client-custom.js +0 -7
- package/dist/client.d.ts +0 -14
- package/dist/client.js +0 -31
- package/dist/common.d.ts +0 -61
- package/dist/common.js +0 -220
- package/dist/configuration.d.ts +0 -98
- package/dist/configuration.js +0 -53
- package/dist/error.d.ts +0 -46
- package/dist/error.js +0 -105
- package/dist/index.js +0 -33
- package/dist/jest.config.d.ts +0 -3
- package/dist/jest.config.js +0 -13
- package/dist/mock.test.d.ts +0 -1
- package/dist/mock.test.js +0 -29
- package/dist/models/account-balance-total.d.ts +0 -19
- package/dist/models/account-balance-total.js +0 -2
- package/dist/models/account-balance.d.ts +0 -14
- package/dist/models/account-balance.js +0 -2
- package/dist/models/account-holdings-account.d.ts +0 -51
- package/dist/models/account-holdings-account.js +0 -2
- package/dist/models/account-holdings.d.ts +0 -37
- package/dist/models/account-holdings.js +0 -2
- package/dist/models/account-information-get-user-account-order-detail-request.d.ts +0 -13
- package/dist/models/account-information-get-user-account-order-detail-request.js +0 -2
- package/dist/models/account-order-record-child-brokerage-order-ids.d.ts +0 -19
- package/dist/models/account-order-record-child-brokerage-order-ids.js +0 -2
- package/dist/models/account-order-record-leg-instrument.d.ts +0 -38
- package/dist/models/account-order-record-leg-instrument.js +0 -2
- package/dist/models/account-order-record-leg.d.ts +0 -58
- package/dist/models/account-order-record-leg.js +0 -2
- package/dist/models/account-order-record-option-symbol.d.ts +0 -52
- package/dist/models/account-order-record-option-symbol.js +0 -2
- package/dist/models/account-order-record-quote-currency.d.ts +0 -25
- package/dist/models/account-order-record-quote-currency.js +0 -2
- package/dist/models/account-order-record-quote-universal-symbol.d.ts +0 -73
- package/dist/models/account-order-record-quote-universal-symbol.js +0 -2
- package/dist/models/account-order-record-status-v2.d.ts +0 -6
- package/dist/models/account-order-record-status-v2.js +0 -2
- package/dist/models/account-order-record-status.d.ts +0 -6
- package/dist/models/account-order-record-status.js +0 -2
- package/dist/models/account-order-record-trailing-stop.d.ts +0 -21
- package/dist/models/account-order-record-trailing-stop.js +0 -2
- package/dist/models/account-order-record-universal-symbol.d.ts +0 -73
- package/dist/models/account-order-record-universal-symbol.js +0 -2
- package/dist/models/account-order-record-v2.d.ts +0 -97
- package/dist/models/account-order-record-v2.js +0 -2
- package/dist/models/account-order-record.d.ts +0 -168
- package/dist/models/account-order-record.js +0 -2
- package/dist/models/account-orders-v2-response.d.ts +0 -15
- package/dist/models/account-orders-v2-response.js +0 -2
- package/dist/models/account-position.d.ts +0 -52
- package/dist/models/account-position.js +0 -2
- package/dist/models/account-simple.d.ts +0 -39
- package/dist/models/account-simple.js +0 -2
- package/dist/models/account-sync-status.d.ts +0 -21
- package/dist/models/account-sync-status.js +0 -2
- package/dist/models/account-universal-activity-currency.d.ts +0 -25
- package/dist/models/account-universal-activity-currency.js +0 -2
- package/dist/models/account-universal-activity-option-symbol.d.ts +0 -52
- package/dist/models/account-universal-activity-option-symbol.js +0 -2
- package/dist/models/account-universal-activity-symbol.d.ts +0 -65
- package/dist/models/account-universal-activity-symbol.js +0 -2
- package/dist/models/account-universal-activity.d.ts +0 -107
- package/dist/models/account-universal-activity.js +0 -2
- package/dist/models/account-value-history-item.d.ts +0 -20
- package/dist/models/account-value-history-item.js +0 -2
- package/dist/models/account-value-history-response.d.ts +0 -21
- package/dist/models/account-value-history-response.js +0 -2
- package/dist/models/account.d.ts +0 -126
- package/dist/models/account.js +0 -2
- package/dist/models/action-strict-with-options.d.ts +0 -6
- package/dist/models/action-strict-with-options.js +0 -2
- package/dist/models/action-strict.d.ts +0 -6
- package/dist/models/action-strict.js +0 -2
- package/dist/models/adr-instrument.d.ts +0 -59
- package/dist/models/adr-instrument.js +0 -2
- package/dist/models/all-account-positions-response.d.ts +0 -15
- package/dist/models/all-account-positions-response.js +0 -2
- package/dist/models/authentication-login-snap-trade-user200-response.d.ts +0 -7
- package/dist/models/authentication-login-snap-trade-user200-response.js +0 -2
- package/dist/models/balance-currency.d.ts +0 -25
- package/dist/models/balance-currency.js +0 -2
- package/dist/models/balance.d.ts +0 -27
- package/dist/models/balance.js +0 -2
- package/dist/models/brokerage-authorization-disabled-confirmation.d.ts +0 -14
- package/dist/models/brokerage-authorization-disabled-confirmation.js +0 -2
- package/dist/models/brokerage-authorization-refresh-confirmation.d.ts +0 -14
- package/dist/models/brokerage-authorization-refresh-confirmation.js +0 -2
- package/dist/models/brokerage-authorization-transactions-sync-confirmation.d.ts +0 -14
- package/dist/models/brokerage-authorization-transactions-sync-confirmation.js +0 -2
- package/dist/models/brokerage-authorization-type-read-only-brokerage.d.ts +0 -26
- package/dist/models/brokerage-authorization-type-read-only-brokerage.js +0 -2
- package/dist/models/brokerage-authorization-type-read-only.d.ts +0 -36
- package/dist/models/brokerage-authorization-type-read-only.js +0 -2
- package/dist/models/brokerage-authorization.d.ts +0 -73
- package/dist/models/brokerage-authorization.js +0 -2
- package/dist/models/brokerage-instrument.d.ts +0 -38
- package/dist/models/brokerage-instrument.js +0 -2
- package/dist/models/brokerage-instruments-response.d.ts +0 -15
- package/dist/models/brokerage-instruments-response.js +0 -2
- package/dist/models/brokerage-type.d.ts +0 -20
- package/dist/models/brokerage-type.js +0 -2
- package/dist/models/brokerage.d.ts +0 -122
- package/dist/models/brokerage.js +0 -2
- package/dist/models/cancel-order-response.d.ts +0 -22
- package/dist/models/cancel-order-response.js +0 -2
- package/dist/models/cef-instrument.d.ts +0 -59
- package/dist/models/cef-instrument.js +0 -2
- package/dist/models/child-brokerage-order-ids.d.ts +0 -20
- package/dist/models/child-brokerage-order-ids.js +0 -2
- package/dist/models/complex-order-leg.d.ts +0 -62
- package/dist/models/complex-order-leg.js +0 -2
- package/dist/models/complex-order-response.d.ts +0 -22
- package/dist/models/complex-order-response.js +0 -2
- package/dist/models/connections-session-events200-response-inner.d.ts +0 -6
- package/dist/models/connections-session-events200-response-inner.js +0 -2
- package/dist/models/crypto-instrument.d.ts +0 -59
- package/dist/models/crypto-instrument.js +0 -2
- package/dist/models/crypto-order-form.d.ts +0 -66
- package/dist/models/crypto-order-form.js +0 -2
- package/dist/models/crypto-order-preview-estimated-fee.d.ts +0 -20
- package/dist/models/crypto-order-preview-estimated-fee.js +0 -2
- package/dist/models/crypto-order-preview.d.ts +0 -15
- package/dist/models/crypto-order-preview.js +0 -2
- package/dist/models/crypto-trading-instrument.d.ts +0 -22
- package/dist/models/crypto-trading-instrument.js +0 -2
- package/dist/models/cryptocurrency-pair-quote.d.ts +0 -32
- package/dist/models/cryptocurrency-pair-quote.js +0 -2
- package/dist/models/cryptocurrency-pair.d.ts +0 -32
- package/dist/models/cryptocurrency-pair.js +0 -2
- package/dist/models/currency.d.ts +0 -26
- package/dist/models/currency.js +0 -2
- package/dist/models/delete-connection-confirmation.d.ts +0 -20
- package/dist/models/delete-connection-confirmation.js +0 -2
- package/dist/models/delete-user-response.d.ts +0 -26
- package/dist/models/delete-user-response.js +0 -2
- package/dist/models/dividend-at-date.d.ts +0 -26
- package/dist/models/dividend-at-date.js +0 -2
- package/dist/models/encrypted-response-encrypted-message-data.d.ts +0 -26
- package/dist/models/encrypted-response-encrypted-message-data.js +0 -2
- package/dist/models/encrypted-response.d.ts +0 -20
- package/dist/models/encrypted-response.js +0 -2
- package/dist/models/etf-instrument.d.ts +0 -59
- package/dist/models/etf-instrument.js +0 -2
- package/dist/models/exchange-rate-pairs.d.ts +0 -27
- package/dist/models/exchange-rate-pairs.js +0 -2
- package/dist/models/exchange.d.ts +0 -56
- package/dist/models/exchange.js +0 -2
- package/dist/models/figi-instrument.d.ts +0 -20
- package/dist/models/figi-instrument.js +0 -2
- package/dist/models/future-instrument.d.ts +0 -64
- package/dist/models/future-instrument.js +0 -2
- package/dist/models/holdings-status.d.ts +0 -19
- package/dist/models/holdings-status.js +0 -2
- package/dist/models/index.d.ts +0 -173
- package/dist/models/index.js +0 -189
- package/dist/models/instrument.d.ts +0 -33
- package/dist/models/instrument.js +0 -2
- package/dist/models/login-redirect-uri.d.ts +0 -19
- package/dist/models/login-redirect-uri.js +0 -2
- package/dist/models/manual-trade-and-impact.d.ts +0 -29
- package/dist/models/manual-trade-and-impact.js +0 -2
- package/dist/models/manual-trade-balance.d.ts +0 -28
- package/dist/models/manual-trade-balance.js +0 -2
- package/dist/models/manual-trade-form-bracket.d.ts +0 -67
- package/dist/models/manual-trade-form-bracket.js +0 -2
- package/dist/models/manual-trade-form-complex.d.ts +0 -28
- package/dist/models/manual-trade-form-complex.js +0 -2
- package/dist/models/manual-trade-form-notional-value.d.ts +0 -6
- package/dist/models/manual-trade-form-notional-value.js +0 -2
- package/dist/models/manual-trade-form-with-options.d.ts +0 -78
- package/dist/models/manual-trade-form-with-options.js +0 -2
- package/dist/models/manual-trade-form.d.ts +0 -65
- package/dist/models/manual-trade-form.js +0 -2
- package/dist/models/manual-trade-impact.d.ts +0 -38
- package/dist/models/manual-trade-impact.js +0 -2
- package/dist/models/manual-trade-replace-form.d.ts +0 -58
- package/dist/models/manual-trade-replace-form.js +0 -2
- package/dist/models/manual-trade-symbol.d.ts +0 -49
- package/dist/models/manual-trade-symbol.js +0 -2
- package/dist/models/manual-trade.d.ts +0 -60
- package/dist/models/manual-trade.js +0 -2
- package/dist/models/mleg-action-strict.d.ts +0 -6
- package/dist/models/mleg-action-strict.js +0 -2
- package/dist/models/mleg-instrument-type.d.ts +0 -6
- package/dist/models/mleg-instrument-type.js +0 -2
- package/dist/models/mleg-leg.d.ts +0 -28
- package/dist/models/mleg-leg.js +0 -2
- package/dist/models/mleg-order-response.d.ts +0 -21
- package/dist/models/mleg-order-response.js +0 -2
- package/dist/models/mleg-order-type-strict.d.ts +0 -6
- package/dist/models/mleg-order-type-strict.js +0 -2
- package/dist/models/mleg-price-effect-strict.d.ts +0 -6
- package/dist/models/mleg-price-effect-strict.js +0 -2
- package/dist/models/mleg-trade-form.d.ts +0 -47
- package/dist/models/mleg-trade-form.js +0 -2
- package/dist/models/mleg-trading-instrument.d.ts +0 -21
- package/dist/models/mleg-trading-instrument.js +0 -2
- package/dist/models/model400-failed-request-response.d.ts +0 -20
- package/dist/models/model400-failed-request-response.js +0 -2
- package/dist/models/model401-failed-request-response.d.ts +0 -20
- package/dist/models/model401-failed-request-response.js +0 -2
- package/dist/models/model402-brokerage-auth-already-disabled-exception.d.ts +0 -20
- package/dist/models/model402-brokerage-auth-already-disabled-exception.js +0 -2
- package/dist/models/model402-brokerage-auth-disabled-response.d.ts +0 -20
- package/dist/models/model402-brokerage-auth-disabled-response.js +0 -2
- package/dist/models/model403-failed-request-response.d.ts +0 -20
- package/dist/models/model403-failed-request-response.js +0 -2
- package/dist/models/model403-feature-not-enabled-response.d.ts +0 -20
- package/dist/models/model403-feature-not-enabled-response.js +0 -2
- package/dist/models/model404-failed-request-response.d.ts +0 -20
- package/dist/models/model404-failed-request-response.js +0 -2
- package/dist/models/model425-failed-request-response.d.ts +0 -20
- package/dist/models/model425-failed-request-response.js +0 -2
- package/dist/models/model500-unexpected-exception-response.d.ts +0 -26
- package/dist/models/model500-unexpected-exception-response.js +0 -2
- package/dist/models/monthly-dividends.d.ts +0 -21
- package/dist/models/monthly-dividends.js +0 -2
- package/dist/models/mutual-fund-instrument.d.ts +0 -59
- package/dist/models/mutual-fund-instrument.js +0 -2
- package/dist/models/net-contributions.d.ts +0 -26
- package/dist/models/net-contributions.js +0 -2
- package/dist/models/net-dividend.d.ts +0 -27
- package/dist/models/net-dividend.js +0 -2
- package/dist/models/notional-value.d.ts +0 -6
- package/dist/models/notional-value.js +0 -2
- package/dist/models/option-brokerage-symbol.d.ts +0 -29
- package/dist/models/option-brokerage-symbol.js +0 -2
- package/dist/models/option-chain-inner-chain-per-root-inner-chain-per-strike-price-inner.d.ts +0 -26
- package/dist/models/option-chain-inner-chain-per-root-inner-chain-per-strike-price-inner.js +0 -2
- package/dist/models/option-chain-inner-chain-per-root-inner.d.ts +0 -27
- package/dist/models/option-chain-inner-chain-per-root-inner.js +0 -2
- package/dist/models/option-chain-inner.d.ts +0 -39
- package/dist/models/option-chain-inner.js +0 -2
- package/dist/models/option-impact.d.ts +0 -28
- package/dist/models/option-impact.js +0 -2
- package/dist/models/option-instrument.d.ts +0 -60
- package/dist/models/option-instrument.js +0 -2
- package/dist/models/option-leg.d.ts +0 -28
- package/dist/models/option-leg.js +0 -2
- package/dist/models/option-quote-greeks.d.ts +0 -32
- package/dist/models/option-quote-greeks.js +0 -2
- package/dist/models/option-quote.d.ts +0 -39
- package/dist/models/option-quote.js +0 -2
- package/dist/models/option-strategy-legs-inner.d.ts +0 -31
- package/dist/models/option-strategy-legs-inner.js +0 -2
- package/dist/models/option-strategy.d.ts +0 -40
- package/dist/models/option-strategy.js +0 -2
- package/dist/models/options-position-currency.d.ts +0 -25
- package/dist/models/options-position-currency.js +0 -2
- package/dist/models/options-position.d.ts +0 -41
- package/dist/models/options-position.js +0 -2
- package/dist/models/options-symbol.d.ts +0 -53
- package/dist/models/options-symbol.js +0 -2
- package/dist/models/order-type-strict.d.ts +0 -6
- package/dist/models/order-type-strict.js +0 -2
- package/dist/models/order-updated-response-order.d.ts +0 -167
- package/dist/models/order-updated-response-order.js +0 -2
- package/dist/models/order-updated-response.d.ts +0 -21
- package/dist/models/order-updated-response.js +0 -2
- package/dist/models/other-instrument.d.ts +0 -59
- package/dist/models/other-instrument.js +0 -2
- package/dist/models/paginated-universal-activity.d.ts +0 -22
- package/dist/models/paginated-universal-activity.js +0 -2
- package/dist/models/pagination-details.d.ts +0 -26
- package/dist/models/pagination-details.js +0 -2
- package/dist/models/partner-data.d.ts +0 -82
- package/dist/models/partner-data.js +0 -2
- package/dist/models/past-value.d.ts +0 -26
- package/dist/models/past-value.js +0 -2
- package/dist/models/performance-custom.d.ts +0 -127
- package/dist/models/performance-custom.js +0 -2
- package/dist/models/position-currency.d.ts +0 -25
- package/dist/models/position-currency.js +0 -2
- package/dist/models/position-symbol.d.ts +0 -50
- package/dist/models/position-symbol.js +0 -2
- package/dist/models/position.d.ts +0 -66
- package/dist/models/position.js +0 -2
- package/dist/models/rate-of-return-object.d.ts +0 -28
- package/dist/models/rate-of-return-object.js +0 -2
- package/dist/models/rate-of-return-response.d.ts +0 -15
- package/dist/models/rate-of-return-response.js +0 -2
- package/dist/models/recent-orders-response.d.ts +0 -15
- package/dist/models/recent-orders-response.js +0 -2
- package/dist/models/security-type.d.ts +0 -33
- package/dist/models/security-type.js +0 -2
- package/dist/models/session-event.d.ts +0 -52
- package/dist/models/session-event.js +0 -2
- package/dist/models/simple-order-form.d.ts +0 -67
- package/dist/models/simple-order-form.js +0 -2
- package/dist/models/snap-trade-holdings-account.d.ts +0 -60
- package/dist/models/snap-trade-holdings-account.js +0 -2
- package/dist/models/snap-trade-holdings-total-value.d.ts +0 -20
- package/dist/models/snap-trade-holdings-total-value.js +0 -2
- package/dist/models/snap-trade-login-user-request-body.d.ts +0 -58
- package/dist/models/snap-trade-login-user-request-body.js +0 -2
- package/dist/models/snap-trade-register-user-request-body.d.ts +0 -13
- package/dist/models/snap-trade-register-user-request-body.js +0 -2
- package/dist/models/status.d.ts +0 -26
- package/dist/models/status.js +0 -2
- package/dist/models/stock-instrument-figi-instrument.d.ts +0 -19
- package/dist/models/stock-instrument-figi-instrument.js +0 -2
- package/dist/models/stock-instrument.d.ts +0 -59
- package/dist/models/stock-instrument.js +0 -2
- package/dist/models/stop-loss.d.ts +0 -20
- package/dist/models/stop-loss.js +0 -2
- package/dist/models/strategy-order-record.d.ts +0 -77
- package/dist/models/strategy-order-record.js +0 -2
- package/dist/models/strategy-quotes-greek.d.ts +0 -38
- package/dist/models/strategy-quotes-greek.js +0 -2
- package/dist/models/strategy-quotes.d.ts +0 -46
- package/dist/models/strategy-quotes.js +0 -2
- package/dist/models/sub-period-return-rate.d.ts +0 -26
- package/dist/models/sub-period-return-rate.js +0 -2
- package/dist/models/symbol-currency.d.ts +0 -25
- package/dist/models/symbol-currency.js +0 -2
- package/dist/models/symbol-exchange.d.ts +0 -55
- package/dist/models/symbol-exchange.js +0 -2
- package/dist/models/symbol-query.d.ts +0 -13
- package/dist/models/symbol-query.js +0 -2
- package/dist/models/symbol.d.ts +0 -66
- package/dist/models/symbol.js +0 -2
- package/dist/models/symbols-quotes-inner.d.ts +0 -44
- package/dist/models/symbols-quotes-inner.js +0 -2
- package/dist/models/take-profit.d.ts +0 -14
- package/dist/models/take-profit.js +0 -2
- package/dist/models/tax-lot.d.ts +0 -50
- package/dist/models/tax-lot.js +0 -2
- package/dist/models/time-in-force-strict.d.ts +0 -6
- package/dist/models/time-in-force-strict.js +0 -2
- package/dist/models/trade-detection-cancel-subscription-response.d.ts +0 -14
- package/dist/models/trade-detection-cancel-subscription-response.js +0 -2
- package/dist/models/trade-detection-subscription.d.ts +0 -26
- package/dist/models/trade-detection-subscription.js +0 -2
- package/dist/models/trading-instrument.d.ts +0 -22
- package/dist/models/trading-instrument.js +0 -2
- package/dist/models/trading-search-cryptocurrency-pair-instruments200-response.d.ts +0 -15
- package/dist/models/trading-search-cryptocurrency-pair-instruments200-response.js +0 -2
- package/dist/models/trading-session.d.ts +0 -6
- package/dist/models/trading-session.js +0 -2
- package/dist/models/trailing-stop.d.ts +0 -22
- package/dist/models/trailing-stop.js +0 -2
- package/dist/models/transactions-status.d.ts +0 -25
- package/dist/models/transactions-status.js +0 -2
- package/dist/models/underlying-option-instrument.d.ts +0 -27
- package/dist/models/underlying-option-instrument.js +0 -2
- package/dist/models/underlying-symbol-exchange.d.ts +0 -61
- package/dist/models/underlying-symbol-exchange.js +0 -2
- package/dist/models/underlying-symbol-type.d.ts +0 -32
- package/dist/models/underlying-symbol-type.js +0 -2
- package/dist/models/underlying-symbol.d.ts +0 -74
- package/dist/models/underlying-symbol.js +0 -2
- package/dist/models/universal-activity.d.ts +0 -114
- package/dist/models/universal-activity.js +0 -2
- package/dist/models/universal-symbol.d.ts +0 -74
- package/dist/models/universal-symbol.js +0 -2
- package/dist/models/user-idand-secret.d.ts +0 -19
- package/dist/models/user-idand-secret.js +0 -2
- package/dist/models/usexchange.d.ts +0 -62
- package/dist/models/usexchange.js +0 -2
- package/dist/models/validated-trade-body.d.ts +0 -13
- package/dist/models/validated-trade-body.js +0 -2
- package/dist/operationParameterMap.d.ts +0 -8
- package/dist/operationParameterMap.js +0 -966
- package/dist/pagination/page-types.d.ts +0 -16
- package/dist/pagination/page-types.js +0 -12
- package/dist/pagination/page.d.ts +0 -25
- package/dist/pagination/page.js +0 -32
- package/dist/pagination/pageable.d.ts +0 -47
- package/dist/pagination/pageable.js +0 -70
- package/dist/pagination/paginate.d.ts +0 -6
- package/dist/pagination/paginate.js +0 -39
- package/dist/requestAfterHook.d.ts +0 -8
- package/dist/requestAfterHook.js +0 -82
- package/dist/requestBeforeHook.d.ts +0 -10
- package/dist/requestBeforeHook.js +0 -8
- package/dist/requestBeforeUrlHook.d.ts +0 -7
- package/dist/requestBeforeUrlHook.js +0 -5
|
@@ -1,1688 +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
|
-
* **This endpoint is deprecated. Please switch to [the new complex order endpoint](/reference/Trading/Trading_placeComplexOrder) ** 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
|
-
* @deprecated
|
|
473
|
-
* @throws {RequiredError}
|
|
474
|
-
*/
|
|
475
|
-
placeBracketOrder: (accountId, userId, userSecret, manualTradeFormBracket, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
476
|
-
// verify required parameter 'accountId' is not null or undefined
|
|
477
|
-
(0, common_1.assertParamExists)('placeBracketOrder', 'accountId', accountId);
|
|
478
|
-
// verify required parameter 'userId' is not null or undefined
|
|
479
|
-
(0, common_1.assertParamExists)('placeBracketOrder', 'userId', userId);
|
|
480
|
-
// verify required parameter 'userSecret' is not null or undefined
|
|
481
|
-
(0, common_1.assertParamExists)('placeBracketOrder', 'userSecret', userSecret);
|
|
482
|
-
// verify required parameter 'manualTradeFormBracket' is not null or undefined
|
|
483
|
-
(0, common_1.assertParamExists)('placeBracketOrder', 'manualTradeFormBracket', manualTradeFormBracket);
|
|
484
|
-
const localVarPath = `/accounts/{accountId}/trading/bracket`
|
|
485
|
-
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
486
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
487
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
488
|
-
let baseOptions;
|
|
489
|
-
if (configuration) {
|
|
490
|
-
baseOptions = configuration.baseOptions;
|
|
491
|
-
}
|
|
492
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
493
|
-
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
494
|
-
const localVarQueryParameter = {};
|
|
495
|
-
// authentication PartnerClientId required
|
|
496
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
|
|
497
|
-
// authentication PartnerSignature required
|
|
498
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
|
|
499
|
-
// authentication PartnerTimestamp required
|
|
500
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
|
|
501
|
-
if (userId !== undefined) {
|
|
502
|
-
localVarQueryParameter['userId'] = userId;
|
|
503
|
-
}
|
|
504
|
-
if (userSecret !== undefined) {
|
|
505
|
-
localVarQueryParameter['userSecret'] = userSecret;
|
|
506
|
-
}
|
|
507
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
508
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
509
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
510
|
-
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
511
|
-
requestBody: manualTradeFormBracket,
|
|
512
|
-
queryParameters: localVarQueryParameter,
|
|
513
|
-
requestConfig: localVarRequestOptions,
|
|
514
|
-
path: localVarPath,
|
|
515
|
-
configuration,
|
|
516
|
-
pathTemplate: '/accounts/{accountId}/trading/bracket',
|
|
517
|
-
httpMethod: 'POST'
|
|
518
|
-
});
|
|
519
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(manualTradeFormBracket, localVarRequestOptions, configuration);
|
|
520
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
521
|
-
return {
|
|
522
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
523
|
-
options: localVarRequestOptions,
|
|
524
|
-
};
|
|
525
|
-
}),
|
|
526
|
-
/**
|
|
527
|
-
* 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.
|
|
528
|
-
* @summary Place complex order
|
|
529
|
-
* @param {string} accountId The ID of the account to execute the trade on.
|
|
530
|
-
* @param {string} userId
|
|
531
|
-
* @param {string} userSecret
|
|
532
|
-
* @param {ManualTradeFormComplex} manualTradeFormComplex
|
|
533
|
-
* @param {*} [options] Override http request option.
|
|
534
|
-
* @throws {RequiredError}
|
|
535
|
-
*/
|
|
536
|
-
placeComplexOrder: (accountId, userId, userSecret, manualTradeFormComplex, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
537
|
-
// verify required parameter 'accountId' is not null or undefined
|
|
538
|
-
(0, common_1.assertParamExists)('placeComplexOrder', 'accountId', accountId);
|
|
539
|
-
// verify required parameter 'userId' is not null or undefined
|
|
540
|
-
(0, common_1.assertParamExists)('placeComplexOrder', 'userId', userId);
|
|
541
|
-
// verify required parameter 'userSecret' is not null or undefined
|
|
542
|
-
(0, common_1.assertParamExists)('placeComplexOrder', 'userSecret', userSecret);
|
|
543
|
-
// verify required parameter 'manualTradeFormComplex' is not null or undefined
|
|
544
|
-
(0, common_1.assertParamExists)('placeComplexOrder', 'manualTradeFormComplex', manualTradeFormComplex);
|
|
545
|
-
const localVarPath = `/accounts/{accountId}/trading/complex`
|
|
546
|
-
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
547
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
548
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
549
|
-
let baseOptions;
|
|
550
|
-
if (configuration) {
|
|
551
|
-
baseOptions = configuration.baseOptions;
|
|
552
|
-
}
|
|
553
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
554
|
-
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
555
|
-
const localVarQueryParameter = {};
|
|
556
|
-
// authentication PartnerClientId required
|
|
557
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
|
|
558
|
-
// authentication PartnerSignature required
|
|
559
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
|
|
560
|
-
// authentication PartnerTimestamp required
|
|
561
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
|
|
562
|
-
if (userId !== undefined) {
|
|
563
|
-
localVarQueryParameter['userId'] = userId;
|
|
564
|
-
}
|
|
565
|
-
if (userSecret !== undefined) {
|
|
566
|
-
localVarQueryParameter['userSecret'] = userSecret;
|
|
567
|
-
}
|
|
568
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
569
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
570
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
571
|
-
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
572
|
-
requestBody: manualTradeFormComplex,
|
|
573
|
-
queryParameters: localVarQueryParameter,
|
|
574
|
-
requestConfig: localVarRequestOptions,
|
|
575
|
-
path: localVarPath,
|
|
576
|
-
configuration,
|
|
577
|
-
pathTemplate: '/accounts/{accountId}/trading/complex',
|
|
578
|
-
httpMethod: 'POST'
|
|
579
|
-
});
|
|
580
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(manualTradeFormComplex, localVarRequestOptions, configuration);
|
|
581
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
582
|
-
return {
|
|
583
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
584
|
-
options: localVarRequestOptions,
|
|
585
|
-
};
|
|
586
|
-
}),
|
|
587
|
-
/**
|
|
588
|
-
* 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.
|
|
589
|
-
* @summary Place crypto order
|
|
590
|
-
* @param {string} userId
|
|
591
|
-
* @param {string} userSecret
|
|
592
|
-
* @param {string} accountId
|
|
593
|
-
* @param {CryptoOrderForm} cryptoOrderForm
|
|
594
|
-
* @param {*} [options] Override http request option.
|
|
595
|
-
* @throws {RequiredError}
|
|
596
|
-
*/
|
|
597
|
-
placeCryptoOrder: (userId, userSecret, accountId, cryptoOrderForm, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
598
|
-
// verify required parameter 'userId' is not null or undefined
|
|
599
|
-
(0, common_1.assertParamExists)('placeCryptoOrder', 'userId', userId);
|
|
600
|
-
// verify required parameter 'userSecret' is not null or undefined
|
|
601
|
-
(0, common_1.assertParamExists)('placeCryptoOrder', 'userSecret', userSecret);
|
|
602
|
-
// verify required parameter 'accountId' is not null or undefined
|
|
603
|
-
(0, common_1.assertParamExists)('placeCryptoOrder', 'accountId', accountId);
|
|
604
|
-
// verify required parameter 'cryptoOrderForm' is not null or undefined
|
|
605
|
-
(0, common_1.assertParamExists)('placeCryptoOrder', 'cryptoOrderForm', cryptoOrderForm);
|
|
606
|
-
const localVarPath = `/accounts/{accountId}/trading/crypto`
|
|
607
|
-
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
608
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
609
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
610
|
-
let baseOptions;
|
|
611
|
-
if (configuration) {
|
|
612
|
-
baseOptions = configuration.baseOptions;
|
|
613
|
-
}
|
|
614
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
615
|
-
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
616
|
-
const localVarQueryParameter = {};
|
|
617
|
-
// authentication PartnerClientId required
|
|
618
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
|
|
619
|
-
// authentication PartnerSignature required
|
|
620
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
|
|
621
|
-
// authentication PartnerTimestamp required
|
|
622
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
|
|
623
|
-
if (userId !== undefined) {
|
|
624
|
-
localVarQueryParameter['userId'] = userId;
|
|
625
|
-
}
|
|
626
|
-
if (userSecret !== undefined) {
|
|
627
|
-
localVarQueryParameter['userSecret'] = userSecret;
|
|
628
|
-
}
|
|
629
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
630
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
631
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
632
|
-
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
633
|
-
requestBody: cryptoOrderForm,
|
|
634
|
-
queryParameters: localVarQueryParameter,
|
|
635
|
-
requestConfig: localVarRequestOptions,
|
|
636
|
-
path: localVarPath,
|
|
637
|
-
configuration,
|
|
638
|
-
pathTemplate: '/accounts/{accountId}/trading/crypto',
|
|
639
|
-
httpMethod: 'POST'
|
|
640
|
-
});
|
|
641
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(cryptoOrderForm, localVarRequestOptions, configuration);
|
|
642
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
643
|
-
return {
|
|
644
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
645
|
-
options: localVarRequestOptions,
|
|
646
|
-
};
|
|
647
|
-
}),
|
|
648
|
-
/**
|
|
649
|
-
* 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.
|
|
650
|
-
* @summary Place equity order
|
|
651
|
-
* @param {string} userId
|
|
652
|
-
* @param {string} userSecret
|
|
653
|
-
* @param {ManualTradeFormWithOptions} manualTradeFormWithOptions
|
|
654
|
-
* @param {*} [options] Override http request option.
|
|
655
|
-
* @throws {RequiredError}
|
|
656
|
-
*/
|
|
657
|
-
placeForceOrder: (userId, userSecret, manualTradeFormWithOptions, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
658
|
-
// verify required parameter 'userId' is not null or undefined
|
|
659
|
-
(0, common_1.assertParamExists)('placeForceOrder', 'userId', userId);
|
|
660
|
-
// verify required parameter 'userSecret' is not null or undefined
|
|
661
|
-
(0, common_1.assertParamExists)('placeForceOrder', 'userSecret', userSecret);
|
|
662
|
-
// verify required parameter 'manualTradeFormWithOptions' is not null or undefined
|
|
663
|
-
(0, common_1.assertParamExists)('placeForceOrder', 'manualTradeFormWithOptions', manualTradeFormWithOptions);
|
|
664
|
-
const localVarPath = `/trade/place`;
|
|
665
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
666
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
667
|
-
let baseOptions;
|
|
668
|
-
if (configuration) {
|
|
669
|
-
baseOptions = configuration.baseOptions;
|
|
670
|
-
}
|
|
671
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
672
|
-
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
673
|
-
const localVarQueryParameter = {};
|
|
674
|
-
// authentication PartnerClientId required
|
|
675
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
|
|
676
|
-
// authentication PartnerSignature required
|
|
677
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
|
|
678
|
-
// authentication PartnerTimestamp required
|
|
679
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
|
|
680
|
-
if (userId !== undefined) {
|
|
681
|
-
localVarQueryParameter['userId'] = userId;
|
|
682
|
-
}
|
|
683
|
-
if (userSecret !== undefined) {
|
|
684
|
-
localVarQueryParameter['userSecret'] = userSecret;
|
|
685
|
-
}
|
|
686
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
687
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
688
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
689
|
-
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
690
|
-
requestBody: manualTradeFormWithOptions,
|
|
691
|
-
queryParameters: localVarQueryParameter,
|
|
692
|
-
requestConfig: localVarRequestOptions,
|
|
693
|
-
path: localVarPath,
|
|
694
|
-
configuration,
|
|
695
|
-
pathTemplate: '/trade/place',
|
|
696
|
-
httpMethod: 'POST'
|
|
697
|
-
});
|
|
698
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(manualTradeFormWithOptions, localVarRequestOptions, configuration);
|
|
699
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
700
|
-
return {
|
|
701
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
702
|
-
options: localVarRequestOptions,
|
|
703
|
-
};
|
|
704
|
-
}),
|
|
705
|
-
/**
|
|
706
|
-
* Places a multi-leg option order. Only supported on certain option trading brokerages. https://support.snaptrade.com/brokerages has information on brokerage trading support
|
|
707
|
-
* @summary Place option order
|
|
708
|
-
* @param {string} userId
|
|
709
|
-
* @param {string} userSecret
|
|
710
|
-
* @param {string} accountId
|
|
711
|
-
* @param {MlegTradeForm} mlegTradeForm
|
|
712
|
-
* @param {*} [options] Override http request option.
|
|
713
|
-
* @throws {RequiredError}
|
|
714
|
-
*/
|
|
715
|
-
placeMlegOrder: (userId, userSecret, accountId, mlegTradeForm, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
716
|
-
// verify required parameter 'userId' is not null or undefined
|
|
717
|
-
(0, common_1.assertParamExists)('placeMlegOrder', 'userId', userId);
|
|
718
|
-
// verify required parameter 'userSecret' is not null or undefined
|
|
719
|
-
(0, common_1.assertParamExists)('placeMlegOrder', 'userSecret', userSecret);
|
|
720
|
-
// verify required parameter 'accountId' is not null or undefined
|
|
721
|
-
(0, common_1.assertParamExists)('placeMlegOrder', 'accountId', accountId);
|
|
722
|
-
// verify required parameter 'mlegTradeForm' is not null or undefined
|
|
723
|
-
(0, common_1.assertParamExists)('placeMlegOrder', 'mlegTradeForm', mlegTradeForm);
|
|
724
|
-
const localVarPath = `/accounts/{accountId}/trading/options`
|
|
725
|
-
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
726
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
727
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
728
|
-
let baseOptions;
|
|
729
|
-
if (configuration) {
|
|
730
|
-
baseOptions = configuration.baseOptions;
|
|
731
|
-
}
|
|
732
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
733
|
-
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
734
|
-
const localVarQueryParameter = {};
|
|
735
|
-
// authentication PartnerClientId required
|
|
736
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
|
|
737
|
-
// authentication PartnerSignature required
|
|
738
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
|
|
739
|
-
// authentication PartnerTimestamp required
|
|
740
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
|
|
741
|
-
if (userId !== undefined) {
|
|
742
|
-
localVarQueryParameter['userId'] = userId;
|
|
743
|
-
}
|
|
744
|
-
if (userSecret !== undefined) {
|
|
745
|
-
localVarQueryParameter['userSecret'] = userSecret;
|
|
746
|
-
}
|
|
747
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
748
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
749
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
750
|
-
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
751
|
-
requestBody: mlegTradeForm,
|
|
752
|
-
queryParameters: localVarQueryParameter,
|
|
753
|
-
requestConfig: localVarRequestOptions,
|
|
754
|
-
path: localVarPath,
|
|
755
|
-
configuration,
|
|
756
|
-
pathTemplate: '/accounts/{accountId}/trading/options',
|
|
757
|
-
httpMethod: 'POST'
|
|
758
|
-
});
|
|
759
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(mlegTradeForm, localVarRequestOptions, configuration);
|
|
760
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
761
|
-
return {
|
|
762
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
763
|
-
options: localVarRequestOptions,
|
|
764
|
-
};
|
|
765
|
-
}),
|
|
766
|
-
/**
|
|
767
|
-
* 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.
|
|
768
|
-
* @summary Place checked equity order
|
|
769
|
-
* @param {string} tradeId Obtained from calling the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact)
|
|
770
|
-
* @param {string} userId
|
|
771
|
-
* @param {string} userSecret
|
|
772
|
-
* @param {ValidatedTradeBody} [validatedTradeBody]
|
|
773
|
-
* @param {*} [options] Override http request option.
|
|
774
|
-
* @throws {RequiredError}
|
|
775
|
-
*/
|
|
776
|
-
placeOrder: (tradeId, userId, userSecret, validatedTradeBody, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
777
|
-
// verify required parameter 'tradeId' is not null or undefined
|
|
778
|
-
(0, common_1.assertParamExists)('placeOrder', 'tradeId', tradeId);
|
|
779
|
-
// verify required parameter 'userId' is not null or undefined
|
|
780
|
-
(0, common_1.assertParamExists)('placeOrder', 'userId', userId);
|
|
781
|
-
// verify required parameter 'userSecret' is not null or undefined
|
|
782
|
-
(0, common_1.assertParamExists)('placeOrder', 'userSecret', userSecret);
|
|
783
|
-
const localVarPath = `/trade/{tradeId}`
|
|
784
|
-
.replace(`{${"tradeId"}}`, encodeURIComponent(String(tradeId !== undefined ? tradeId : `-tradeId-`)));
|
|
785
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
786
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
787
|
-
let baseOptions;
|
|
788
|
-
if (configuration) {
|
|
789
|
-
baseOptions = configuration.baseOptions;
|
|
790
|
-
}
|
|
791
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
792
|
-
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
793
|
-
const localVarQueryParameter = {};
|
|
794
|
-
// authentication PartnerClientId required
|
|
795
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
|
|
796
|
-
// authentication PartnerSignature required
|
|
797
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
|
|
798
|
-
// authentication PartnerTimestamp required
|
|
799
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
|
|
800
|
-
if (userId !== undefined) {
|
|
801
|
-
localVarQueryParameter['userId'] = userId;
|
|
802
|
-
}
|
|
803
|
-
if (userSecret !== undefined) {
|
|
804
|
-
localVarQueryParameter['userSecret'] = userSecret;
|
|
805
|
-
}
|
|
806
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
807
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
808
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
809
|
-
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
810
|
-
requestBody: validatedTradeBody,
|
|
811
|
-
queryParameters: localVarQueryParameter,
|
|
812
|
-
requestConfig: localVarRequestOptions,
|
|
813
|
-
path: localVarPath,
|
|
814
|
-
configuration,
|
|
815
|
-
pathTemplate: '/trade/{tradeId}',
|
|
816
|
-
httpMethod: 'POST'
|
|
817
|
-
});
|
|
818
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(validatedTradeBody, localVarRequestOptions, configuration);
|
|
819
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
820
|
-
return {
|
|
821
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
822
|
-
options: localVarRequestOptions,
|
|
823
|
-
};
|
|
824
|
-
}),
|
|
825
|
-
/**
|
|
826
|
-
* Previews an order using the specified account.
|
|
827
|
-
* @summary Preview crypto order
|
|
828
|
-
* @param {string} userId
|
|
829
|
-
* @param {string} userSecret
|
|
830
|
-
* @param {string} accountId
|
|
831
|
-
* @param {CryptoOrderForm} cryptoOrderForm
|
|
832
|
-
* @param {*} [options] Override http request option.
|
|
833
|
-
* @throws {RequiredError}
|
|
834
|
-
*/
|
|
835
|
-
previewCryptoOrder: (userId, userSecret, accountId, cryptoOrderForm, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
836
|
-
// verify required parameter 'userId' is not null or undefined
|
|
837
|
-
(0, common_1.assertParamExists)('previewCryptoOrder', 'userId', userId);
|
|
838
|
-
// verify required parameter 'userSecret' is not null or undefined
|
|
839
|
-
(0, common_1.assertParamExists)('previewCryptoOrder', 'userSecret', userSecret);
|
|
840
|
-
// verify required parameter 'accountId' is not null or undefined
|
|
841
|
-
(0, common_1.assertParamExists)('previewCryptoOrder', 'accountId', accountId);
|
|
842
|
-
// verify required parameter 'cryptoOrderForm' is not null or undefined
|
|
843
|
-
(0, common_1.assertParamExists)('previewCryptoOrder', 'cryptoOrderForm', cryptoOrderForm);
|
|
844
|
-
const localVarPath = `/accounts/{accountId}/trading/crypto/preview`
|
|
845
|
-
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
846
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
847
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
848
|
-
let baseOptions;
|
|
849
|
-
if (configuration) {
|
|
850
|
-
baseOptions = configuration.baseOptions;
|
|
851
|
-
}
|
|
852
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
853
|
-
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
854
|
-
const localVarQueryParameter = {};
|
|
855
|
-
// authentication PartnerClientId required
|
|
856
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
|
|
857
|
-
// authentication PartnerSignature required
|
|
858
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
|
|
859
|
-
// authentication PartnerTimestamp required
|
|
860
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
|
|
861
|
-
if (userId !== undefined) {
|
|
862
|
-
localVarQueryParameter['userId'] = userId;
|
|
863
|
-
}
|
|
864
|
-
if (userSecret !== undefined) {
|
|
865
|
-
localVarQueryParameter['userSecret'] = userSecret;
|
|
866
|
-
}
|
|
867
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
868
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
869
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
870
|
-
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
871
|
-
requestBody: cryptoOrderForm,
|
|
872
|
-
queryParameters: localVarQueryParameter,
|
|
873
|
-
requestConfig: localVarRequestOptions,
|
|
874
|
-
path: localVarPath,
|
|
875
|
-
configuration,
|
|
876
|
-
pathTemplate: '/accounts/{accountId}/trading/crypto/preview',
|
|
877
|
-
httpMethod: 'POST'
|
|
878
|
-
});
|
|
879
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(cryptoOrderForm, localVarRequestOptions, configuration);
|
|
880
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
881
|
-
return {
|
|
882
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
883
|
-
options: localVarRequestOptions,
|
|
884
|
-
};
|
|
885
|
-
}),
|
|
886
|
-
/**
|
|
887
|
-
* 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
|
|
888
|
-
* @summary Replace order
|
|
889
|
-
* @param {string} accountId The ID of the account to execute the trade on.
|
|
890
|
-
* @param {string} userId
|
|
891
|
-
* @param {string} userSecret
|
|
892
|
-
* @param {ManualTradeReplaceForm} manualTradeReplaceForm
|
|
893
|
-
* @param {*} [options] Override http request option.
|
|
894
|
-
* @throws {RequiredError}
|
|
895
|
-
*/
|
|
896
|
-
replaceOrder: (accountId, userId, userSecret, manualTradeReplaceForm, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
897
|
-
// verify required parameter 'accountId' is not null or undefined
|
|
898
|
-
(0, common_1.assertParamExists)('replaceOrder', 'accountId', accountId);
|
|
899
|
-
// verify required parameter 'userId' is not null or undefined
|
|
900
|
-
(0, common_1.assertParamExists)('replaceOrder', 'userId', userId);
|
|
901
|
-
// verify required parameter 'userSecret' is not null or undefined
|
|
902
|
-
(0, common_1.assertParamExists)('replaceOrder', 'userSecret', userSecret);
|
|
903
|
-
// verify required parameter 'manualTradeReplaceForm' is not null or undefined
|
|
904
|
-
(0, common_1.assertParamExists)('replaceOrder', 'manualTradeReplaceForm', manualTradeReplaceForm);
|
|
905
|
-
const localVarPath = `/accounts/{accountId}/trading/replace`
|
|
906
|
-
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
907
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
908
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
909
|
-
let baseOptions;
|
|
910
|
-
if (configuration) {
|
|
911
|
-
baseOptions = configuration.baseOptions;
|
|
912
|
-
}
|
|
913
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
914
|
-
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
915
|
-
const localVarQueryParameter = {};
|
|
916
|
-
// authentication PartnerClientId required
|
|
917
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
|
|
918
|
-
// authentication PartnerSignature required
|
|
919
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
|
|
920
|
-
// authentication PartnerTimestamp required
|
|
921
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
|
|
922
|
-
if (userId !== undefined) {
|
|
923
|
-
localVarQueryParameter['userId'] = userId;
|
|
924
|
-
}
|
|
925
|
-
if (userSecret !== undefined) {
|
|
926
|
-
localVarQueryParameter['userSecret'] = userSecret;
|
|
927
|
-
}
|
|
928
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
929
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
930
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
931
|
-
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
932
|
-
requestBody: manualTradeReplaceForm,
|
|
933
|
-
queryParameters: localVarQueryParameter,
|
|
934
|
-
requestConfig: localVarRequestOptions,
|
|
935
|
-
path: localVarPath,
|
|
936
|
-
configuration,
|
|
937
|
-
pathTemplate: '/accounts/{accountId}/trading/replace',
|
|
938
|
-
httpMethod: 'POST'
|
|
939
|
-
});
|
|
940
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(manualTradeReplaceForm, localVarRequestOptions, configuration);
|
|
941
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
942
|
-
return {
|
|
943
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
944
|
-
options: localVarRequestOptions,
|
|
945
|
-
};
|
|
946
|
-
}),
|
|
947
|
-
/**
|
|
948
|
-
* Searches cryptocurrency pairs instruments accessible to the specified account. Both `base` and `quote` are optional. Omit both for a full list of cryptocurrency pairs.
|
|
949
|
-
* @summary Get crypto pairs
|
|
950
|
-
* @param {string} userId
|
|
951
|
-
* @param {string} userSecret
|
|
952
|
-
* @param {string} accountId
|
|
953
|
-
* @param {string} [base]
|
|
954
|
-
* @param {string} [quote]
|
|
955
|
-
* @param {*} [options] Override http request option.
|
|
956
|
-
* @throws {RequiredError}
|
|
957
|
-
*/
|
|
958
|
-
searchCryptocurrencyPairInstruments: (userId, userSecret, accountId, base, quote, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
959
|
-
// verify required parameter 'userId' is not null or undefined
|
|
960
|
-
(0, common_1.assertParamExists)('searchCryptocurrencyPairInstruments', 'userId', userId);
|
|
961
|
-
// verify required parameter 'userSecret' is not null or undefined
|
|
962
|
-
(0, common_1.assertParamExists)('searchCryptocurrencyPairInstruments', 'userSecret', userSecret);
|
|
963
|
-
// verify required parameter 'accountId' is not null or undefined
|
|
964
|
-
(0, common_1.assertParamExists)('searchCryptocurrencyPairInstruments', 'accountId', accountId);
|
|
965
|
-
const localVarPath = `/accounts/{accountId}/trading/instruments/cryptocurrencyPairs`
|
|
966
|
-
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
967
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
968
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
969
|
-
let baseOptions;
|
|
970
|
-
if (configuration) {
|
|
971
|
-
baseOptions = configuration.baseOptions;
|
|
972
|
-
}
|
|
973
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
974
|
-
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
975
|
-
const localVarQueryParameter = {};
|
|
976
|
-
// authentication PartnerClientId required
|
|
977
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
|
|
978
|
-
// authentication PartnerSignature required
|
|
979
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
|
|
980
|
-
// authentication PartnerTimestamp required
|
|
981
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
|
|
982
|
-
if (userId !== undefined) {
|
|
983
|
-
localVarQueryParameter['userId'] = userId;
|
|
984
|
-
}
|
|
985
|
-
if (userSecret !== undefined) {
|
|
986
|
-
localVarQueryParameter['userSecret'] = userSecret;
|
|
987
|
-
}
|
|
988
|
-
if (base !== undefined) {
|
|
989
|
-
localVarQueryParameter['base'] = base;
|
|
990
|
-
}
|
|
991
|
-
if (quote !== undefined) {
|
|
992
|
-
localVarQueryParameter['quote'] = quote;
|
|
993
|
-
}
|
|
994
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
995
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
996
|
-
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
997
|
-
queryParameters: localVarQueryParameter,
|
|
998
|
-
requestConfig: localVarRequestOptions,
|
|
999
|
-
path: localVarPath,
|
|
1000
|
-
configuration,
|
|
1001
|
-
pathTemplate: '/accounts/{accountId}/trading/instruments/cryptocurrencyPairs',
|
|
1002
|
-
httpMethod: 'GET'
|
|
1003
|
-
});
|
|
1004
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
1005
|
-
return {
|
|
1006
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
1007
|
-
options: localVarRequestOptions,
|
|
1008
|
-
};
|
|
1009
|
-
}),
|
|
1010
|
-
};
|
|
1011
|
-
};
|
|
1012
|
-
exports.TradingApiAxiosParamCreator = TradingApiAxiosParamCreator;
|
|
1013
|
-
/**
|
|
1014
|
-
* TradingApi - functional programming interface
|
|
1015
|
-
* @export
|
|
1016
|
-
*/
|
|
1017
|
-
const TradingApiFp = function (configuration) {
|
|
1018
|
-
const localVarAxiosParamCreator = (0, exports.TradingApiAxiosParamCreator)(configuration);
|
|
1019
|
-
return {
|
|
1020
|
-
/**
|
|
1021
|
-
* Cancels an order in the specified account. Accepts order IDs for all asset types.
|
|
1022
|
-
* @summary Cancel order
|
|
1023
|
-
* @param {TradingApiCancelOrderRequest} requestParameters Request parameters.
|
|
1024
|
-
* @param {*} [options] Override http request option.
|
|
1025
|
-
* @throws {RequiredError}
|
|
1026
|
-
*/
|
|
1027
|
-
cancelOrder(requestParameters, options) {
|
|
1028
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1029
|
-
const accountInformationGetUserAccountOrderDetailRequest = {
|
|
1030
|
-
brokerage_order_id: requestParameters.brokerage_order_id
|
|
1031
|
-
};
|
|
1032
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.cancelOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, accountInformationGetUserAccountOrderDetailRequest, options);
|
|
1033
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
1034
|
-
});
|
|
1035
|
-
},
|
|
1036
|
-
/**
|
|
1037
|
-
* **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.
|
|
1038
|
-
* @summary Cancel equity order
|
|
1039
|
-
* @param {TradingApiCancelUserAccountOrderRequest} requestParameters Request parameters.
|
|
1040
|
-
* @param {*} [options] Override http request option.
|
|
1041
|
-
* @deprecated
|
|
1042
|
-
* @throws {RequiredError}
|
|
1043
|
-
*/
|
|
1044
|
-
cancelUserAccountOrder(requestParameters, options) {
|
|
1045
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1046
|
-
const accountInformationGetUserAccountOrderDetailRequest = {
|
|
1047
|
-
brokerage_order_id: requestParameters.brokerage_order_id
|
|
1048
|
-
};
|
|
1049
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.cancelUserAccountOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, accountInformationGetUserAccountOrderDetailRequest, options);
|
|
1050
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
1051
|
-
});
|
|
1052
|
-
},
|
|
1053
|
-
/**
|
|
1054
|
-
* Gets a quote for the specified account.
|
|
1055
|
-
* @summary Get crypto pair quote
|
|
1056
|
-
* @param {TradingApiGetCryptocurrencyPairQuoteRequest} requestParameters Request parameters.
|
|
1057
|
-
* @param {*} [options] Override http request option.
|
|
1058
|
-
* @throws {RequiredError}
|
|
1059
|
-
*/
|
|
1060
|
-
getCryptocurrencyPairQuote(requestParameters, options) {
|
|
1061
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1062
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.getCryptocurrencyPairQuote(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.instrumentSymbol, options);
|
|
1063
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
1064
|
-
});
|
|
1065
|
-
},
|
|
1066
|
-
/**
|
|
1067
|
-
* 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.
|
|
1068
|
-
* @summary Get option order impact
|
|
1069
|
-
* @param {TradingApiGetOptionImpactRequest} requestParameters Request parameters.
|
|
1070
|
-
* @param {*} [options] Override http request option.
|
|
1071
|
-
* @throws {RequiredError}
|
|
1072
|
-
*/
|
|
1073
|
-
getOptionImpact(requestParameters, options) {
|
|
1074
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1075
|
-
const mlegTradeForm = {
|
|
1076
|
-
order_type: requestParameters.order_type,
|
|
1077
|
-
time_in_force: requestParameters.time_in_force,
|
|
1078
|
-
limit_price: requestParameters.limit_price,
|
|
1079
|
-
stop_price: requestParameters.stop_price,
|
|
1080
|
-
price_effect: requestParameters.price_effect,
|
|
1081
|
-
legs: requestParameters.legs
|
|
1082
|
-
};
|
|
1083
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.getOptionImpact(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, mlegTradeForm, options);
|
|
1084
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
1085
|
-
});
|
|
1086
|
-
},
|
|
1087
|
-
/**
|
|
1088
|
-
* 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.
|
|
1089
|
-
* @summary Check equity order impact
|
|
1090
|
-
* @param {TradingApiGetOrderImpactRequest} requestParameters Request parameters.
|
|
1091
|
-
* @param {*} [options] Override http request option.
|
|
1092
|
-
* @throws {RequiredError}
|
|
1093
|
-
*/
|
|
1094
|
-
getOrderImpact(requestParameters, options) {
|
|
1095
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1096
|
-
const manualTradeForm = {
|
|
1097
|
-
account_id: requestParameters.account_id,
|
|
1098
|
-
action: requestParameters.action,
|
|
1099
|
-
universal_symbol_id: requestParameters.universal_symbol_id,
|
|
1100
|
-
order_type: requestParameters.order_type,
|
|
1101
|
-
time_in_force: requestParameters.time_in_force,
|
|
1102
|
-
price: requestParameters.price,
|
|
1103
|
-
stop: requestParameters.stop,
|
|
1104
|
-
units: requestParameters.units,
|
|
1105
|
-
notional_value: requestParameters.notional_value
|
|
1106
|
-
};
|
|
1107
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.getOrderImpact(requestParameters.userId, requestParameters.userSecret, manualTradeForm, options);
|
|
1108
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
1109
|
-
});
|
|
1110
|
-
},
|
|
1111
|
-
/**
|
|
1112
|
-
* 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.
|
|
1113
|
-
* @summary Get option quote
|
|
1114
|
-
* @param {TradingApiGetUserAccountOptionQuotesRequest} requestParameters Request parameters.
|
|
1115
|
-
* @param {*} [options] Override http request option.
|
|
1116
|
-
* @throws {RequiredError}
|
|
1117
|
-
*/
|
|
1118
|
-
getUserAccountOptionQuotes(requestParameters, options) {
|
|
1119
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1120
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.getUserAccountOptionQuotes(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.symbol, options);
|
|
1121
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
1122
|
-
});
|
|
1123
|
-
},
|
|
1124
|
-
/**
|
|
1125
|
-
* 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.
|
|
1126
|
-
* @summary Get equity symbol quotes
|
|
1127
|
-
* @param {TradingApiGetUserAccountQuotesRequest} requestParameters Request parameters.
|
|
1128
|
-
* @param {*} [options] Override http request option.
|
|
1129
|
-
* @throws {RequiredError}
|
|
1130
|
-
*/
|
|
1131
|
-
getUserAccountQuotes(requestParameters, options) {
|
|
1132
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1133
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.getUserAccountQuotes(requestParameters.userId, requestParameters.userSecret, requestParameters.symbols, requestParameters.accountId, requestParameters.useTicker, options);
|
|
1134
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
1135
|
-
});
|
|
1136
|
-
},
|
|
1137
|
-
/**
|
|
1138
|
-
* **This endpoint is deprecated. Please switch to [the new complex order endpoint](/reference/Trading/Trading_placeComplexOrder) ** 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
|
|
1139
|
-
* @summary Place bracket order
|
|
1140
|
-
* @param {TradingApiPlaceBracketOrderRequest} requestParameters Request parameters.
|
|
1141
|
-
* @param {*} [options] Override http request option.
|
|
1142
|
-
* @deprecated
|
|
1143
|
-
* @throws {RequiredError}
|
|
1144
|
-
*/
|
|
1145
|
-
placeBracketOrder(requestParameters, options) {
|
|
1146
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1147
|
-
const manualTradeFormBracket = {
|
|
1148
|
-
action: requestParameters.action,
|
|
1149
|
-
instrument: requestParameters.instrument,
|
|
1150
|
-
order_type: requestParameters.order_type,
|
|
1151
|
-
time_in_force: requestParameters.time_in_force,
|
|
1152
|
-
price: requestParameters.price,
|
|
1153
|
-
stop: requestParameters.stop,
|
|
1154
|
-
units: requestParameters.units,
|
|
1155
|
-
stop_loss: requestParameters.stop_loss,
|
|
1156
|
-
take_profit: requestParameters.take_profit
|
|
1157
|
-
};
|
|
1158
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.placeBracketOrder(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, manualTradeFormBracket, options);
|
|
1159
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
1160
|
-
});
|
|
1161
|
-
},
|
|
1162
|
-
/**
|
|
1163
|
-
* 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.
|
|
1164
|
-
* @summary Place complex order
|
|
1165
|
-
* @param {TradingApiPlaceComplexOrderRequest} requestParameters Request parameters.
|
|
1166
|
-
* @param {*} [options] Override http request option.
|
|
1167
|
-
* @throws {RequiredError}
|
|
1168
|
-
*/
|
|
1169
|
-
placeComplexOrder(requestParameters, options) {
|
|
1170
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1171
|
-
const manualTradeFormComplex = {
|
|
1172
|
-
type: requestParameters.type,
|
|
1173
|
-
orders: requestParameters.orders,
|
|
1174
|
-
client_order_id: requestParameters.client_order_id
|
|
1175
|
-
};
|
|
1176
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.placeComplexOrder(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, manualTradeFormComplex, options);
|
|
1177
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
1178
|
-
});
|
|
1179
|
-
},
|
|
1180
|
-
/**
|
|
1181
|
-
* 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.
|
|
1182
|
-
* @summary Place crypto order
|
|
1183
|
-
* @param {TradingApiPlaceCryptoOrderRequest} requestParameters Request parameters.
|
|
1184
|
-
* @param {*} [options] Override http request option.
|
|
1185
|
-
* @throws {RequiredError}
|
|
1186
|
-
*/
|
|
1187
|
-
placeCryptoOrder(requestParameters, options) {
|
|
1188
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1189
|
-
const cryptoOrderForm = {
|
|
1190
|
-
instrument: requestParameters.instrument,
|
|
1191
|
-
side: requestParameters.side,
|
|
1192
|
-
type: requestParameters.type,
|
|
1193
|
-
time_in_force: requestParameters.time_in_force,
|
|
1194
|
-
amount: requestParameters.amount,
|
|
1195
|
-
limit_price: requestParameters.limit_price,
|
|
1196
|
-
stop_price: requestParameters.stop_price,
|
|
1197
|
-
post_only: requestParameters.post_only,
|
|
1198
|
-
expiration_date: requestParameters.expiration_date
|
|
1199
|
-
};
|
|
1200
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.placeCryptoOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, cryptoOrderForm, options);
|
|
1201
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
1202
|
-
});
|
|
1203
|
-
},
|
|
1204
|
-
/**
|
|
1205
|
-
* 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.
|
|
1206
|
-
* @summary Place equity order
|
|
1207
|
-
* @param {TradingApiPlaceForceOrderRequest} requestParameters Request parameters.
|
|
1208
|
-
* @param {*} [options] Override http request option.
|
|
1209
|
-
* @throws {RequiredError}
|
|
1210
|
-
*/
|
|
1211
|
-
placeForceOrder(requestParameters, options) {
|
|
1212
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1213
|
-
const manualTradeFormWithOptions = {
|
|
1214
|
-
account_id: requestParameters.account_id,
|
|
1215
|
-
action: requestParameters.action,
|
|
1216
|
-
universal_symbol_id: requestParameters.universal_symbol_id,
|
|
1217
|
-
symbol: requestParameters.symbol,
|
|
1218
|
-
order_type: requestParameters.order_type,
|
|
1219
|
-
time_in_force: requestParameters.time_in_force,
|
|
1220
|
-
trading_session: requestParameters.trading_session,
|
|
1221
|
-
price: requestParameters.price,
|
|
1222
|
-
stop: requestParameters.stop,
|
|
1223
|
-
units: requestParameters.units,
|
|
1224
|
-
notional_value: requestParameters.notional_value
|
|
1225
|
-
};
|
|
1226
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.placeForceOrder(requestParameters.userId, requestParameters.userSecret, manualTradeFormWithOptions, options);
|
|
1227
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
1228
|
-
});
|
|
1229
|
-
},
|
|
1230
|
-
/**
|
|
1231
|
-
* Places a multi-leg option order. Only supported on certain option trading brokerages. https://support.snaptrade.com/brokerages has information on brokerage trading support
|
|
1232
|
-
* @summary Place option order
|
|
1233
|
-
* @param {TradingApiPlaceMlegOrderRequest} requestParameters Request parameters.
|
|
1234
|
-
* @param {*} [options] Override http request option.
|
|
1235
|
-
* @throws {RequiredError}
|
|
1236
|
-
*/
|
|
1237
|
-
placeMlegOrder(requestParameters, options) {
|
|
1238
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1239
|
-
const mlegTradeForm = {
|
|
1240
|
-
order_type: requestParameters.order_type,
|
|
1241
|
-
time_in_force: requestParameters.time_in_force,
|
|
1242
|
-
limit_price: requestParameters.limit_price,
|
|
1243
|
-
stop_price: requestParameters.stop_price,
|
|
1244
|
-
price_effect: requestParameters.price_effect,
|
|
1245
|
-
legs: requestParameters.legs
|
|
1246
|
-
};
|
|
1247
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.placeMlegOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, mlegTradeForm, options);
|
|
1248
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
1249
|
-
});
|
|
1250
|
-
},
|
|
1251
|
-
/**
|
|
1252
|
-
* 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.
|
|
1253
|
-
* @summary Place checked equity order
|
|
1254
|
-
* @param {TradingApiPlaceOrderRequest} requestParameters Request parameters.
|
|
1255
|
-
* @param {*} [options] Override http request option.
|
|
1256
|
-
* @throws {RequiredError}
|
|
1257
|
-
*/
|
|
1258
|
-
placeOrder(requestParameters, options) {
|
|
1259
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1260
|
-
const validatedTradeBody = {
|
|
1261
|
-
wait_to_confirm: requestParameters.wait_to_confirm
|
|
1262
|
-
};
|
|
1263
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.placeOrder(requestParameters.tradeId, requestParameters.userId, requestParameters.userSecret, validatedTradeBody, options);
|
|
1264
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
1265
|
-
});
|
|
1266
|
-
},
|
|
1267
|
-
/**
|
|
1268
|
-
* Previews an order using the specified account.
|
|
1269
|
-
* @summary Preview crypto order
|
|
1270
|
-
* @param {TradingApiPreviewCryptoOrderRequest} requestParameters Request parameters.
|
|
1271
|
-
* @param {*} [options] Override http request option.
|
|
1272
|
-
* @throws {RequiredError}
|
|
1273
|
-
*/
|
|
1274
|
-
previewCryptoOrder(requestParameters, options) {
|
|
1275
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1276
|
-
const cryptoOrderForm = {
|
|
1277
|
-
instrument: requestParameters.instrument,
|
|
1278
|
-
side: requestParameters.side,
|
|
1279
|
-
type: requestParameters.type,
|
|
1280
|
-
time_in_force: requestParameters.time_in_force,
|
|
1281
|
-
amount: requestParameters.amount,
|
|
1282
|
-
limit_price: requestParameters.limit_price,
|
|
1283
|
-
stop_price: requestParameters.stop_price,
|
|
1284
|
-
post_only: requestParameters.post_only,
|
|
1285
|
-
expiration_date: requestParameters.expiration_date
|
|
1286
|
-
};
|
|
1287
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.previewCryptoOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, cryptoOrderForm, options);
|
|
1288
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
1289
|
-
});
|
|
1290
|
-
},
|
|
1291
|
-
/**
|
|
1292
|
-
* 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
|
|
1293
|
-
* @summary Replace order
|
|
1294
|
-
* @param {TradingApiReplaceOrderRequest} requestParameters Request parameters.
|
|
1295
|
-
* @param {*} [options] Override http request option.
|
|
1296
|
-
* @throws {RequiredError}
|
|
1297
|
-
*/
|
|
1298
|
-
replaceOrder(requestParameters, options) {
|
|
1299
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1300
|
-
const manualTradeReplaceForm = {
|
|
1301
|
-
brokerage_order_id: requestParameters.brokerage_order_id,
|
|
1302
|
-
action: requestParameters.action,
|
|
1303
|
-
order_type: requestParameters.order_type,
|
|
1304
|
-
time_in_force: requestParameters.time_in_force,
|
|
1305
|
-
price: requestParameters.price,
|
|
1306
|
-
symbol: requestParameters.symbol,
|
|
1307
|
-
stop: requestParameters.stop,
|
|
1308
|
-
units: requestParameters.units
|
|
1309
|
-
};
|
|
1310
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.replaceOrder(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, manualTradeReplaceForm, options);
|
|
1311
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
1312
|
-
});
|
|
1313
|
-
},
|
|
1314
|
-
/**
|
|
1315
|
-
* Searches cryptocurrency pairs instruments accessible to the specified account. Both `base` and `quote` are optional. Omit both for a full list of cryptocurrency pairs.
|
|
1316
|
-
* @summary Get crypto pairs
|
|
1317
|
-
* @param {TradingApiSearchCryptocurrencyPairInstrumentsRequest} requestParameters Request parameters.
|
|
1318
|
-
* @param {*} [options] Override http request option.
|
|
1319
|
-
* @throws {RequiredError}
|
|
1320
|
-
*/
|
|
1321
|
-
searchCryptocurrencyPairInstruments(requestParameters, options) {
|
|
1322
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1323
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.searchCryptocurrencyPairInstruments(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.base, requestParameters.quote, options);
|
|
1324
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
1325
|
-
});
|
|
1326
|
-
},
|
|
1327
|
-
};
|
|
1328
|
-
};
|
|
1329
|
-
exports.TradingApiFp = TradingApiFp;
|
|
1330
|
-
/**
|
|
1331
|
-
* TradingApi - factory interface
|
|
1332
|
-
* @export
|
|
1333
|
-
*/
|
|
1334
|
-
const TradingApiFactory = function (configuration, basePath, axios) {
|
|
1335
|
-
const localVarFp = (0, exports.TradingApiFp)(configuration);
|
|
1336
|
-
return {
|
|
1337
|
-
/**
|
|
1338
|
-
* Cancels an order in the specified account. Accepts order IDs for all asset types.
|
|
1339
|
-
* @summary Cancel order
|
|
1340
|
-
* @param {TradingApiCancelOrderRequest} requestParameters Request parameters.
|
|
1341
|
-
* @param {*} [options] Override http request option.
|
|
1342
|
-
* @throws {RequiredError}
|
|
1343
|
-
*/
|
|
1344
|
-
cancelOrder(requestParameters, options) {
|
|
1345
|
-
return localVarFp.cancelOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
1346
|
-
},
|
|
1347
|
-
/**
|
|
1348
|
-
* **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.
|
|
1349
|
-
* @summary Cancel equity order
|
|
1350
|
-
* @param {TradingApiCancelUserAccountOrderRequest} requestParameters Request parameters.
|
|
1351
|
-
* @param {*} [options] Override http request option.
|
|
1352
|
-
* @deprecated
|
|
1353
|
-
* @throws {RequiredError}
|
|
1354
|
-
*/
|
|
1355
|
-
cancelUserAccountOrder(requestParameters, options) {
|
|
1356
|
-
return localVarFp.cancelUserAccountOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
1357
|
-
},
|
|
1358
|
-
/**
|
|
1359
|
-
* Gets a quote for the specified account.
|
|
1360
|
-
* @summary Get crypto pair quote
|
|
1361
|
-
* @param {TradingApiGetCryptocurrencyPairQuoteRequest} requestParameters Request parameters.
|
|
1362
|
-
* @param {*} [options] Override http request option.
|
|
1363
|
-
* @throws {RequiredError}
|
|
1364
|
-
*/
|
|
1365
|
-
getCryptocurrencyPairQuote(requestParameters, options) {
|
|
1366
|
-
return localVarFp.getCryptocurrencyPairQuote(requestParameters, options).then((request) => request(axios, basePath));
|
|
1367
|
-
},
|
|
1368
|
-
/**
|
|
1369
|
-
* 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.
|
|
1370
|
-
* @summary Get option order impact
|
|
1371
|
-
* @param {TradingApiGetOptionImpactRequest} requestParameters Request parameters.
|
|
1372
|
-
* @param {*} [options] Override http request option.
|
|
1373
|
-
* @throws {RequiredError}
|
|
1374
|
-
*/
|
|
1375
|
-
getOptionImpact(requestParameters, options) {
|
|
1376
|
-
return localVarFp.getOptionImpact(requestParameters, options).then((request) => request(axios, basePath));
|
|
1377
|
-
},
|
|
1378
|
-
/**
|
|
1379
|
-
* 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.
|
|
1380
|
-
* @summary Check equity order impact
|
|
1381
|
-
* @param {TradingApiGetOrderImpactRequest} requestParameters Request parameters.
|
|
1382
|
-
* @param {*} [options] Override http request option.
|
|
1383
|
-
* @throws {RequiredError}
|
|
1384
|
-
*/
|
|
1385
|
-
getOrderImpact(requestParameters, options) {
|
|
1386
|
-
return localVarFp.getOrderImpact(requestParameters, options).then((request) => request(axios, basePath));
|
|
1387
|
-
},
|
|
1388
|
-
/**
|
|
1389
|
-
* 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.
|
|
1390
|
-
* @summary Get option quote
|
|
1391
|
-
* @param {TradingApiGetUserAccountOptionQuotesRequest} requestParameters Request parameters.
|
|
1392
|
-
* @param {*} [options] Override http request option.
|
|
1393
|
-
* @throws {RequiredError}
|
|
1394
|
-
*/
|
|
1395
|
-
getUserAccountOptionQuotes(requestParameters, options) {
|
|
1396
|
-
return localVarFp.getUserAccountOptionQuotes(requestParameters, options).then((request) => request(axios, basePath));
|
|
1397
|
-
},
|
|
1398
|
-
/**
|
|
1399
|
-
* 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.
|
|
1400
|
-
* @summary Get equity symbol quotes
|
|
1401
|
-
* @param {TradingApiGetUserAccountQuotesRequest} requestParameters Request parameters.
|
|
1402
|
-
* @param {*} [options] Override http request option.
|
|
1403
|
-
* @throws {RequiredError}
|
|
1404
|
-
*/
|
|
1405
|
-
getUserAccountQuotes(requestParameters, options) {
|
|
1406
|
-
return localVarFp.getUserAccountQuotes(requestParameters, options).then((request) => request(axios, basePath));
|
|
1407
|
-
},
|
|
1408
|
-
/**
|
|
1409
|
-
* **This endpoint is deprecated. Please switch to [the new complex order endpoint](/reference/Trading/Trading_placeComplexOrder) ** 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
|
|
1410
|
-
* @summary Place bracket order
|
|
1411
|
-
* @param {TradingApiPlaceBracketOrderRequest} requestParameters Request parameters.
|
|
1412
|
-
* @param {*} [options] Override http request option.
|
|
1413
|
-
* @deprecated
|
|
1414
|
-
* @throws {RequiredError}
|
|
1415
|
-
*/
|
|
1416
|
-
placeBracketOrder(requestParameters, options) {
|
|
1417
|
-
return localVarFp.placeBracketOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
1418
|
-
},
|
|
1419
|
-
/**
|
|
1420
|
-
* 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.
|
|
1421
|
-
* @summary Place complex order
|
|
1422
|
-
* @param {TradingApiPlaceComplexOrderRequest} requestParameters Request parameters.
|
|
1423
|
-
* @param {*} [options] Override http request option.
|
|
1424
|
-
* @throws {RequiredError}
|
|
1425
|
-
*/
|
|
1426
|
-
placeComplexOrder(requestParameters, options) {
|
|
1427
|
-
return localVarFp.placeComplexOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
1428
|
-
},
|
|
1429
|
-
/**
|
|
1430
|
-
* 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.
|
|
1431
|
-
* @summary Place crypto order
|
|
1432
|
-
* @param {TradingApiPlaceCryptoOrderRequest} requestParameters Request parameters.
|
|
1433
|
-
* @param {*} [options] Override http request option.
|
|
1434
|
-
* @throws {RequiredError}
|
|
1435
|
-
*/
|
|
1436
|
-
placeCryptoOrder(requestParameters, options) {
|
|
1437
|
-
return localVarFp.placeCryptoOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
1438
|
-
},
|
|
1439
|
-
/**
|
|
1440
|
-
* 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.
|
|
1441
|
-
* @summary Place equity order
|
|
1442
|
-
* @param {TradingApiPlaceForceOrderRequest} requestParameters Request parameters.
|
|
1443
|
-
* @param {*} [options] Override http request option.
|
|
1444
|
-
* @throws {RequiredError}
|
|
1445
|
-
*/
|
|
1446
|
-
placeForceOrder(requestParameters, options) {
|
|
1447
|
-
return localVarFp.placeForceOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
1448
|
-
},
|
|
1449
|
-
/**
|
|
1450
|
-
* Places a multi-leg option order. Only supported on certain option trading brokerages. https://support.snaptrade.com/brokerages has information on brokerage trading support
|
|
1451
|
-
* @summary Place option order
|
|
1452
|
-
* @param {TradingApiPlaceMlegOrderRequest} requestParameters Request parameters.
|
|
1453
|
-
* @param {*} [options] Override http request option.
|
|
1454
|
-
* @throws {RequiredError}
|
|
1455
|
-
*/
|
|
1456
|
-
placeMlegOrder(requestParameters, options) {
|
|
1457
|
-
return localVarFp.placeMlegOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
1458
|
-
},
|
|
1459
|
-
/**
|
|
1460
|
-
* 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.
|
|
1461
|
-
* @summary Place checked equity order
|
|
1462
|
-
* @param {TradingApiPlaceOrderRequest} requestParameters Request parameters.
|
|
1463
|
-
* @param {*} [options] Override http request option.
|
|
1464
|
-
* @throws {RequiredError}
|
|
1465
|
-
*/
|
|
1466
|
-
placeOrder(requestParameters, options) {
|
|
1467
|
-
return localVarFp.placeOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
1468
|
-
},
|
|
1469
|
-
/**
|
|
1470
|
-
* Previews an order using the specified account.
|
|
1471
|
-
* @summary Preview crypto order
|
|
1472
|
-
* @param {TradingApiPreviewCryptoOrderRequest} requestParameters Request parameters.
|
|
1473
|
-
* @param {*} [options] Override http request option.
|
|
1474
|
-
* @throws {RequiredError}
|
|
1475
|
-
*/
|
|
1476
|
-
previewCryptoOrder(requestParameters, options) {
|
|
1477
|
-
return localVarFp.previewCryptoOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
1478
|
-
},
|
|
1479
|
-
/**
|
|
1480
|
-
* 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
|
|
1481
|
-
* @summary Replace order
|
|
1482
|
-
* @param {TradingApiReplaceOrderRequest} requestParameters Request parameters.
|
|
1483
|
-
* @param {*} [options] Override http request option.
|
|
1484
|
-
* @throws {RequiredError}
|
|
1485
|
-
*/
|
|
1486
|
-
replaceOrder(requestParameters, options) {
|
|
1487
|
-
return localVarFp.replaceOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
1488
|
-
},
|
|
1489
|
-
/**
|
|
1490
|
-
* Searches cryptocurrency pairs instruments accessible to the specified account. Both `base` and `quote` are optional. Omit both for a full list of cryptocurrency pairs.
|
|
1491
|
-
* @summary Get crypto pairs
|
|
1492
|
-
* @param {TradingApiSearchCryptocurrencyPairInstrumentsRequest} requestParameters Request parameters.
|
|
1493
|
-
* @param {*} [options] Override http request option.
|
|
1494
|
-
* @throws {RequiredError}
|
|
1495
|
-
*/
|
|
1496
|
-
searchCryptocurrencyPairInstruments(requestParameters, options) {
|
|
1497
|
-
return localVarFp.searchCryptocurrencyPairInstruments(requestParameters, options).then((request) => request(axios, basePath));
|
|
1498
|
-
},
|
|
1499
|
-
};
|
|
1500
|
-
};
|
|
1501
|
-
exports.TradingApiFactory = TradingApiFactory;
|
|
1502
|
-
/**
|
|
1503
|
-
* TradingApiGenerated - object-oriented interface
|
|
1504
|
-
* @export
|
|
1505
|
-
* @class TradingApiGenerated
|
|
1506
|
-
* @extends {BaseAPI}
|
|
1507
|
-
*/
|
|
1508
|
-
class TradingApiGenerated extends base_1.BaseAPI {
|
|
1509
|
-
/**
|
|
1510
|
-
* Cancels an order in the specified account. Accepts order IDs for all asset types.
|
|
1511
|
-
* @summary Cancel order
|
|
1512
|
-
* @param {TradingApiCancelOrderRequest} requestParameters Request parameters.
|
|
1513
|
-
* @param {*} [options] Override http request option.
|
|
1514
|
-
* @throws {RequiredError}
|
|
1515
|
-
* @memberof TradingApiGenerated
|
|
1516
|
-
*/
|
|
1517
|
-
cancelOrder(requestParameters, options) {
|
|
1518
|
-
return (0, exports.TradingApiFp)(this.configuration).cancelOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1519
|
-
}
|
|
1520
|
-
/**
|
|
1521
|
-
* **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.
|
|
1522
|
-
* @summary Cancel equity order
|
|
1523
|
-
* @param {TradingApiCancelUserAccountOrderRequest} requestParameters Request parameters.
|
|
1524
|
-
* @param {*} [options] Override http request option.
|
|
1525
|
-
* @deprecated
|
|
1526
|
-
* @throws {RequiredError}
|
|
1527
|
-
* @memberof TradingApiGenerated
|
|
1528
|
-
*/
|
|
1529
|
-
cancelUserAccountOrder(requestParameters, options) {
|
|
1530
|
-
return (0, exports.TradingApiFp)(this.configuration).cancelUserAccountOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1531
|
-
}
|
|
1532
|
-
/**
|
|
1533
|
-
* Gets a quote for the specified account.
|
|
1534
|
-
* @summary Get crypto pair quote
|
|
1535
|
-
* @param {TradingApiGetCryptocurrencyPairQuoteRequest} requestParameters Request parameters.
|
|
1536
|
-
* @param {*} [options] Override http request option.
|
|
1537
|
-
* @throws {RequiredError}
|
|
1538
|
-
* @memberof TradingApiGenerated
|
|
1539
|
-
*/
|
|
1540
|
-
getCryptocurrencyPairQuote(requestParameters, options) {
|
|
1541
|
-
return (0, exports.TradingApiFp)(this.configuration).getCryptocurrencyPairQuote(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1542
|
-
}
|
|
1543
|
-
/**
|
|
1544
|
-
* 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.
|
|
1545
|
-
* @summary Get option order impact
|
|
1546
|
-
* @param {TradingApiGetOptionImpactRequest} requestParameters Request parameters.
|
|
1547
|
-
* @param {*} [options] Override http request option.
|
|
1548
|
-
* @throws {RequiredError}
|
|
1549
|
-
* @memberof TradingApiGenerated
|
|
1550
|
-
*/
|
|
1551
|
-
getOptionImpact(requestParameters, options) {
|
|
1552
|
-
return (0, exports.TradingApiFp)(this.configuration).getOptionImpact(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1553
|
-
}
|
|
1554
|
-
/**
|
|
1555
|
-
* 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.
|
|
1556
|
-
* @summary Check equity order impact
|
|
1557
|
-
* @param {TradingApiGetOrderImpactRequest} requestParameters Request parameters.
|
|
1558
|
-
* @param {*} [options] Override http request option.
|
|
1559
|
-
* @throws {RequiredError}
|
|
1560
|
-
* @memberof TradingApiGenerated
|
|
1561
|
-
*/
|
|
1562
|
-
getOrderImpact(requestParameters, options) {
|
|
1563
|
-
return (0, exports.TradingApiFp)(this.configuration).getOrderImpact(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1564
|
-
}
|
|
1565
|
-
/**
|
|
1566
|
-
* 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.
|
|
1567
|
-
* @summary Get option quote
|
|
1568
|
-
* @param {TradingApiGetUserAccountOptionQuotesRequest} requestParameters Request parameters.
|
|
1569
|
-
* @param {*} [options] Override http request option.
|
|
1570
|
-
* @throws {RequiredError}
|
|
1571
|
-
* @memberof TradingApiGenerated
|
|
1572
|
-
*/
|
|
1573
|
-
getUserAccountOptionQuotes(requestParameters, options) {
|
|
1574
|
-
return (0, exports.TradingApiFp)(this.configuration).getUserAccountOptionQuotes(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1575
|
-
}
|
|
1576
|
-
/**
|
|
1577
|
-
* 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.
|
|
1578
|
-
* @summary Get equity symbol quotes
|
|
1579
|
-
* @param {TradingApiGetUserAccountQuotesRequest} requestParameters Request parameters.
|
|
1580
|
-
* @param {*} [options] Override http request option.
|
|
1581
|
-
* @throws {RequiredError}
|
|
1582
|
-
* @memberof TradingApiGenerated
|
|
1583
|
-
*/
|
|
1584
|
-
getUserAccountQuotes(requestParameters, options) {
|
|
1585
|
-
return (0, exports.TradingApiFp)(this.configuration).getUserAccountQuotes(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1586
|
-
}
|
|
1587
|
-
/**
|
|
1588
|
-
* **This endpoint is deprecated. Please switch to [the new complex order endpoint](/reference/Trading/Trading_placeComplexOrder) ** 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
|
|
1589
|
-
* @summary Place bracket order
|
|
1590
|
-
* @param {TradingApiPlaceBracketOrderRequest} requestParameters Request parameters.
|
|
1591
|
-
* @param {*} [options] Override http request option.
|
|
1592
|
-
* @deprecated
|
|
1593
|
-
* @throws {RequiredError}
|
|
1594
|
-
* @memberof TradingApiGenerated
|
|
1595
|
-
*/
|
|
1596
|
-
placeBracketOrder(requestParameters, options) {
|
|
1597
|
-
return (0, exports.TradingApiFp)(this.configuration).placeBracketOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1598
|
-
}
|
|
1599
|
-
/**
|
|
1600
|
-
* 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.
|
|
1601
|
-
* @summary Place complex order
|
|
1602
|
-
* @param {TradingApiPlaceComplexOrderRequest} requestParameters Request parameters.
|
|
1603
|
-
* @param {*} [options] Override http request option.
|
|
1604
|
-
* @throws {RequiredError}
|
|
1605
|
-
* @memberof TradingApiGenerated
|
|
1606
|
-
*/
|
|
1607
|
-
placeComplexOrder(requestParameters, options) {
|
|
1608
|
-
return (0, exports.TradingApiFp)(this.configuration).placeComplexOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1609
|
-
}
|
|
1610
|
-
/**
|
|
1611
|
-
* 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.
|
|
1612
|
-
* @summary Place crypto order
|
|
1613
|
-
* @param {TradingApiPlaceCryptoOrderRequest} requestParameters Request parameters.
|
|
1614
|
-
* @param {*} [options] Override http request option.
|
|
1615
|
-
* @throws {RequiredError}
|
|
1616
|
-
* @memberof TradingApiGenerated
|
|
1617
|
-
*/
|
|
1618
|
-
placeCryptoOrder(requestParameters, options) {
|
|
1619
|
-
return (0, exports.TradingApiFp)(this.configuration).placeCryptoOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1620
|
-
}
|
|
1621
|
-
/**
|
|
1622
|
-
* 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.
|
|
1623
|
-
* @summary Place equity order
|
|
1624
|
-
* @param {TradingApiPlaceForceOrderRequest} requestParameters Request parameters.
|
|
1625
|
-
* @param {*} [options] Override http request option.
|
|
1626
|
-
* @throws {RequiredError}
|
|
1627
|
-
* @memberof TradingApiGenerated
|
|
1628
|
-
*/
|
|
1629
|
-
placeForceOrder(requestParameters, options) {
|
|
1630
|
-
return (0, exports.TradingApiFp)(this.configuration).placeForceOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1631
|
-
}
|
|
1632
|
-
/**
|
|
1633
|
-
* Places a multi-leg option order. Only supported on certain option trading brokerages. https://support.snaptrade.com/brokerages has information on brokerage trading support
|
|
1634
|
-
* @summary Place option order
|
|
1635
|
-
* @param {TradingApiPlaceMlegOrderRequest} requestParameters Request parameters.
|
|
1636
|
-
* @param {*} [options] Override http request option.
|
|
1637
|
-
* @throws {RequiredError}
|
|
1638
|
-
* @memberof TradingApiGenerated
|
|
1639
|
-
*/
|
|
1640
|
-
placeMlegOrder(requestParameters, options) {
|
|
1641
|
-
return (0, exports.TradingApiFp)(this.configuration).placeMlegOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1642
|
-
}
|
|
1643
|
-
/**
|
|
1644
|
-
* 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.
|
|
1645
|
-
* @summary Place checked equity order
|
|
1646
|
-
* @param {TradingApiPlaceOrderRequest} requestParameters Request parameters.
|
|
1647
|
-
* @param {*} [options] Override http request option.
|
|
1648
|
-
* @throws {RequiredError}
|
|
1649
|
-
* @memberof TradingApiGenerated
|
|
1650
|
-
*/
|
|
1651
|
-
placeOrder(requestParameters, options) {
|
|
1652
|
-
return (0, exports.TradingApiFp)(this.configuration).placeOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1653
|
-
}
|
|
1654
|
-
/**
|
|
1655
|
-
* Previews an order using the specified account.
|
|
1656
|
-
* @summary Preview crypto order
|
|
1657
|
-
* @param {TradingApiPreviewCryptoOrderRequest} requestParameters Request parameters.
|
|
1658
|
-
* @param {*} [options] Override http request option.
|
|
1659
|
-
* @throws {RequiredError}
|
|
1660
|
-
* @memberof TradingApiGenerated
|
|
1661
|
-
*/
|
|
1662
|
-
previewCryptoOrder(requestParameters, options) {
|
|
1663
|
-
return (0, exports.TradingApiFp)(this.configuration).previewCryptoOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1664
|
-
}
|
|
1665
|
-
/**
|
|
1666
|
-
* 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
|
|
1667
|
-
* @summary Replace order
|
|
1668
|
-
* @param {TradingApiReplaceOrderRequest} requestParameters Request parameters.
|
|
1669
|
-
* @param {*} [options] Override http request option.
|
|
1670
|
-
* @throws {RequiredError}
|
|
1671
|
-
* @memberof TradingApiGenerated
|
|
1672
|
-
*/
|
|
1673
|
-
replaceOrder(requestParameters, options) {
|
|
1674
|
-
return (0, exports.TradingApiFp)(this.configuration).replaceOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1675
|
-
}
|
|
1676
|
-
/**
|
|
1677
|
-
* Searches cryptocurrency pairs instruments accessible to the specified account. Both `base` and `quote` are optional. Omit both for a full list of cryptocurrency pairs.
|
|
1678
|
-
* @summary Get crypto pairs
|
|
1679
|
-
* @param {TradingApiSearchCryptocurrencyPairInstrumentsRequest} requestParameters Request parameters.
|
|
1680
|
-
* @param {*} [options] Override http request option.
|
|
1681
|
-
* @throws {RequiredError}
|
|
1682
|
-
* @memberof TradingApiGenerated
|
|
1683
|
-
*/
|
|
1684
|
-
searchCryptocurrencyPairInstruments(requestParameters, options) {
|
|
1685
|
-
return (0, exports.TradingApiFp)(this.configuration).searchCryptocurrencyPairInstruments(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1686
|
-
}
|
|
1687
|
-
}
|
|
1688
|
-
exports.TradingApiGenerated = TradingApiGenerated;
|