snaptrade-typescript-sdk 9.0.187 → 9.0.189

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +128 -1
  2. package/dist/api/experimental-endpoints-api-generated.d.ts +75 -0
  3. package/dist/api/experimental-endpoints-api-generated.js +97 -0
  4. package/dist/api/trading-api-generated.d.ts +63 -0
  5. package/dist/api/trading-api-generated.js +100 -0
  6. package/dist/browser.js +1 -1
  7. package/dist/configuration.js +1 -1
  8. package/dist/models/account-order-record-quote-universal-symbol.d.ts +3 -3
  9. package/dist/models/account-order-record-universal-symbol.d.ts +3 -3
  10. package/dist/models/account-position.d.ts +52 -0
  11. package/dist/models/account-universal-activity-symbol.d.ts +3 -3
  12. package/dist/models/all-account-positions-response.d.ts +33 -0
  13. package/dist/models/all-account-positions-response.js +2 -0
  14. package/dist/models/complex-order-leg.d.ts +62 -0
  15. package/dist/models/complex-order-leg.js +2 -0
  16. package/dist/models/complex-order-response.d.ts +22 -0
  17. package/dist/models/complex-order-response.js +2 -0
  18. package/dist/models/crypto-instrument.d.ts +59 -0
  19. package/dist/models/crypto-instrument.js +2 -0
  20. package/dist/models/etf-instrument.d.ts +59 -0
  21. package/dist/models/etf-instrument.js +2 -0
  22. package/dist/models/future-instrument.d.ts +64 -0
  23. package/dist/models/future-instrument.js +2 -0
  24. package/dist/models/index.d.ts +14 -1
  25. package/dist/models/index.js +14 -1
  26. package/dist/models/instrument.d.ts +24 -0
  27. package/dist/models/instrument.js +2 -0
  28. package/dist/models/manual-trade-form-complex.d.ts +28 -0
  29. package/dist/models/manual-trade-form-complex.js +2 -0
  30. package/dist/models/option-instrument.d.ts +60 -0
  31. package/dist/models/option-instrument.js +2 -0
  32. package/dist/models/other-instrument.d.ts +59 -0
  33. package/dist/models/other-instrument.js +2 -0
  34. package/dist/models/{symbol-figi-instrument.d.ts → stock-instrument-figi-instrument.d.ts} +4 -4
  35. package/dist/models/stock-instrument-figi-instrument.js +2 -0
  36. package/dist/models/stock-instrument.d.ts +59 -0
  37. package/dist/models/stock-instrument.js +2 -0
  38. package/dist/models/symbol.d.ts +3 -3
  39. package/dist/models/underlying-option-instrument.d.ts +18 -0
  40. package/dist/models/underlying-option-instrument.js +2 -0
  41. package/dist/models/underlying-symbol.d.ts +3 -3
  42. package/dist/models/universal-symbol.d.ts +3 -3
  43. package/dist/operationParameterMap.js +41 -0
  44. package/package.json +1 -1
  45. /package/dist/models/{symbol-figi-instrument.js → account-position.js} +0 -0
