snaptrade-typescript-sdk 9.0.30 → 9.0.32
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 +12 -14
- package/dist/api/account-information-api-generated.d.ts +14 -14
- package/dist/api/account-information-api-generated.js +13 -13
- package/dist/api/authentication-api-generated.d.ts +4 -4
- package/dist/api/authentication-api-generated.js +4 -4
- package/dist/api/connections-api-generated.d.ts +4 -4
- package/dist/api/connections-api-generated.js +4 -4
- package/dist/api/trading-api-generated.d.ts +4 -4
- package/dist/api/trading-api-generated.js +4 -4
- package/dist/browser.js +1 -1
- package/dist/configuration.js +1 -1
- package/dist/models/account-balance-total.d.ts +2 -2
- package/dist/models/account-balance.d.ts +1 -1
- package/dist/models/account-holdings-account.d.ts +5 -5
- package/dist/models/amount.d.ts +2 -2
- package/dist/models/balance.d.ts +3 -3
- package/dist/models/currency.d.ts +4 -4
- package/dist/models/index.d.ts +0 -1
- package/dist/models/index.js +0 -1
- package/dist/models/options-position-currency.d.ts +3 -3
- package/dist/models/options-position.d.ts +4 -4
- package/dist/models/position.d.ts +7 -6
- package/dist/models/snap-trade-holdings-account-account-id.d.ts +13 -10
- package/dist/models/snap-trade-holdings-total-value.d.ts +3 -3
- package/dist/models/snap-trade-login-user-request-body.d.ts +2 -2
- package/package.json +1 -1
- package/dist/models/options-holdings.d.ts +0 -46
- package/dist/models/options-holdings.js +0 -2
package/dist/configuration.js
CHANGED
|
@@ -32,7 +32,7 @@ class Configuration {
|
|
|
32
32
|
this.accessToken = param.accessToken;
|
|
33
33
|
this.basePath = param.basePath;
|
|
34
34
|
this.baseOptions = (_a = param.baseOptions) !== null && _a !== void 0 ? _a : {};
|
|
35
|
-
this.userAgent = param.userAgent === undefined ? "Konfig/9.0.
|
|
35
|
+
this.userAgent = param.userAgent === undefined ? "Konfig/9.0.32/typescript" : param.userAgent;
|
|
36
36
|
this.formDataCtor = param.formDataCtor;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export interface AccountBalanceTotal {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Total value denominated in the currency of the `currency` field.
|
|
9
9
|
* @type {number}
|
|
10
10
|
* @memberof AccountBalanceTotal
|
|
11
11
|
*/
|
|
12
12
|
'amount'?: number;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* The ISO-4217 currency code for the amount.
|
|
15
15
|
* @type {string}
|
|
16
16
|
* @memberof AccountBalanceTotal
|
|
17
17
|
*/
|
|
@@ -5,7 +5,7 @@ import { Position } from './position';
|
|
|
5
5
|
import { SnapTradeHoldingsAccountAccountId } from './snap-trade-holdings-account-account-id';
|
|
6
6
|
import { SnapTradeHoldingsTotalValue } from './snap-trade-holdings-total-value';
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* A wrapper object containing holdings information for a single account
|
|
9
9
|
* @export
|
|
10
10
|
* @interface AccountHoldingsAccount
|
|
11
11
|
*/
|
|
@@ -18,25 +18,25 @@ export interface AccountHoldingsAccount {
|
|
|
18
18
|
*/
|
|
19
19
|
'account'?: SnapTradeHoldingsAccountAccountId;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* List of balances for the account. Each element of the list has a distinct currency. Some brokerages like Questrade [allows holding multiple currencies in the same account](https://www.questrade.com/learning/questrade-basics/balances-and-reports/understanding-your-account-balances).
|
|
22
22
|
* @type {Array<Balance>}
|
|
23
23
|
* @memberof AccountHoldingsAccount
|
|
24
24
|
*/
|
|
25
25
|
'balances'?: Array<Balance> | null;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* List of stock/ETF/crypto/mutual fund positions in the account.
|
|
28
28
|
* @type {Array<Position>}
|
|
29
29
|
* @memberof AccountHoldingsAccount
|
|
30
30
|
*/
|
|
31
31
|
'positions'?: Array<Position> | null;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* List of option positions in the account.
|
|
34
34
|
* @type {Array<OptionsPosition>}
|
|
35
35
|
* @memberof AccountHoldingsAccount
|
|
36
36
|
*/
|
|
37
37
|
'option_positions'?: Array<OptionsPosition> | null;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* List of recent orders in the account, including both pending and executed orders.
|
|
40
40
|
* @type {Array<AccountOrderRecord>}
|
|
41
41
|
* @memberof AccountHoldingsAccount
|
|
42
42
|
*/
|
package/dist/models/amount.d.ts
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export interface Amount {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Total value denominated in the currency of the `currency` field.
|
|
9
9
|
* @type {number}
|
|
10
10
|
* @memberof Amount
|
|
11
11
|
*/
|
|
12
12
|
'amount'?: number;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* The ISO-4217 currency code for the amount.
|
|
15
15
|
* @type {string}
|
|
16
16
|
* @memberof Amount
|
|
17
17
|
*/
|
package/dist/models/balance.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Currency } from './currency';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Holds balance information for a single currency in an account.
|
|
4
4
|
* @export
|
|
5
5
|
* @interface Balance
|
|
6
6
|
*/
|
|
@@ -13,13 +13,13 @@ export interface Balance {
|
|
|
13
13
|
*/
|
|
14
14
|
'currency'?: Currency;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* The amount of available cash in the account denominated in the currency of the `currency` field.
|
|
17
17
|
* @type {number}
|
|
18
18
|
* @memberof Balance
|
|
19
19
|
*/
|
|
20
20
|
'cash'?: number | null;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Buying power only applies to margin accounts. For non-margin accounts, buying power should be the same as cash. Please note that this field is not always available for all brokerages.
|
|
23
23
|
* @type {number}
|
|
24
24
|
* @memberof Balance
|
|
25
25
|
*/
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Describes a currency object.
|
|
3
3
|
* @export
|
|
4
4
|
* @interface Currency
|
|
5
5
|
*/
|
|
6
6
|
export interface Currency {
|
|
7
7
|
[key: string]: any;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Unique identifier for the currency. This is the UUID used to reference the currency in SnapTrade.
|
|
10
10
|
* @type {string}
|
|
11
11
|
* @memberof Currency
|
|
12
12
|
*/
|
|
13
13
|
'id'?: string;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* The ISO-4217 currency code for the currency.
|
|
16
16
|
* @type {string}
|
|
17
17
|
* @memberof Currency
|
|
18
18
|
*/
|
|
19
19
|
'code'?: string;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* A human-friendly name of the currency.
|
|
22
22
|
* @type {string}
|
|
23
23
|
* @memberof Currency
|
|
24
24
|
*/
|
package/dist/models/index.d.ts
CHANGED
|
@@ -70,7 +70,6 @@ export * from './option-leg';
|
|
|
70
70
|
export * from './option-strategy';
|
|
71
71
|
export * from './option-strategy-legs-inner';
|
|
72
72
|
export * from './options-get-option-strategy-request';
|
|
73
|
-
export * from './options-holdings';
|
|
74
73
|
export * from './options-place-option-strategy-request';
|
|
75
74
|
export * from './options-position';
|
|
76
75
|
export * from './options-position-currency';
|
package/dist/models/index.js
CHANGED
|
@@ -86,7 +86,6 @@ __exportStar(require("./option-leg"), exports);
|
|
|
86
86
|
__exportStar(require("./option-strategy"), exports);
|
|
87
87
|
__exportStar(require("./option-strategy-legs-inner"), exports);
|
|
88
88
|
__exportStar(require("./options-get-option-strategy-request"), exports);
|
|
89
|
-
__exportStar(require("./options-holdings"), exports);
|
|
90
89
|
__exportStar(require("./options-place-option-strategy-request"), exports);
|
|
91
90
|
__exportStar(require("./options-position"), exports);
|
|
92
91
|
__exportStar(require("./options-position-currency"), exports);
|
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export interface OptionsPositionCurrency {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Unique identifier for the currency. This is the UUID used to reference the currency in SnapTrade.
|
|
9
9
|
* @type {string}
|
|
10
10
|
* @memberof OptionsPositionCurrency
|
|
11
11
|
*/
|
|
12
12
|
'id'?: string;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* The ISO-4217 currency code for the currency.
|
|
15
15
|
* @type {string}
|
|
16
16
|
* @memberof OptionsPositionCurrency
|
|
17
17
|
*/
|
|
18
18
|
'code'?: string;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* A human-friendly name of the currency.
|
|
21
21
|
* @type {string}
|
|
22
22
|
* @memberof OptionsPositionCurrency
|
|
23
23
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OptionBrokerageSymbol } from './option-brokerage-symbol';
|
|
2
2
|
import { OptionsPositionCurrency } from './options-position-currency';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Describes a single option position in an account.
|
|
5
5
|
* @export
|
|
6
6
|
* @interface OptionsPosition
|
|
7
7
|
*/
|
|
@@ -14,13 +14,13 @@ export interface OptionsPosition {
|
|
|
14
14
|
*/
|
|
15
15
|
'symbol'?: OptionBrokerageSymbol;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Last known market price for the option contract. The freshness of this price depends on the brokerage. Some brokerages provide real-time prices, while others provide delayed prices. It is recommended that you rely on your own third-party market data provider for most up to date prices.
|
|
18
18
|
* @type {number}
|
|
19
19
|
* @memberof OptionsPosition
|
|
20
20
|
*/
|
|
21
21
|
'price'?: number | null;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* The number of contracts for this option position.
|
|
24
24
|
* @type {number}
|
|
25
25
|
* @memberof OptionsPosition
|
|
26
26
|
*/
|
|
@@ -32,7 +32,7 @@ export interface OptionsPosition {
|
|
|
32
32
|
*/
|
|
33
33
|
'currency'?: OptionsPositionCurrency | null;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* Cost basis _per contract_ of this option position. To get the cost basis _per share_, divide this value by the number of shares per contract (usually 100).
|
|
36
36
|
* @type {number}
|
|
37
37
|
* @memberof OptionsPosition
|
|
38
38
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PositionSymbol } from './position-symbol';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Describes a single stock/ETF/crypto/mutual fund position in an account.
|
|
4
4
|
* @export
|
|
5
5
|
* @interface Position
|
|
6
6
|
*/
|
|
@@ -13,31 +13,32 @@ export interface Position {
|
|
|
13
13
|
*/
|
|
14
14
|
'symbol'?: PositionSymbol;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* The number of shares of the position. This can be fractional or integer units.
|
|
17
17
|
* @type {number}
|
|
18
18
|
* @memberof Position
|
|
19
19
|
*/
|
|
20
20
|
'units'?: number | null;
|
|
21
21
|
/**
|
|
22
|
-
* Last known market price for the symbol
|
|
22
|
+
* Last known market price for the symbol. The freshness of this price depends on the brokerage. Some brokerages provide real-time prices, while others provide delayed prices. It is recommended that you rely on your own third-party market data provider for most up to date prices.
|
|
23
23
|
* @type {number}
|
|
24
24
|
* @memberof Position
|
|
25
25
|
*/
|
|
26
26
|
'price'?: number | null;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* The profit or loss on the position since it was opened. This is calculated as the difference between the current market value of the position and the total cost of the position. It is recommended to calculate this value using the average purchase price and the current market price yourself, instead of relying on this field.
|
|
29
29
|
* @type {number}
|
|
30
30
|
* @memberof Position
|
|
31
31
|
*/
|
|
32
32
|
'open_pnl'?: number | null;
|
|
33
33
|
/**
|
|
34
|
-
* Deprecated, use the units field for both fractional and integer units going forward
|
|
34
|
+
* Deprecated, use the `units` field for both fractional and integer units going forward
|
|
35
35
|
* @type {number}
|
|
36
36
|
* @memberof Position
|
|
37
|
+
* @deprecated
|
|
37
38
|
*/
|
|
38
39
|
'fractional_units'?: number | null;
|
|
39
40
|
/**
|
|
40
|
-
*
|
|
41
|
+
* Cost basis _per share_ of this position.
|
|
41
42
|
* @type {number}
|
|
42
43
|
* @memberof Position
|
|
43
44
|
*/
|
|
@@ -1,44 +1,45 @@
|
|
|
1
1
|
import { CashRestriction } from './cash-restriction';
|
|
2
2
|
import { SnapTradeHoldingsAccountAccountIdBalance } from './snap-trade-holdings-account-account-id-balance';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* A single brokerage account at a financial institution.
|
|
5
5
|
* @export
|
|
6
6
|
* @interface SnapTradeHoldingsAccountAccountId
|
|
7
7
|
*/
|
|
8
8
|
export interface SnapTradeHoldingsAccountAccountId {
|
|
9
9
|
[key: string]: any;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
|
|
12
12
|
* @type {string}
|
|
13
13
|
* @memberof SnapTradeHoldingsAccountAccountId
|
|
14
14
|
*/
|
|
15
15
|
'id'?: string;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Unique identifier for the connection (brokerage authorization). This is the UUID used to reference the connection in SnapTrade.
|
|
18
18
|
* @type {string}
|
|
19
19
|
* @memberof SnapTradeHoldingsAccountAccountId
|
|
20
20
|
*/
|
|
21
21
|
'brokerage_authorization'?: string;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Portfolio Group ID. Portfolio Groups have been deprecated. Please contact support if you have a usecase for it.
|
|
24
24
|
* @type {string}
|
|
25
25
|
* @memberof SnapTradeHoldingsAccountAccountId
|
|
26
|
+
* @deprecated
|
|
26
27
|
*/
|
|
27
28
|
'portfolio_group'?: string;
|
|
28
29
|
/**
|
|
29
|
-
*
|
|
30
|
+
* A display name for the account. Either assigned by the user or by the financial institution itself. For certain institutions, SnapTrade appends the institution name to the account name for clarity.
|
|
30
31
|
* @type {string}
|
|
31
32
|
* @memberof SnapTradeHoldingsAccountAccountId
|
|
32
33
|
*/
|
|
33
34
|
'name'?: string | null;
|
|
34
35
|
/**
|
|
35
|
-
*
|
|
36
|
+
* The account number assigned by the financial institution.
|
|
36
37
|
* @type {string}
|
|
37
38
|
* @memberof SnapTradeHoldingsAccountAccountId
|
|
38
39
|
*/
|
|
39
40
|
'number'?: string;
|
|
40
41
|
/**
|
|
41
|
-
*
|
|
42
|
+
* The name of the financial institution that holds the account.
|
|
42
43
|
* @type {string}
|
|
43
44
|
* @memberof SnapTradeHoldingsAccountAccountId
|
|
44
45
|
*/
|
|
@@ -50,21 +51,23 @@ export interface SnapTradeHoldingsAccountAccountId {
|
|
|
50
51
|
*/
|
|
51
52
|
'balance'?: SnapTradeHoldingsAccountAccountIdBalance | null;
|
|
52
53
|
/**
|
|
53
|
-
*
|
|
54
|
+
* Additional information about the account, such as account type, status, etc. This information is specific to the financial institution and there\'s no standard format for this data. Please use at your own risk.
|
|
54
55
|
* @type {{ [key: string]: any; }}
|
|
55
56
|
* @memberof SnapTradeHoldingsAccountAccountId
|
|
57
|
+
* @deprecated
|
|
56
58
|
*/
|
|
57
59
|
'meta'?: {
|
|
58
60
|
[key: string]: any;
|
|
59
61
|
};
|
|
60
62
|
/**
|
|
61
|
-
*
|
|
63
|
+
* This field is deprecated.
|
|
62
64
|
* @type {Array<CashRestriction>}
|
|
63
65
|
* @memberof SnapTradeHoldingsAccountAccountId
|
|
66
|
+
* @deprecated
|
|
64
67
|
*/
|
|
65
68
|
'cash_restrictions'?: Array<CashRestriction>;
|
|
66
69
|
/**
|
|
67
|
-
*
|
|
70
|
+
* Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the account was created in SnapTrade. This is _not_ the account opening date at the financial institution.
|
|
68
71
|
* @type {string}
|
|
69
72
|
* @memberof SnapTradeHoldingsAccountAccountId
|
|
70
73
|
*/
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The total market value of the account. Note that this field is calculated based on the sum of the values of account positions and cash balances known to SnapTrade. It may not be accurate if the brokerage account has holdings that SnapTrade is not aware of. For example, if the brokerage account holds assets that SnapTrade does not support, the total value may be underreported. To get the brokerage reported total market value of the account, refer to `account.balance.total`.
|
|
3
3
|
* @export
|
|
4
4
|
* @interface SnapTradeHoldingsTotalValue
|
|
5
5
|
*/
|
|
6
6
|
export interface SnapTradeHoldingsTotalValue {
|
|
7
7
|
[key: string]: any;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Total value denominated in the currency of the `currency` field.
|
|
10
10
|
* @type {number}
|
|
11
11
|
* @memberof SnapTradeHoldingsTotalValue
|
|
12
12
|
*/
|
|
13
13
|
'value'?: number | null;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* The ISO-4217 currency code for the amount.
|
|
16
16
|
* @type {string}
|
|
17
17
|
* @memberof SnapTradeHoldingsTotalValue
|
|
18
18
|
*/
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export interface SnapTradeLoginUserRequestBody {
|
|
7
7
|
/**
|
|
8
|
-
* Slug of the brokerage to connect the user to
|
|
8
|
+
* Slug of the brokerage to connect the user to. See [this document](https://snaptrade.notion.site/SnapTrade-Brokerage-Integrations-f83946a714a84c3caf599f6a945f0ead) for a list of supported brokerages and their slugs.
|
|
9
9
|
* @type {string}
|
|
10
10
|
* @memberof SnapTradeLoginUserRequestBody
|
|
11
11
|
*/
|
|
@@ -35,7 +35,7 @@ export interface SnapTradeLoginUserRequestBody {
|
|
|
35
35
|
*/
|
|
36
36
|
'connectionType'?: SnapTradeLoginUserRequestBodyConnectionTypeEnum;
|
|
37
37
|
/**
|
|
38
|
-
* Sets the version of the connection portal to render, with a default to \'
|
|
38
|
+
* Sets the version of the connection portal to render, with a default to \'v3\'
|
|
39
39
|
* @type {string}
|
|
40
40
|
* @memberof SnapTradeLoginUserRequestBody
|
|
41
41
|
*/
|
package/package.json
CHANGED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Currency } from './currency';
|
|
2
|
-
import { OptionsSymbol } from './options-symbol';
|
|
3
|
-
/**
|
|
4
|
-
* Option Holdings
|
|
5
|
-
* @export
|
|
6
|
-
* @interface OptionsHoldings
|
|
7
|
-
*/
|
|
8
|
-
export interface OptionsHoldings {
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
/**
|
|
11
|
-
* Options information
|
|
12
|
-
* @type {string}
|
|
13
|
-
* @memberof OptionsHoldings
|
|
14
|
-
*/
|
|
15
|
-
'id'?: string;
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* @type {string}
|
|
19
|
-
* @memberof OptionsHoldings
|
|
20
|
-
*/
|
|
21
|
-
'symbol'?: string;
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* @type {OptionsSymbol}
|
|
25
|
-
* @memberof OptionsHoldings
|
|
26
|
-
*/
|
|
27
|
-
'option_symbol'?: OptionsSymbol;
|
|
28
|
-
/**
|
|
29
|
-
* Trade Price if limit or stop limit order
|
|
30
|
-
* @type {number}
|
|
31
|
-
* @memberof OptionsHoldings
|
|
32
|
-
*/
|
|
33
|
-
'price'?: number | null;
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
* @type {Currency}
|
|
37
|
-
* @memberof OptionsHoldings
|
|
38
|
-
*/
|
|
39
|
-
'currency'?: Currency;
|
|
40
|
-
/**
|
|
41
|
-
* Average purchase price for this position
|
|
42
|
-
* @type {number}
|
|
43
|
-
* @memberof OptionsHoldings
|
|
44
|
-
*/
|
|
45
|
-
'average_purchase_price'?: number | null;
|
|
46
|
-
}
|