@@ -0,0 +1,28 @@
1
+ import { ComplexOrderLeg } from './complex-order-leg';
2
+ /**
3
+ * Request body for placing a complex conditional order (OCO, OTO, or OTOCO).
4
+ * @export
5
+ * @interface ManualTradeFormComplex
6
+ */
7
+ export interface ManualTradeFormComplex {
8
+ /**
9
+ * The complex order type. - `OCO`: One Cancels the Other — two peer orders. - `OTO`: One Triggers the Other — a trigger order and a conditional order. - `OTOCO`: One Triggers a One Cancels the Other — a trigger order and two peer orders.
10
+ * @type {string}
11
+ * @memberof ManualTradeFormComplex
12
+ */
13
+ 'type': ManualTradeFormComplexTypeEnum;
14
+ /**
15
+ * The orders that make up the complex order. Required counts and roles per type: - `OCO`: exactly 2 orders, both `PEER` - `OTO`: exactly 2 orders, one `TRIGGER` and one `CONDITIONAL` - `OTOCO`: exactly 3 orders, one `TRIGGER` and two `PEER`
16
+ * @type {Array<ComplexOrderLeg>}
17
+ * @memberof ManualTradeFormComplex
18
+ */
19
+ 'orders': Array<ComplexOrderLeg>;
20
+ /**
21
+ * An optional client-provided identifier for this complex order. Passed through to the brokerage and returned in the response.
22
+ * @type {string}
23
+ * @memberof ManualTradeFormComplex
24
+ */
25
+ 'client_order_id'?: string | null;
26
+ }
27
+ type ManualTradeFormComplexTypeEnum = 'OCO' | 'OTO' | 'OTOCO';
28
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,60 @@
1
+ import { UnderlyingOptionInstrument } from './underlying-option-instrument';
2
+ /**
3
+ * Option instrument metadata for a V2 position.
4
+ * @export
5
+ * @interface OptionInstrument
6
+ */
7
+ export interface OptionInstrument {
8
+ [key: string]: any;
9
+ /**
10
+ *
11
+ * @type {string}
12
+ * @memberof OptionInstrument
13
+ */
14
+ 'kind': OptionInstrumentKindEnum;
15
+ /**
16
+ * Unique identifier for the option instrument.
17
+ * @type {string}
18
+ * @memberof OptionInstrument
19
+ */
20
+ 'id': string;
21
+ /**
22
+ * OCC symbol for the option contract.
23
+ * @type {string}
24
+ * @memberof OptionInstrument
25
+ */
26
+ 'symbol': string;
27
+ /**
28
+ * Whether the contract is a call or put.
29
+ * @type {string}
30
+ * @memberof OptionInstrument
31
+ */
32
+ 'option_type': OptionInstrumentOptionTypeEnum;
33
+ /**
34
+ * Strike price for the option contract.
35
+ * @type {string}
36
+ * @memberof OptionInstrument
37
+ */
38
+ 'strike_price': string;
39
+ /**
40
+ * Expiration date of the option contract.
41
+ * @type {string}
42
+ * @memberof OptionInstrument
43
+ */
44
+ 'expiration_date': string;
45
+ /**
46
+ * Human-readable description of the option contract.
47
+ * @type {string}
48
+ * @memberof OptionInstrument
49
+ */
50
+ 'description'?: string | null;
51
+ /**
52
+ *
53
+ * @type {UnderlyingOptionInstrument}
54
+ * @memberof OptionInstrument
55
+ */
56
+ 'underlying': UnderlyingOptionInstrument;
57
+ }
58
+ type OptionInstrumentKindEnum = 'option';
59
+ type OptionInstrumentOptionTypeEnum = 'CALL' | 'PUT';
60
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,59 @@
1
+ import { StockInstrumentFigiInstrument } from './stock-instrument-figi-instrument';
2
+ /**
3
+ * Security instrument metadata for other mapped security positions.
4
+ * @export
5
+ * @interface OtherInstrument
6
+ */
7
+ export interface OtherInstrument {
8
+ [key: string]: any;
9
+ /**
10
+ * Type of security instrument.
11
+ * @type {string}
12
+ * @memberof OtherInstrument
13
+ */
14
+ 'kind': OtherInstrumentKindEnum;
15
+ /**
16
+ * Unique identifier for the instrument.
17
+ * @type {string}
18
+ * @memberof OtherInstrument
19
+ */
20
+ 'id': string;
21
+ /**
22
+ * The formatted trading symbol for the security.
23
+ * @type {string}
24
+ * @memberof OtherInstrument
25
+ */
26
+ 'symbol': string;
27
+ /**
28
+ * The raw symbol without any exchange suffix.
29
+ * @type {string}
30
+ * @memberof OtherInstrument
31
+ */
32
+ 'raw_symbol': string;
33
+ /**
34
+ * Human-readable description of the security.
35
+ * @type {string}
36
+ * @memberof OtherInstrument
37
+ */
38
+ 'description'?: string | null;
39
+ /**
40
+ * ISO-4217 currency code for the security listing.
41
+ * @type {string}
42
+ * @memberof OtherInstrument
43
+ */
44
+ 'currency'?: string | null;
45
+ /**
46
+ * Exchange MIC code or exchange code for the security.
47
+ * @type {string}
48
+ * @memberof OtherInstrument
49
+ */
50
+ 'exchange'?: string | null;
51
+ /**
52
+ *
53
+ * @type {StockInstrumentFigiInstrument}
54
+ * @memberof OtherInstrument
55
+ */
56
+ 'figi_instrument'?: StockInstrumentFigiInstrument | null;
57
+ }
58
+ type OtherInstrumentKindEnum = 'other';
59
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,19 +1,19 @@
1
1
  /**
2
2
  *
3
3
  * @export
4
- * @interface SymbolFigiInstrument
4
+ * @interface StockInstrumentFigiInstrument
5
5
  */
6
- export interface SymbolFigiInstrument {
6
+ export interface StockInstrumentFigiInstrument {
7
7
  /**
8
8
  * This identifier is unique per security per trading venue. See section 1.4.1 of the [FIGI Standard](https://www.openfigi.com/assets/local/figi-allocation-rules.pdf) for more information.
9
9
  * @type {string}
10
- * @memberof SymbolFigiInstrument
10
+ * @memberof StockInstrumentFigiInstrument
11
11
  */
12
12
  'figi_code'?: string | null;
13
13
  /**
14
14
  * This enables users to link multiple FIGIs for the same security in order to obtain an aggregated view across all countries and all exchanges. For example, `AAPL` has a different FIGI for each exchange/trading venue it is traded on. The `figi_share_class` is the same for all of these FIGIs. See section 1.4.3 of the [FIGI Standard](https://www.openfigi.com/assets/local/figi-allocation-rules.pdf) for more information.
15
15
  * @type {string}
16
- * @memberof SymbolFigiInstrument
16
+ * @memberof StockInstrumentFigiInstrument
17
17
  */
18
18
  'figi_share_class'?: string | null;
19
19
  }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,59 @@
1
+ import { StockInstrumentFigiInstrument } from './stock-instrument-figi-instrument';
2
+ /**
3
+ * Security instrument metadata for stock positions.
4
+ * @export
5
+ * @interface StockInstrument
6
+ */
7
+ export interface StockInstrument {
8
+ [key: string]: any;
9
+ /**
10
+ * Type of security instrument.
11
+ * @type {string}
12
+ * @memberof StockInstrument
13
+ */
14
+ 'kind': StockInstrumentKindEnum;
15
+ /**
16
+ * Unique identifier for the instrument.
17
+ * @type {string}
18
+ * @memberof StockInstrument
19
+ */
20
+ 'id': string;
21
+ /**
22
+ * The formatted trading symbol for the security.
23
+ * @type {string}
24
+ * @memberof StockInstrument
25
+ */
26
+ 'symbol': string;
27
+ /**
28
+ * The raw symbol without any exchange suffix.
29
+ * @type {string}
30
+ * @memberof StockInstrument
31
+ */
32
+ 'raw_symbol': string;
33
+ /**
34
+ * Human-readable description of the security.
35
+ * @type {string}
36
+ * @memberof StockInstrument
37
+ */
38
+ 'description'?: string | null;
39
+ /**
40
+ * ISO-4217 currency code for the security listing.
41
+ * @type {string}
42
+ * @memberof StockInstrument
43
+ */
44
+ 'currency'?: string | null;
45
+ /**
46
+ * Exchange MIC code or exchange code for the security.
47
+ * @type {string}
48
+ * @memberof StockInstrument
49
+ */
50
+ 'exchange'?: string | null;
51
+ /**
52
+ *
53
+ * @type {StockInstrumentFigiInstrument}
54
+ * @memberof StockInstrument
55
+ */
56
+ 'figi_instrument'?: StockInstrumentFigiInstrument | null;
57
+ }
58
+ type StockInstrumentKindEnum = 'stock';
59
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  import { SecurityType } from './security-type';
2
+ import { StockInstrumentFigiInstrument } from './stock-instrument-figi-instrument';
2
3
  import { SymbolCurrency } from './symbol-currency';
3
4
  import { SymbolExchange } from './symbol-exchange';
4
- import { SymbolFigiInstrument } from './symbol-figi-instrument';
5
5
  /**
6
6
  * Uniquely describes a single security + exchange combination across all brokerages.
7
7
  * @export
@@ -59,8 +59,8 @@ export interface Symbol {
59
59
  'figi_code'?: string | null;
60
60
  /**
61
61
  *
62
- * @type {SymbolFigiInstrument}
62
+ * @type {StockInstrumentFigiInstrument}
63
63
  * @memberof Symbol
64
64
  */
65
- 'figi_instrument'?: SymbolFigiInstrument | null;
65
+ 'figi_instrument'?: StockInstrumentFigiInstrument | null;
66
66
  }
@@ -0,0 +1,18 @@
1
+ import { CryptoInstrument } from './crypto-instrument';
2
+ import { EtfInstrument } from './etf-instrument';
3
+ import { OtherInstrument } from './other-instrument';
4
+ import { StockInstrument } from './stock-instrument';
5
+ /**
6
+ * @type UnderlyingOptionInstrument
7
+ * The underlying instrument for an option.
8
+ * @export
9
+ */
10
+ export type UnderlyingOptionInstrument = {
11
+ kind: 'crypto';
12
+ } & CryptoInstrument | {
13
+ kind: 'etf';
14
+ } & EtfInstrument | {
15
+ kind: 'other';
16
+ } & OtherInstrument | {
17
+ kind: 'stock';
18
+ } & StockInstrument;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,6 @@
1
1
  import { Currency } from './currency';
2
+ import { StockInstrumentFigiInstrument } from './stock-instrument-figi-instrument';
2
3
  import { SymbolCurrency } from './symbol-currency';
3
- import { SymbolFigiInstrument } from './symbol-figi-instrument';
4
4
  import { UnderlyingSymbolExchange } from './underlying-symbol-exchange';
5
5
  import { UnderlyingSymbolType } from './underlying-symbol-type';
6
6
  /**
@@ -60,10 +60,10 @@ export interface UnderlyingSymbol {
60
60
  'figi_code'?: string | null;
61
61
  /**
62
62
  *
63
- * @type {SymbolFigiInstrument}
63
+ * @type {StockInstrumentFigiInstrument}
64
64
  * @memberof UnderlyingSymbol
65
65
  */
66
- 'figi_instrument'?: SymbolFigiInstrument | null;
66
+ 'figi_instrument'?: StockInstrumentFigiInstrument | null;
67
67
  /**
68
68
  * This field is deprecated and should not be used. Please reach out to SnapTrade support if you have a valid use case for this.
69
69
  * @type {Array<Currency>}
@@ -1,8 +1,8 @@
1
1
  import { Currency } from './currency';
2
2
  import { SecurityType } from './security-type';
3
+ import { StockInstrumentFigiInstrument } from './stock-instrument-figi-instrument';
3
4
  import { SymbolCurrency } from './symbol-currency';
4
5
  import { SymbolExchange } from './symbol-exchange';
5
- import { SymbolFigiInstrument } from './symbol-figi-instrument';
6
6
  /**
7
7
  * Uniquely describes a single security + exchange combination across all brokerages.
8
8
  * @export
@@ -60,10 +60,10 @@ export interface UniversalSymbol {
60
60
  'figi_code'?: string | null;
61
61
  /**
62
62
  *
63
- * @type {SymbolFigiInstrument}
63
+ * @type {StockInstrumentFigiInstrument}
64
64
  * @memberof UniversalSymbol
65
65
  */
66
- 'figi_instrument'?: SymbolFigiInstrument | null;
66
+ 'figi_instrument'?: StockInstrumentFigiInstrument | null;
67
67
  /**
68
68
  * This field is deprecated and should not be used. Please reach out to SnapTrade support if you have a valid use case for this.
69
69
  * @type {Array<Currency>}
@@ -366,6 +366,25 @@ exports.operationParameterMap = {
366
366
  },
367
367
  ]
368
368
  },
369
+ '/accounts/{accountId}/positions/all-GET': {
370
+ parameters: [
371
+ {
372
+ name: 'userId'
373
+ },
374
+ {
375
+ name: 'userSecret'
376
+ },
377
+ {
378
+ name: 'accountId'
379
+ },
380
+ {
381
+ name: 'page'
382
+ },
383
+ {
384
+ name: 'page_size'
385
+ },
386
+ ]
387
+ },
369
388
  '/accounts/{accountId}/orders/details/v2/{brokerageOrderId}-GET': {
370
389
  parameters: [
371
390
  {
@@ -703,6 +722,28 @@ exports.operationParameterMap = {
703
722
  },
704
723
  ]
705
724
  },
725
+ '/accounts/{accountId}/trading/complex-POST': {
726
+ parameters: [
727
+ {
728
+ name: 'type'
729
+ },
730
+ {
731
+ name: 'orders'
732
+ },
733
+ {
734
+ name: 'accountId'
735
+ },
736
+ {
737
+ name: 'userId'
738
+ },
739
+ {
740
+ name: 'userSecret'
741
+ },
742
+ {
743
+ name: 'client_order_id'
744
+ },
745
+ ]
746
+ },
706
747
  '/accounts/{accountId}/trading/crypto-POST': {
707
748
  parameters: [
708
749
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snaptrade-typescript-sdk",
3
- "version": "9.0.187",
3
+ "version": "9.0.189",
4
4
  "description": "Client for SnapTrade",
5
5
  "author": "Konfig",
6
6
  "engines": {