adaptic-backend 1.0.71 → 1.0.72
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/generated/typeStrings/Account.cjs +0 -211
- package/generated/typeStrings/Account.d.ts +1 -1
- package/generated/typeStrings/Account.d.ts.map +1 -1
- package/generated/typeStrings/Account.js.map +1 -1
- package/generated/typeStrings/Action.cjs +143 -195
- package/generated/typeStrings/Action.d.ts +1 -1
- package/generated/typeStrings/Action.d.ts.map +1 -1
- package/generated/typeStrings/Action.js.map +1 -1
- package/generated/typeStrings/Alert.cjs +100 -268
- package/generated/typeStrings/Alert.d.ts +1 -1
- package/generated/typeStrings/Alert.d.ts.map +1 -1
- package/generated/typeStrings/Alert.js.map +1 -1
- package/generated/typeStrings/AlpacaAccount.cjs +31 -177
- package/generated/typeStrings/AlpacaAccount.d.ts +1 -1
- package/generated/typeStrings/AlpacaAccount.d.ts.map +1 -1
- package/generated/typeStrings/AlpacaAccount.js.map +1 -1
- package/generated/typeStrings/Asset.cjs +31 -199
- package/generated/typeStrings/Asset.d.ts +1 -1
- package/generated/typeStrings/Asset.d.ts.map +1 -1
- package/generated/typeStrings/Asset.js.map +1 -1
- package/generated/typeStrings/Authenticator.cjs +0 -211
- package/generated/typeStrings/Authenticator.d.ts +1 -1
- package/generated/typeStrings/Authenticator.d.ts.map +1 -1
- package/generated/typeStrings/Authenticator.js.map +1 -1
- package/generated/typeStrings/Customer.cjs +0 -211
- package/generated/typeStrings/Customer.d.ts +1 -1
- package/generated/typeStrings/Customer.d.ts.map +1 -1
- package/generated/typeStrings/Customer.js.map +1 -1
- package/generated/typeStrings/NewsArticle.cjs +0 -169
- package/generated/typeStrings/NewsArticle.d.ts +1 -1
- package/generated/typeStrings/NewsArticle.d.ts.map +1 -1
- package/generated/typeStrings/NewsArticle.js.map +1 -1
- package/generated/typeStrings/NewsArticleAssetSentiment.cjs +100 -81
- package/generated/typeStrings/NewsArticleAssetSentiment.d.ts +1 -1
- package/generated/typeStrings/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/generated/typeStrings/NewsArticleAssetSentiment.js.map +1 -1
- package/generated/typeStrings/Order.cjs +31 -278
- package/generated/typeStrings/Order.d.ts +1 -1
- package/generated/typeStrings/Order.d.ts.map +1 -1
- package/generated/typeStrings/Order.js.map +1 -1
- package/generated/typeStrings/Position.cjs +67 -114
- package/generated/typeStrings/Position.d.ts +1 -1
- package/generated/typeStrings/Position.d.ts.map +1 -1
- package/generated/typeStrings/Position.js.map +1 -1
- package/generated/typeStrings/Session.cjs +0 -211
- package/generated/typeStrings/Session.d.ts +1 -1
- package/generated/typeStrings/Session.d.ts.map +1 -1
- package/generated/typeStrings/Session.js.map +1 -1
- package/generated/typeStrings/Trade.cjs +31 -278
- package/generated/typeStrings/Trade.d.ts +1 -1
- package/generated/typeStrings/Trade.d.ts.map +1 -1
- package/generated/typeStrings/Trade.js.map +1 -1
- package/generated/typeStrings/User.cjs +100 -222
- package/generated/typeStrings/User.d.ts +1 -1
- package/generated/typeStrings/User.d.ts.map +1 -1
- package/generated/typeStrings/User.js.map +1 -1
- package/generated/typeStrings/index.d.ts +14 -14
- package/package.json +1 -1
- package/server/generated/typeStrings/Account.d.ts +1 -1
- package/server/generated/typeStrings/Account.d.ts.map +1 -1
- package/server/generated/typeStrings/Account.js.map +1 -1
- package/server/generated/typeStrings/Account.mjs +0 -211
- package/server/generated/typeStrings/Action.d.ts +1 -1
- package/server/generated/typeStrings/Action.d.ts.map +1 -1
- package/server/generated/typeStrings/Action.js.map +1 -1
- package/server/generated/typeStrings/Action.mjs +143 -195
- package/server/generated/typeStrings/Alert.d.ts +1 -1
- package/server/generated/typeStrings/Alert.d.ts.map +1 -1
- package/server/generated/typeStrings/Alert.js.map +1 -1
- package/server/generated/typeStrings/Alert.mjs +100 -268
- package/server/generated/typeStrings/AlpacaAccount.d.ts +1 -1
- package/server/generated/typeStrings/AlpacaAccount.d.ts.map +1 -1
- package/server/generated/typeStrings/AlpacaAccount.js.map +1 -1
- package/server/generated/typeStrings/AlpacaAccount.mjs +31 -177
- package/server/generated/typeStrings/Asset.d.ts +1 -1
- package/server/generated/typeStrings/Asset.d.ts.map +1 -1
- package/server/generated/typeStrings/Asset.js.map +1 -1
- package/server/generated/typeStrings/Asset.mjs +31 -199
- package/server/generated/typeStrings/Authenticator.d.ts +1 -1
- package/server/generated/typeStrings/Authenticator.d.ts.map +1 -1
- package/server/generated/typeStrings/Authenticator.js.map +1 -1
- package/server/generated/typeStrings/Authenticator.mjs +0 -211
- package/server/generated/typeStrings/Customer.d.ts +1 -1
- package/server/generated/typeStrings/Customer.d.ts.map +1 -1
- package/server/generated/typeStrings/Customer.js.map +1 -1
- package/server/generated/typeStrings/Customer.mjs +0 -211
- package/server/generated/typeStrings/NewsArticle.d.ts +1 -1
- package/server/generated/typeStrings/NewsArticle.d.ts.map +1 -1
- package/server/generated/typeStrings/NewsArticle.js.map +1 -1
- package/server/generated/typeStrings/NewsArticle.mjs +0 -169
- package/server/generated/typeStrings/NewsArticleAssetSentiment.d.ts +1 -1
- package/server/generated/typeStrings/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/server/generated/typeStrings/NewsArticleAssetSentiment.js.map +1 -1
- package/server/generated/typeStrings/NewsArticleAssetSentiment.mjs +100 -81
- package/server/generated/typeStrings/Order.d.ts +1 -1
- package/server/generated/typeStrings/Order.d.ts.map +1 -1
- package/server/generated/typeStrings/Order.js.map +1 -1
- package/server/generated/typeStrings/Order.mjs +31 -278
- package/server/generated/typeStrings/Position.d.ts +1 -1
- package/server/generated/typeStrings/Position.d.ts.map +1 -1
- package/server/generated/typeStrings/Position.js.map +1 -1
- package/server/generated/typeStrings/Position.mjs +67 -114
- package/server/generated/typeStrings/Session.d.ts +1 -1
- package/server/generated/typeStrings/Session.d.ts.map +1 -1
- package/server/generated/typeStrings/Session.js.map +1 -1
- package/server/generated/typeStrings/Session.mjs +0 -211
- package/server/generated/typeStrings/Trade.d.ts +1 -1
- package/server/generated/typeStrings/Trade.d.ts.map +1 -1
- package/server/generated/typeStrings/Trade.js.map +1 -1
- package/server/generated/typeStrings/Trade.mjs +31 -278
- package/server/generated/typeStrings/User.d.ts +1 -1
- package/server/generated/typeStrings/User.d.ts.map +1 -1
- package/server/generated/typeStrings/User.js.map +1 -1
- package/server/generated/typeStrings/User.mjs +100 -222
- package/server/generated/typeStrings/index.d.ts +14 -14
@@ -16,8 +16,6 @@ export type AlpacaAccount = {
|
|
16
16
|
marketOpen: boolean;
|
17
17
|
// Relation to the User model who owns this Alpaca account.
|
18
18
|
user: User;
|
19
|
-
// Foreign key referencing the User.
|
20
|
-
userId: string;
|
21
19
|
// List of trades executed through this Alpaca account.
|
22
20
|
trades: Trade[];
|
23
21
|
// List of orders placed through this Alpaca account.
|
@@ -46,33 +44,19 @@ export enum SubscriptionPlan {
|
|
46
44
|
}
|
47
45
|
|
48
46
|
export type Customer = {
|
49
|
-
// Reference to the authenticated user associated with the customer.
|
50
|
-
authUserId: string;
|
51
47
|
// Name of the customer.
|
52
48
|
name?: string;
|
53
49
|
// Subscription plan the customer is enrolled in.
|
54
50
|
plan?: SubscriptionPlan;
|
55
|
-
// Unique Stripe customer ID for billing.
|
56
|
-
stripeCustomerId?: string;
|
57
|
-
// Unique Stripe subscription ID.
|
58
|
-
stripeSubscriptionId?: string;
|
59
|
-
// Stripe price ID associated with the customer's subscription.
|
60
|
-
stripePriceId?: string;
|
61
51
|
// End date of the current billing period in Stripe.
|
62
52
|
stripeCurrentPeriodEnd?: Date;
|
63
|
-
// List of users associated with the customer.
|
64
|
-
users: User[];
|
65
53
|
}
|
66
54
|
|
67
55
|
export type Account = {
|
68
|
-
// Reference to the user who owns this account.
|
69
|
-
userId: string;
|
70
56
|
// Type of the account (e.g., OAuth provider).
|
71
57
|
type: string;
|
72
58
|
// Provider of the account (e.g., Google, GitHub).
|
73
59
|
provider: string;
|
74
|
-
// Unique identifier provided by the external provider.
|
75
|
-
providerAccountId: string;
|
76
60
|
// Refresh token for the external account, if applicable.
|
77
61
|
refresh_token?: string;
|
78
62
|
// Access token for the external account, if applicable.
|
@@ -87,32 +71,22 @@ export type Account = {
|
|
87
71
|
id_token?: string;
|
88
72
|
// State of the session associated with the account.
|
89
73
|
session_state?: string;
|
90
|
-
// Relation to the User model.
|
91
|
-
user: User;
|
92
74
|
}
|
93
75
|
|
94
76
|
export type Session = {
|
95
77
|
// Token associated with the session for authentication.
|
96
78
|
sessionToken: string;
|
97
|
-
// Reference to the user who owns this session.
|
98
|
-
userId: string;
|
99
79
|
// Expiration date and time of the session.
|
100
80
|
expires: Date;
|
101
|
-
// Relation to the User model.
|
102
|
-
user: User;
|
103
81
|
}
|
104
82
|
|
105
83
|
export type Authenticator = {
|
106
|
-
// Reference to the user who owns this authenticator.
|
107
|
-
userId: string;
|
108
84
|
// Unique credential ID for the authenticator.
|
109
85
|
credentialID: string;
|
110
86
|
// Public key associated with the authenticator.
|
111
87
|
publicKey: string;
|
112
88
|
// Counter for the number of authentication attempts.
|
113
89
|
counter: number;
|
114
|
-
// Relation to the User model.
|
115
|
-
user: User;
|
116
90
|
}
|
117
91
|
|
118
92
|
export type User = {
|
@@ -134,8 +108,6 @@ export type User = {
|
|
134
108
|
currentAccount: AlpacaAccountType;
|
135
109
|
// Relation to the Customer model, if applicable.
|
136
110
|
customer?: Customer;
|
137
|
-
// Foreign key referencing the Customer.
|
138
|
-
customerId?: number;
|
139
111
|
// List of accounts associated with the user.
|
140
112
|
accounts: Account[];
|
141
113
|
// List of sessions associated with the user.
|
@@ -144,8 +116,6 @@ export type User = {
|
|
144
116
|
authenticators: Authenticator[];
|
145
117
|
// The subscription plan the user is enrolled in.
|
146
118
|
plan?: SubscriptionPlan;
|
147
|
-
// List of Alpaca accounts linked to the user.
|
148
|
-
alpacaAccounts: AlpacaAccount[];
|
149
119
|
}
|
150
120
|
|
151
121
|
export enum TradeStatus {
|
@@ -179,141 +149,6 @@ export enum AssetType {
|
|
179
149
|
OTHER = "OTHER"
|
180
150
|
}
|
181
151
|
|
182
|
-
export enum OrderSide {
|
183
|
-
BUY = "BUY",
|
184
|
-
SELL = "SELL"
|
185
|
-
}
|
186
|
-
|
187
|
-
export enum OrderType {
|
188
|
-
MARKET = "MARKET",
|
189
|
-
LIMIT = "LIMIT",
|
190
|
-
STOP = "STOP",
|
191
|
-
STOP_LIMIT = "STOP_LIMIT",
|
192
|
-
TRAILING_STOP = "TRAILING_STOP"
|
193
|
-
}
|
194
|
-
|
195
|
-
// Time in force enum (day, gtc, opg, cls, etc.).
|
196
|
-
export enum TimeInForce {
|
197
|
-
DAY = "DAY",
|
198
|
-
GTC = "GTC",
|
199
|
-
OPG = "OPG",
|
200
|
-
CLS = "CLS",
|
201
|
-
IOC = "IOC",
|
202
|
-
FOK = "FOK"
|
203
|
-
}
|
204
|
-
|
205
|
-
export enum OrderStatus {
|
206
|
-
NEW = "NEW",
|
207
|
-
PARTIALLY_FILLED = "PARTIALLY_FILLED",
|
208
|
-
FILLED = "FILLED",
|
209
|
-
CANCELED = "CANCELED",
|
210
|
-
REJECTED = "REJECTED",
|
211
|
-
EXPIRED = "EXPIRED"
|
212
|
-
}
|
213
|
-
|
214
|
-
export type Order = {
|
215
|
-
// Reference to the Alpaca account used for the order.
|
216
|
-
alpacaAccountId: string;
|
217
|
-
// Reference to the asset being ordered.
|
218
|
-
assetId: string;
|
219
|
-
// Quantity of the asset to be ordered.
|
220
|
-
qty?: number;
|
221
|
-
// Notional value of the order. Optional, used if qty is not provided.
|
222
|
-
notional?: number;
|
223
|
-
// Side of the order (BUY or SELL).
|
224
|
-
side: OrderSide;
|
225
|
-
// Type of order (market, limit, stop, stop_limit, trailing_stop).
|
226
|
-
type: OrderType;
|
227
|
-
// Time in force for the order (day, gtc, opg, cls, ioc, fok).
|
228
|
-
timeInForce: TimeInForce;
|
229
|
-
// Limit price for limit or stop-limit orders.
|
230
|
-
limitPrice?: number;
|
231
|
-
// Stop price for stop or stop-limit orders.
|
232
|
-
stopPrice?: number;
|
233
|
-
// Trailing price for trailing stop orders.
|
234
|
-
trailPrice?: number;
|
235
|
-
// Trailing percent for trailing stop orders.
|
236
|
-
trailPercent?: number;
|
237
|
-
// Whether the order is eligible for extended hours.
|
238
|
-
extendedHours?: boolean;
|
239
|
-
// Client-supplied identifier for the order.
|
240
|
-
clientOrderId?: string;
|
241
|
-
// Current status of the order.
|
242
|
-
status: OrderStatus;
|
243
|
-
// Timestamp when the order was submitted.
|
244
|
-
submittedAt?: Date;
|
245
|
-
// Timestamp when the order was filled.
|
246
|
-
filledAt?: Date;
|
247
|
-
// Average price at which the order was filled.
|
248
|
-
filledAvgPrice?: number;
|
249
|
-
// Reference to the action associated with the order.
|
250
|
-
actionId: string;
|
251
|
-
// The Alpaca account this order is associated with.
|
252
|
-
alpacaAccount: AlpacaAccount;
|
253
|
-
// The action this order is associated with.
|
254
|
-
action: Action;
|
255
|
-
// The asset this order is for.
|
256
|
-
asset: Asset;
|
257
|
-
// Fee associated with the order.
|
258
|
-
fee?: number;
|
259
|
-
}
|
260
|
-
|
261
|
-
export type Position = {
|
262
|
-
// Reference to the associated asset.
|
263
|
-
assetId: string;
|
264
|
-
// Relation to the Asset model.
|
265
|
-
asset: Asset;
|
266
|
-
// The average price at which the asset was acquired.
|
267
|
-
averageEntryPrice: number;
|
268
|
-
// Total quantity of the asset held.
|
269
|
-
qty: number;
|
270
|
-
// Quantity of the asset available for trading.
|
271
|
-
qtyAvailable: number;
|
272
|
-
// Current market value of the position.
|
273
|
-
marketValue: number;
|
274
|
-
// Total cost basis of the position.
|
275
|
-
costBasis: number;
|
276
|
-
// Unrealized profit or loss of the position.
|
277
|
-
unrealizedPL: number;
|
278
|
-
// Unrealized profit or loss as a percentage.
|
279
|
-
unrealizedPLPC: number;
|
280
|
-
// Unrealized intraday profit or loss.
|
281
|
-
unrealisedIntradayPL: number;
|
282
|
-
// Unrealized intraday profit or loss as a percentage.
|
283
|
-
unrealisedIntradayPLPC: number;
|
284
|
-
// Current price of the asset.
|
285
|
-
currentPrice: number;
|
286
|
-
// Last traded price of the asset.
|
287
|
-
lastTradePrice: number;
|
288
|
-
// Price change of the asset for the day.
|
289
|
-
changeToday: number;
|
290
|
-
// Indicates if the asset is marginable.
|
291
|
-
assetMarginable: boolean;
|
292
|
-
// Relation to the AlpacaAccount model, if applicable.
|
293
|
-
alpacaAccount?: AlpacaAccount;
|
294
|
-
// Foreign key referencing the AlpacaAccount.
|
295
|
-
alpacaAccountId: string;
|
296
|
-
}
|
297
|
-
|
298
|
-
export type NewsArticleAssetSentiment = {
|
299
|
-
// Reference to the associated asset.
|
300
|
-
assetId: string;
|
301
|
-
// Reference to the associated news article.
|
302
|
-
newsArticleId: string;
|
303
|
-
// URL of the news article, must be unique.
|
304
|
-
url: string;
|
305
|
-
// Relation to the NewsArticle model.
|
306
|
-
news: NewsArticle;
|
307
|
-
// Relation to the Asset model.
|
308
|
-
asset: Asset;
|
309
|
-
// Relevancy score indicating how relevant the news is to the asset.
|
310
|
-
relevancyScore?: string;
|
311
|
-
// Sentiment score derived from the news content.
|
312
|
-
sentimentScore?: string;
|
313
|
-
// Label indicating the overall sentiment (e.g., Positive, Negative, Neutral).
|
314
|
-
sentimentLabel?: string;
|
315
|
-
}
|
316
|
-
|
317
152
|
export type Asset = {
|
318
153
|
// Ticker symbol of the asset, must be unique.
|
319
154
|
symbol: string;
|
@@ -425,8 +260,6 @@ export type Asset = {
|
|
425
260
|
sellPrice?: string;
|
426
261
|
// Last buy price of the asset.
|
427
262
|
buyPrice?: string;
|
428
|
-
// List of trades involving this asset.
|
429
|
-
trades: Trade[];
|
430
263
|
// List of orders involving this asset.
|
431
264
|
orders: Order[];
|
432
265
|
// List of positions involving this asset.
|
@@ -440,11 +273,38 @@ export enum OptionContractType {
|
|
440
273
|
PUT = "PUT"
|
441
274
|
}
|
442
275
|
|
276
|
+
export enum ActionType {
|
277
|
+
BUY = "BUY",
|
278
|
+
GET_OPTION_CONTRACTS = "GET_OPTION_CONTRACTS",
|
279
|
+
EXERCISE_OPTION = "EXERCISE_OPTION",
|
280
|
+
SELL = "SELL",
|
281
|
+
CANCEL = "CANCEL",
|
282
|
+
ADJUST = "ADJUST",
|
283
|
+
HEDGE = "HEDGE"
|
284
|
+
}
|
285
|
+
|
286
|
+
export enum ActionStatus {
|
287
|
+
STAGED = "STAGED",
|
288
|
+
EXECUTED = "EXECUTED",
|
289
|
+
COMPLETED = "COMPLETED"
|
290
|
+
}
|
291
|
+
|
292
|
+
export type Action = {
|
293
|
+
// Sequence number of the action within the trade.
|
294
|
+
sequence: number;
|
295
|
+
// Type of trade action, defined by ActionType enum.
|
296
|
+
type: ActionType;
|
297
|
+
// Additional notes or comments about the action.
|
298
|
+
note: string;
|
299
|
+
// Current status of the trade action.
|
300
|
+
status: ActionStatus;
|
301
|
+
// Fees associated with the action.
|
302
|
+
fee?: number;
|
303
|
+
// The order associated with this action.
|
304
|
+
order?: Order;
|
305
|
+
}
|
306
|
+
|
443
307
|
export type Trade = {
|
444
|
-
// Reference to the Alpaca account used for the trade.
|
445
|
-
alpacaAccountId: string;
|
446
|
-
// Reference to the asset being traded.
|
447
|
-
assetId: string;
|
448
308
|
// Quantity of the asset being traded.
|
449
309
|
qty: number;
|
450
310
|
// Price at which the asset was traded.
|
@@ -463,8 +323,6 @@ export type Trade = {
|
|
463
323
|
timestamp: Date;
|
464
324
|
// Current status of the trade.
|
465
325
|
status: TradeStatus;
|
466
|
-
// Relation to the AlpacaAccount model.
|
467
|
-
alpacaAccount: AlpacaAccount;
|
468
326
|
// Relation to the Asset model.
|
469
327
|
asset: Asset;
|
470
328
|
// If the asset.type is OPTION, then provide type of contract (CALL or PUT).
|
@@ -481,16 +339,12 @@ export enum AlertType {
|
|
481
339
|
}
|
482
340
|
|
483
341
|
export type Alert = {
|
484
|
-
// Reference to the Alpaca account associated with the alert.
|
485
|
-
alpacaAccountId: string;
|
486
342
|
// Message content of the alert.
|
487
343
|
message: string;
|
488
344
|
// Type of the alert, defined by AlertType enum.
|
489
345
|
type: AlertType;
|
490
346
|
// Indicates whether the alert has been read by the user.
|
491
347
|
isRead: boolean;
|
492
|
-
// Relation to the AlpacaAccount model.
|
493
|
-
alpacaAccount: AlpacaAccount;
|
494
348
|
}
|
495
349
|
|
496
350
|
`;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const AssetTypeString = "\nYour response should adhere to the following type definition for the \"Asset\" type, and its nested object types (which include 'Trade', 'Order', 'Position', 'NewsArticleAssetSentiment' types), as well as any ENUMS used by it (which include 'AssetType' enum).\n\nImportantly, DO NOT include any annotations in your response (i.e. remove the ones we have provided for your reference below).\n\nexport type Asset = {\n // Ticker symbol of the asset, must be unique.\n symbol: string;\n // Full name of the asset, must be unique.\n name: string;\n // Type of the asset, defined by AssetType enum.\n type: AssetType;\n // URL to the asset's logo image.\n logoUrl?: string;\n // Description of the asset.\n description?: string;\n // Central Index Key for the asset.\n cik?: string;\n // Stock exchange where the asset is listed.\n exchange?: string;\n // Currency in which the asset is traded.\n currency?: string;\n // Country where the asset is based.\n country?: string;\n // Sector classification of the asset.\n sector?: string;\n // Industry classification of the asset.\n industry?: string;\n // Physical address associated with the asset.\n address?: string;\n // Official website of the asset.\n officialSite?: string;\n // Fiscal year-end date of the asset.\n fiscalYearEnd?: string;\n // Date of the latest financial quarter.\n latestQuarter?: string;\n // Market capitalization of the asset.\n marketCapitalization?: string;\n // Earnings Before Interest, Taxes, Depreciation, and Amortization.\n ebitda?: string;\n // Price-to-Earnings ratio.\n peRatio?: string;\n // Price/Earnings to Growth ratio.\n pegRatio?: string;\n // Book value per share.\n bookValue?: string;\n // Dividend per share.\n dividendPerShare?: string;\n // Dividend yield percentage.\n dividendYield?: string;\n // Earnings per share.\n eps?: string;\n // Revenue per share over the trailing twelve months.\n revenuePerShareTTM?: string;\n // Profit margin percentage.\n profitMargin?: string;\n // Operating margin over the trailing twelve months.\n operatingMarginTTM?: string;\n // Return on assets over the trailing twelve months.\n returnOnAssetsTTM?: string;\n // Return on equity over the trailing twelve months.\n returnOnEquityTTM?: string;\n // Total revenue over the trailing twelve months.\n revenueTTM?: string;\n // Gross profit over the trailing twelve months.\n grossProfitTTM?: string;\n // Diluted earnings per share over the trailing twelve months.\n dilutedEPSTTM?: string;\n // Year-over-year growth in quarterly earnings.\n quarterlyEarningsGrowthYOY?: string;\n // Year-over-year growth in quarterly revenue.\n quarterlyRevenueGrowthYOY?: string;\n // Analyst target price for the asset.\n analystTargetPrice?: string;\n // Percentage of analysts rating the asset as Strong Buy.\n analystRatingStrongBuy?: string;\n // Percentage of analysts rating the asset as Buy.\n analystRatingBuy?: string;\n // Percentage of analysts rating the asset as Hold.\n analystRatingHold?: string;\n // Percentage of analysts rating the asset as Sell.\n analystRatingSell?: string;\n // Percentage of analysts rating the asset as Strong Sell.\n analystRatingStrongSell?: string;\n // Trailing Price-to-Earnings ratio.\n trailingPE?: string;\n // Forward Price-to-Earnings ratio.\n forwardPE?: string;\n // Price-to-Sales ratio over the trailing twelve months.\n priceToSalesRatioTTM?: string;\n // Price-to-Book ratio.\n priceToBookRatio?: string;\n // Enterprise Value to Revenue ratio.\n evToRevenue?: string;\n // Enterprise Value to EBITDA ratio.\n evToEbitda?: string;\n // Beta coefficient measuring volatility.\n beta?: string;\n // 52-week high price of the asset.\n week52High?: string;\n // 52-week low price of the asset.\n week52Low?: string;\n // 50-day moving average price.\n day50MovingAverage?: string;\n // 200-day moving average price.\n day200MovingAverage?: string;\n // Total number of shares outstanding.\n sharesOutstanding?: string;\n // Date when the next dividend is paid.\n dividendDate?: string;\n // Date when the asset goes ex-dividend.\n exDividendDate?: string;\n // Last sell price of the asset.\n sellPrice?: string;\n // Last buy price of the asset.\n buyPrice?: string;\n // List of trades involving this asset.\n trades: Trade[];\n // List of orders involving this asset.\n orders: Order[];\n // List of positions involving this asset.\n positions: Position[];\n // List of news article sentiments related to this asset.\n newsMentions: NewsArticleAssetSentiment[];\n}\n\nexport enum AssetType {\n STOCK = \"STOCK\",\n ETF = \"ETF\",\n MUTUAL_FUND = \"MUTUAL_FUND\",\n CRYPTOCURRENCY = \"CRYPTOCURRENCY\",\n INDEX = \"INDEX\",\n COMMODITY = \"COMMODITY\",\n CURRENCY = \"CURRENCY\",\n OPTION = \"OPTION\",\n FUTURE = \"FUTURE\",\n BOND = \"BOND\",\n WARRANT = \"WARRANT\",\n ADR = \"ADR\",\n GDR = \"GDR\",\n UNIT = \"UNIT\",\n RIGHT = \"RIGHT\",\n REIT = \"REIT\",\n STRUCTURED_PRODUCT = \"STRUCTURED_PRODUCT\",\n SWAP = \"SWAP\",\n SPOT = \"SPOT\",\n FORWARD = \"FORWARD\",\n OTHER = \"OTHER\"\n}\n\nexport enum TradeStatus {\n PENDING = \"PENDING\",\n OPEN = \"OPEN\",\n PARTIAL = \"PARTIAL\",\n COMPLETED = \"COMPLETED\"\n}\n\nexport enum AlpacaAccountType {\n PAPER = \"PAPER\",\n LIVE = \"LIVE\"\n}\n\nexport enum UserRole {\n OWNER = \"OWNER\",\n ADMIN = \"ADMIN\",\n USER = \"USER\"\n}\n\nexport enum SubscriptionPlan {\n FREE = \"FREE\",\n PRO = \"PRO\",\n BUSINESS = \"BUSINESS\"\n}\n\nexport type User = {\n // The user's full name.\n name?: string;\n // The user's email address, must be unique.\n email?: string;\n // Timestamp when the user's email was verified.\n emailVerified?: Date;\n // URL to the user's profile image.\n image?: string;\n // The role assigned to the user, determining permissions.\n role: UserRole;\n // A short biography or description of the user.\n bio?: string;\n // The user's job title or position.\n jobTitle?: string;\n // The type of Alpaca account the user currently holds.\n currentAccount: AlpacaAccountType;\n // Relation to the Customer model, if applicable.\n customer?: Customer;\n // Foreign key referencing the Customer.\n customerId?: number;\n // List of accounts associated with the user.\n accounts: Account[];\n // List of sessions associated with the user.\n sessions: Session[];\n // List of authenticators for the user.\n authenticators: Authenticator[];\n // The subscription plan the user is enrolled in.\n plan?: SubscriptionPlan;\n // List of Alpaca accounts linked to the user.\n alpacaAccounts: AlpacaAccount[];\n}\n\nexport enum OrderSide {\n BUY = \"BUY\",\n SELL = \"SELL\"\n}\n\nexport enum OrderType {\n MARKET = \"MARKET\",\n LIMIT = \"LIMIT\",\n STOP = \"STOP\",\n STOP_LIMIT = \"STOP_LIMIT\",\n TRAILING_STOP = \"TRAILING_STOP\"\n}\n\n// Time in force enum (day, gtc, opg, cls, etc.).\nexport enum TimeInForce {\n DAY = \"DAY\",\n GTC = \"GTC\",\n OPG = \"OPG\",\n CLS = \"CLS\",\n IOC = \"IOC\",\n FOK = \"FOK\"\n}\n\nexport enum OrderStatus {\n NEW = \"NEW\",\n PARTIALLY_FILLED = \"PARTIALLY_FILLED\",\n FILLED = \"FILLED\",\n CANCELED = \"CANCELED\",\n REJECTED = \"REJECTED\",\n EXPIRED = \"EXPIRED\"\n}\n\nexport type Order = {\n // Reference to the Alpaca account used for the order.\n alpacaAccountId: string;\n // Reference to the asset being ordered.\n assetId: string;\n // Quantity of the asset to be ordered.\n qty?: number;\n // Notional value of the order. Optional, used if qty is not provided.\n notional?: number;\n // Side of the order (BUY or SELL).\n side: OrderSide;\n // Type of order (market, limit, stop, stop_limit, trailing_stop).\n type: OrderType;\n // Time in force for the order (day, gtc, opg, cls, ioc, fok).\n timeInForce: TimeInForce;\n // Limit price for limit or stop-limit orders.\n limitPrice?: number;\n // Stop price for stop or stop-limit orders.\n stopPrice?: number;\n // Trailing price for trailing stop orders.\n trailPrice?: number;\n // Trailing percent for trailing stop orders.\n trailPercent?: number;\n // Whether the order is eligible for extended hours.\n extendedHours?: boolean;\n // Client-supplied identifier for the order.\n clientOrderId?: string;\n // Current status of the order.\n status: OrderStatus;\n // Timestamp when the order was submitted.\n submittedAt?: Date;\n // Timestamp when the order was filled.\n filledAt?: Date;\n // Average price at which the order was filled.\n filledAvgPrice?: number;\n // Reference to the action associated with the order.\n actionId: string;\n // The Alpaca account this order is associated with.\n alpacaAccount: AlpacaAccount;\n // The action this order is associated with.\n action: Action;\n // The asset this order is for.\n asset: Asset;\n // Fee associated with the order.\n fee?: number;\n}\n\nexport type Position = {\n // Reference to the associated asset.\n assetId: string;\n // Relation to the Asset model.\n asset: Asset;\n // The average price at which the asset was acquired.\n averageEntryPrice: number;\n // Total quantity of the asset held.\n qty: number;\n // Quantity of the asset available for trading.\n qtyAvailable: number;\n // Current market value of the position.\n marketValue: number;\n // Total cost basis of the position.\n costBasis: number;\n // Unrealized profit or loss of the position.\n unrealizedPL: number;\n // Unrealized profit or loss as a percentage.\n unrealizedPLPC: number;\n // Unrealized intraday profit or loss.\n unrealisedIntradayPL: number;\n // Unrealized intraday profit or loss as a percentage.\n unrealisedIntradayPLPC: number;\n // Current price of the asset.\n currentPrice: number;\n // Last traded price of the asset.\n lastTradePrice: number;\n // Price change of the asset for the day.\n changeToday: number;\n // Indicates if the asset is marginable.\n assetMarginable: boolean;\n // Relation to the AlpacaAccount model, if applicable.\n alpacaAccount?: AlpacaAccount;\n // Foreign key referencing the AlpacaAccount.\n alpacaAccountId: string;\n}\n\nexport enum AlertType {\n SUCCESS = \"SUCCESS\",\n WARNING = \"WARNING\",\n ERROR = \"ERROR\",\n INFO = \"INFO\"\n}\n\nexport type Alert = {\n // Reference to the Alpaca account associated with the alert.\n alpacaAccountId: string;\n // Message content of the alert.\n message: string;\n // Type of the alert, defined by AlertType enum.\n type: AlertType;\n // Indicates whether the alert has been read by the user.\n isRead: boolean;\n // Relation to the AlpacaAccount model.\n alpacaAccount: AlpacaAccount;\n}\n\nexport type AlpacaAccount = {\n // The type of Alpaca account (PAPER or LIVE).\n type: AlpacaAccountType;\n // API key for authenticating requests to Alpaca.\n APIKey: string;\n // API secret for authenticating requests to Alpaca.\n APISecret: string;\n // JSON configuration settings for the Alpaca account.\n configuration?: any;\n // Indicates whether the market is currently open for trading.\n marketOpen: boolean;\n // Relation to the User model who owns this Alpaca account.\n user: User;\n // Foreign key referencing the User.\n userId: string;\n // List of trades executed through this Alpaca account.\n trades: Trade[];\n // List of orders placed through this Alpaca account.\n orders: Order[];\n // List of positions held in this Alpaca account.\n positions: Position[];\n // List of alerts generated for this Alpaca account.\n alerts: Alert[];\n}\n\nexport enum OptionContractType {\n CALL = \"CALL\",\n PUT = \"PUT\"\n}\n\nexport type Trade = {\n // Reference to the Alpaca account used for the trade.\n alpacaAccountId: string;\n // Reference to the asset being traded.\n assetId: string;\n // Quantity of the asset being traded.\n qty: number;\n // Price at which the asset was traded.\n price: number;\n // Total value of the trade (qty * price).\n total: number;\n // Signal that triggered the trade.\n signal: string;\n // Strategy used to execute the trade.\n strategy: string;\n // Analysis supporting the trade decision.\n analysis: string;\n // Confidence level in the trade decision.\n confidence: number;\n // Timestamp when the trade was executed.\n timestamp: Date;\n // Current status of the trade.\n status: TradeStatus;\n // Relation to the AlpacaAccount model.\n alpacaAccount: AlpacaAccount;\n // Relation to the Asset model.\n asset: Asset;\n // If the asset.type is OPTION, then provide type of contract (CALL or PUT).\n optionContractType?: OptionContractType;\n // List of actions associated with this trade.\n actions: Action[];\n}\n\nexport type NewsArticle = {\n // Title of the news article.\n title: string;\n // Full content of the news article.\n content?: string;\n // Source of the news article (e.g., Bloomberg, Reuters).\n source: string;\n // Domain of the source website.\n sourceDomain?: string;\n // URL to the original news article, must be unique.\n url: string;\n // Sentiment analysis result of the article.\n sentiment: string;\n // List of authors who wrote the article.\n authors: string[];\n // Summary or abstract of the news article.\n summary?: string;\n // URL to the banner image of the article.\n bannerImage?: string;\n // Publication time of the article.\n timePublished: string;\n // Category or genre of the news article.\n category?: string;\n // Topics covered in the news article.\n topics: string[];\n // URL to the logo image of the news source.\n logo?: string;\n // List of asset sentiments associated with this news article.\n assets: NewsArticleAssetSentiment[];\n}\n\nexport type NewsArticleAssetSentiment = {\n // Reference to the associated asset.\n assetId: string;\n // Reference to the associated news article.\n newsArticleId: string;\n // URL of the news article, must be unique.\n url: string;\n // Relation to the NewsArticle model.\n news: NewsArticle;\n // Relation to the Asset model.\n asset: Asset;\n // Relevancy score indicating how relevant the news is to the asset.\n relevancyScore?: string;\n // Sentiment score derived from the news content.\n sentimentScore?: string;\n // Label indicating the overall sentiment (e.g., Positive, Negative, Neutral).\n sentimentLabel?: string;\n}\n\n";
|
1
|
+
export declare const AssetTypeString = "\nYour response should adhere to the following type definition for the \"Asset\" type, and its nested object types (which include 'Trade', 'Order', 'Position', 'NewsArticleAssetSentiment' types), as well as any ENUMS used by it (which include 'AssetType' enum).\n\nImportantly, DO NOT include any annotations in your response (i.e. remove the ones we have provided for your reference below).\n\nexport type Asset = {\n // Ticker symbol of the asset, must be unique.\n symbol: string;\n // Full name of the asset, must be unique.\n name: string;\n // Type of the asset, defined by AssetType enum.\n type: AssetType;\n // URL to the asset's logo image.\n logoUrl?: string;\n // Description of the asset.\n description?: string;\n // Central Index Key for the asset.\n cik?: string;\n // Stock exchange where the asset is listed.\n exchange?: string;\n // Currency in which the asset is traded.\n currency?: string;\n // Country where the asset is based.\n country?: string;\n // Sector classification of the asset.\n sector?: string;\n // Industry classification of the asset.\n industry?: string;\n // Physical address associated with the asset.\n address?: string;\n // Official website of the asset.\n officialSite?: string;\n // Fiscal year-end date of the asset.\n fiscalYearEnd?: string;\n // Date of the latest financial quarter.\n latestQuarter?: string;\n // Market capitalization of the asset.\n marketCapitalization?: string;\n // Earnings Before Interest, Taxes, Depreciation, and Amortization.\n ebitda?: string;\n // Price-to-Earnings ratio.\n peRatio?: string;\n // Price/Earnings to Growth ratio.\n pegRatio?: string;\n // Book value per share.\n bookValue?: string;\n // Dividend per share.\n dividendPerShare?: string;\n // Dividend yield percentage.\n dividendYield?: string;\n // Earnings per share.\n eps?: string;\n // Revenue per share over the trailing twelve months.\n revenuePerShareTTM?: string;\n // Profit margin percentage.\n profitMargin?: string;\n // Operating margin over the trailing twelve months.\n operatingMarginTTM?: string;\n // Return on assets over the trailing twelve months.\n returnOnAssetsTTM?: string;\n // Return on equity over the trailing twelve months.\n returnOnEquityTTM?: string;\n // Total revenue over the trailing twelve months.\n revenueTTM?: string;\n // Gross profit over the trailing twelve months.\n grossProfitTTM?: string;\n // Diluted earnings per share over the trailing twelve months.\n dilutedEPSTTM?: string;\n // Year-over-year growth in quarterly earnings.\n quarterlyEarningsGrowthYOY?: string;\n // Year-over-year growth in quarterly revenue.\n quarterlyRevenueGrowthYOY?: string;\n // Analyst target price for the asset.\n analystTargetPrice?: string;\n // Percentage of analysts rating the asset as Strong Buy.\n analystRatingStrongBuy?: string;\n // Percentage of analysts rating the asset as Buy.\n analystRatingBuy?: string;\n // Percentage of analysts rating the asset as Hold.\n analystRatingHold?: string;\n // Percentage of analysts rating the asset as Sell.\n analystRatingSell?: string;\n // Percentage of analysts rating the asset as Strong Sell.\n analystRatingStrongSell?: string;\n // Trailing Price-to-Earnings ratio.\n trailingPE?: string;\n // Forward Price-to-Earnings ratio.\n forwardPE?: string;\n // Price-to-Sales ratio over the trailing twelve months.\n priceToSalesRatioTTM?: string;\n // Price-to-Book ratio.\n priceToBookRatio?: string;\n // Enterprise Value to Revenue ratio.\n evToRevenue?: string;\n // Enterprise Value to EBITDA ratio.\n evToEbitda?: string;\n // Beta coefficient measuring volatility.\n beta?: string;\n // 52-week high price of the asset.\n week52High?: string;\n // 52-week low price of the asset.\n week52Low?: string;\n // 50-day moving average price.\n day50MovingAverage?: string;\n // 200-day moving average price.\n day200MovingAverage?: string;\n // Total number of shares outstanding.\n sharesOutstanding?: string;\n // Date when the next dividend is paid.\n dividendDate?: string;\n // Date when the asset goes ex-dividend.\n exDividendDate?: string;\n // Last sell price of the asset.\n sellPrice?: string;\n // Last buy price of the asset.\n buyPrice?: string;\n // List of trades involving this asset.\n trades: Trade[];\n // List of orders involving this asset.\n orders: Order[];\n // List of positions involving this asset.\n positions: Position[];\n // List of news article sentiments related to this asset.\n newsMentions: NewsArticleAssetSentiment[];\n}\n\nexport enum AssetType {\n STOCK = \"STOCK\",\n ETF = \"ETF\",\n MUTUAL_FUND = \"MUTUAL_FUND\",\n CRYPTOCURRENCY = \"CRYPTOCURRENCY\",\n INDEX = \"INDEX\",\n COMMODITY = \"COMMODITY\",\n CURRENCY = \"CURRENCY\",\n OPTION = \"OPTION\",\n FUTURE = \"FUTURE\",\n BOND = \"BOND\",\n WARRANT = \"WARRANT\",\n ADR = \"ADR\",\n GDR = \"GDR\",\n UNIT = \"UNIT\",\n RIGHT = \"RIGHT\",\n REIT = \"REIT\",\n STRUCTURED_PRODUCT = \"STRUCTURED_PRODUCT\",\n SWAP = \"SWAP\",\n SPOT = \"SPOT\",\n FORWARD = \"FORWARD\",\n OTHER = \"OTHER\"\n}\n\nexport enum TradeStatus {\n PENDING = \"PENDING\",\n OPEN = \"OPEN\",\n PARTIAL = \"PARTIAL\",\n COMPLETED = \"COMPLETED\"\n}\n\nexport enum AlpacaAccountType {\n PAPER = \"PAPER\",\n LIVE = \"LIVE\"\n}\n\nexport type AlpacaAccount = {\n // The type of Alpaca account (PAPER or LIVE).\n type: AlpacaAccountType;\n // API key for authenticating requests to Alpaca.\n APIKey: string;\n // API secret for authenticating requests to Alpaca.\n APISecret: string;\n // JSON configuration settings for the Alpaca account.\n configuration?: any;\n // Indicates whether the market is currently open for trading.\n marketOpen: boolean;\n // Relation to the User model who owns this Alpaca account.\n user: User;\n // List of orders placed through this Alpaca account.\n orders: Order[];\n // List of positions held in this Alpaca account.\n positions: Position[];\n // List of alerts generated for this Alpaca account.\n alerts: Alert[];\n}\n\nexport enum OptionContractType {\n CALL = \"CALL\",\n PUT = \"PUT\"\n}\n\nexport enum ActionType {\n BUY = \"BUY\",\n GET_OPTION_CONTRACTS = \"GET_OPTION_CONTRACTS\",\n EXERCISE_OPTION = \"EXERCISE_OPTION\",\n SELL = \"SELL\",\n CANCEL = \"CANCEL\",\n ADJUST = \"ADJUST\",\n HEDGE = \"HEDGE\"\n}\n\nexport enum ActionStatus {\n STAGED = \"STAGED\",\n EXECUTED = \"EXECUTED\",\n COMPLETED = \"COMPLETED\"\n}\n\nexport type Action = {\n // Sequence number of the action within the trade.\n sequence: number;\n // Type of trade action, defined by ActionType enum.\n type: ActionType;\n // Additional notes or comments about the action.\n note: string;\n // Current status of the trade action.\n status: ActionStatus;\n // Fees associated with the action.\n fee?: number;\n // The order associated with this action.\n order?: Order;\n}\n\nexport type Trade = {\n // Quantity of the asset being traded.\n qty: number;\n // Price at which the asset was traded.\n price: number;\n // Total value of the trade (qty * price).\n total: number;\n // Signal that triggered the trade.\n signal: string;\n // Strategy used to execute the trade.\n strategy: string;\n // Analysis supporting the trade decision.\n analysis: string;\n // Confidence level in the trade decision.\n confidence: number;\n // Timestamp when the trade was executed.\n timestamp: Date;\n // Current status of the trade.\n status: TradeStatus;\n // Relation to the AlpacaAccount model.\n alpacaAccount: AlpacaAccount;\n // If the asset.type is OPTION, then provide type of contract (CALL or PUT).\n optionContractType?: OptionContractType;\n // List of actions associated with this trade.\n actions: Action[];\n}\n\nexport type NewsArticle = {\n // Title of the news article.\n title: string;\n // Full content of the news article.\n content?: string;\n // Source of the news article (e.g., Bloomberg, Reuters).\n source: string;\n // Domain of the source website.\n sourceDomain?: string;\n // URL to the original news article, must be unique.\n url: string;\n // Sentiment analysis result of the article.\n sentiment: string;\n // List of authors who wrote the article.\n authors: string[];\n // Summary or abstract of the news article.\n summary?: string;\n // URL to the banner image of the article.\n bannerImage?: string;\n // Publication time of the article.\n timePublished: string;\n // Category or genre of the news article.\n category?: string;\n // Topics covered in the news article.\n topics: string[];\n // URL to the logo image of the news source.\n logo?: string;\n}\n\nexport type NewsArticleAssetSentiment = {\n // URL of the news article, must be unique.\n url: string;\n // Relation to the NewsArticle model.\n news: NewsArticle;\n // Relevancy score indicating how relevant the news is to the asset.\n relevancyScore?: string;\n // Sentiment score derived from the news content.\n sentimentScore?: string;\n // Label indicating the overall sentiment (e.g., Positive, Negative, Neutral).\n sentimentLabel?: string;\n}\n\n";
|
2
2
|
//# sourceMappingURL=Asset.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Asset.d.ts","sourceRoot":"","sources":["../../../../src/generated/typeStrings/Asset.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,
|
1
|
+
{"version":3,"file":"Asset.d.ts","sourceRoot":"","sources":["../../../../src/generated/typeStrings/Asset.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,+/RAgS3B,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Asset.js","sourceRoot":"","sources":["../../../../src/generated/typeStrings/Asset.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG
|
1
|
+
{"version":3,"file":"Asset.js","sourceRoot":"","sources":["../../../../src/generated/typeStrings/Asset.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgS9B,CAAC"}
|
@@ -160,187 +160,6 @@ export enum AlpacaAccountType {
|
|
160
160
|
LIVE = "LIVE"
|
161
161
|
}
|
162
162
|
|
163
|
-
export enum UserRole {
|
164
|
-
OWNER = "OWNER",
|
165
|
-
ADMIN = "ADMIN",
|
166
|
-
USER = "USER"
|
167
|
-
}
|
168
|
-
|
169
|
-
export enum SubscriptionPlan {
|
170
|
-
FREE = "FREE",
|
171
|
-
PRO = "PRO",
|
172
|
-
BUSINESS = "BUSINESS"
|
173
|
-
}
|
174
|
-
|
175
|
-
export type User = {
|
176
|
-
// The user's full name.
|
177
|
-
name?: string;
|
178
|
-
// The user's email address, must be unique.
|
179
|
-
email?: string;
|
180
|
-
// Timestamp when the user's email was verified.
|
181
|
-
emailVerified?: Date;
|
182
|
-
// URL to the user's profile image.
|
183
|
-
image?: string;
|
184
|
-
// The role assigned to the user, determining permissions.
|
185
|
-
role: UserRole;
|
186
|
-
// A short biography or description of the user.
|
187
|
-
bio?: string;
|
188
|
-
// The user's job title or position.
|
189
|
-
jobTitle?: string;
|
190
|
-
// The type of Alpaca account the user currently holds.
|
191
|
-
currentAccount: AlpacaAccountType;
|
192
|
-
// Relation to the Customer model, if applicable.
|
193
|
-
customer?: Customer;
|
194
|
-
// Foreign key referencing the Customer.
|
195
|
-
customerId?: number;
|
196
|
-
// List of accounts associated with the user.
|
197
|
-
accounts: Account[];
|
198
|
-
// List of sessions associated with the user.
|
199
|
-
sessions: Session[];
|
200
|
-
// List of authenticators for the user.
|
201
|
-
authenticators: Authenticator[];
|
202
|
-
// The subscription plan the user is enrolled in.
|
203
|
-
plan?: SubscriptionPlan;
|
204
|
-
// List of Alpaca accounts linked to the user.
|
205
|
-
alpacaAccounts: AlpacaAccount[];
|
206
|
-
}
|
207
|
-
|
208
|
-
export enum OrderSide {
|
209
|
-
BUY = "BUY",
|
210
|
-
SELL = "SELL"
|
211
|
-
}
|
212
|
-
|
213
|
-
export enum OrderType {
|
214
|
-
MARKET = "MARKET",
|
215
|
-
LIMIT = "LIMIT",
|
216
|
-
STOP = "STOP",
|
217
|
-
STOP_LIMIT = "STOP_LIMIT",
|
218
|
-
TRAILING_STOP = "TRAILING_STOP"
|
219
|
-
}
|
220
|
-
|
221
|
-
// Time in force enum (day, gtc, opg, cls, etc.).
|
222
|
-
export enum TimeInForce {
|
223
|
-
DAY = "DAY",
|
224
|
-
GTC = "GTC",
|
225
|
-
OPG = "OPG",
|
226
|
-
CLS = "CLS",
|
227
|
-
IOC = "IOC",
|
228
|
-
FOK = "FOK"
|
229
|
-
}
|
230
|
-
|
231
|
-
export enum OrderStatus {
|
232
|
-
NEW = "NEW",
|
233
|
-
PARTIALLY_FILLED = "PARTIALLY_FILLED",
|
234
|
-
FILLED = "FILLED",
|
235
|
-
CANCELED = "CANCELED",
|
236
|
-
REJECTED = "REJECTED",
|
237
|
-
EXPIRED = "EXPIRED"
|
238
|
-
}
|
239
|
-
|
240
|
-
export type Order = {
|
241
|
-
// Reference to the Alpaca account used for the order.
|
242
|
-
alpacaAccountId: string;
|
243
|
-
// Reference to the asset being ordered.
|
244
|
-
assetId: string;
|
245
|
-
// Quantity of the asset to be ordered.
|
246
|
-
qty?: number;
|
247
|
-
// Notional value of the order. Optional, used if qty is not provided.
|
248
|
-
notional?: number;
|
249
|
-
// Side of the order (BUY or SELL).
|
250
|
-
side: OrderSide;
|
251
|
-
// Type of order (market, limit, stop, stop_limit, trailing_stop).
|
252
|
-
type: OrderType;
|
253
|
-
// Time in force for the order (day, gtc, opg, cls, ioc, fok).
|
254
|
-
timeInForce: TimeInForce;
|
255
|
-
// Limit price for limit or stop-limit orders.
|
256
|
-
limitPrice?: number;
|
257
|
-
// Stop price for stop or stop-limit orders.
|
258
|
-
stopPrice?: number;
|
259
|
-
// Trailing price for trailing stop orders.
|
260
|
-
trailPrice?: number;
|
261
|
-
// Trailing percent for trailing stop orders.
|
262
|
-
trailPercent?: number;
|
263
|
-
// Whether the order is eligible for extended hours.
|
264
|
-
extendedHours?: boolean;
|
265
|
-
// Client-supplied identifier for the order.
|
266
|
-
clientOrderId?: string;
|
267
|
-
// Current status of the order.
|
268
|
-
status: OrderStatus;
|
269
|
-
// Timestamp when the order was submitted.
|
270
|
-
submittedAt?: Date;
|
271
|
-
// Timestamp when the order was filled.
|
272
|
-
filledAt?: Date;
|
273
|
-
// Average price at which the order was filled.
|
274
|
-
filledAvgPrice?: number;
|
275
|
-
// Reference to the action associated with the order.
|
276
|
-
actionId: string;
|
277
|
-
// The Alpaca account this order is associated with.
|
278
|
-
alpacaAccount: AlpacaAccount;
|
279
|
-
// The action this order is associated with.
|
280
|
-
action: Action;
|
281
|
-
// The asset this order is for.
|
282
|
-
asset: Asset;
|
283
|
-
// Fee associated with the order.
|
284
|
-
fee?: number;
|
285
|
-
}
|
286
|
-
|
287
|
-
export type Position = {
|
288
|
-
// Reference to the associated asset.
|
289
|
-
assetId: string;
|
290
|
-
// Relation to the Asset model.
|
291
|
-
asset: Asset;
|
292
|
-
// The average price at which the asset was acquired.
|
293
|
-
averageEntryPrice: number;
|
294
|
-
// Total quantity of the asset held.
|
295
|
-
qty: number;
|
296
|
-
// Quantity of the asset available for trading.
|
297
|
-
qtyAvailable: number;
|
298
|
-
// Current market value of the position.
|
299
|
-
marketValue: number;
|
300
|
-
// Total cost basis of the position.
|
301
|
-
costBasis: number;
|
302
|
-
// Unrealized profit or loss of the position.
|
303
|
-
unrealizedPL: number;
|
304
|
-
// Unrealized profit or loss as a percentage.
|
305
|
-
unrealizedPLPC: number;
|
306
|
-
// Unrealized intraday profit or loss.
|
307
|
-
unrealisedIntradayPL: number;
|
308
|
-
// Unrealized intraday profit or loss as a percentage.
|
309
|
-
unrealisedIntradayPLPC: number;
|
310
|
-
// Current price of the asset.
|
311
|
-
currentPrice: number;
|
312
|
-
// Last traded price of the asset.
|
313
|
-
lastTradePrice: number;
|
314
|
-
// Price change of the asset for the day.
|
315
|
-
changeToday: number;
|
316
|
-
// Indicates if the asset is marginable.
|
317
|
-
assetMarginable: boolean;
|
318
|
-
// Relation to the AlpacaAccount model, if applicable.
|
319
|
-
alpacaAccount?: AlpacaAccount;
|
320
|
-
// Foreign key referencing the AlpacaAccount.
|
321
|
-
alpacaAccountId: string;
|
322
|
-
}
|
323
|
-
|
324
|
-
export enum AlertType {
|
325
|
-
SUCCESS = "SUCCESS",
|
326
|
-
WARNING = "WARNING",
|
327
|
-
ERROR = "ERROR",
|
328
|
-
INFO = "INFO"
|
329
|
-
}
|
330
|
-
|
331
|
-
export type Alert = {
|
332
|
-
// Reference to the Alpaca account associated with the alert.
|
333
|
-
alpacaAccountId: string;
|
334
|
-
// Message content of the alert.
|
335
|
-
message: string;
|
336
|
-
// Type of the alert, defined by AlertType enum.
|
337
|
-
type: AlertType;
|
338
|
-
// Indicates whether the alert has been read by the user.
|
339
|
-
isRead: boolean;
|
340
|
-
// Relation to the AlpacaAccount model.
|
341
|
-
alpacaAccount: AlpacaAccount;
|
342
|
-
}
|
343
|
-
|
344
163
|
export type AlpacaAccount = {
|
345
164
|
// The type of Alpaca account (PAPER or LIVE).
|
346
165
|
type: AlpacaAccountType;
|
@@ -354,10 +173,6 @@ export type AlpacaAccount = {
|
|
354
173
|
marketOpen: boolean;
|
355
174
|
// Relation to the User model who owns this Alpaca account.
|
356
175
|
user: User;
|
357
|
-
// Foreign key referencing the User.
|
358
|
-
userId: string;
|
359
|
-
// List of trades executed through this Alpaca account.
|
360
|
-
trades: Trade[];
|
361
176
|
// List of orders placed through this Alpaca account.
|
362
177
|
orders: Order[];
|
363
178
|
// List of positions held in this Alpaca account.
|
@@ -371,11 +186,38 @@ export enum OptionContractType {
|
|
371
186
|
PUT = "PUT"
|
372
187
|
}
|
373
188
|
|
189
|
+
export enum ActionType {
|
190
|
+
BUY = "BUY",
|
191
|
+
GET_OPTION_CONTRACTS = "GET_OPTION_CONTRACTS",
|
192
|
+
EXERCISE_OPTION = "EXERCISE_OPTION",
|
193
|
+
SELL = "SELL",
|
194
|
+
CANCEL = "CANCEL",
|
195
|
+
ADJUST = "ADJUST",
|
196
|
+
HEDGE = "HEDGE"
|
197
|
+
}
|
198
|
+
|
199
|
+
export enum ActionStatus {
|
200
|
+
STAGED = "STAGED",
|
201
|
+
EXECUTED = "EXECUTED",
|
202
|
+
COMPLETED = "COMPLETED"
|
203
|
+
}
|
204
|
+
|
205
|
+
export type Action = {
|
206
|
+
// Sequence number of the action within the trade.
|
207
|
+
sequence: number;
|
208
|
+
// Type of trade action, defined by ActionType enum.
|
209
|
+
type: ActionType;
|
210
|
+
// Additional notes or comments about the action.
|
211
|
+
note: string;
|
212
|
+
// Current status of the trade action.
|
213
|
+
status: ActionStatus;
|
214
|
+
// Fees associated with the action.
|
215
|
+
fee?: number;
|
216
|
+
// The order associated with this action.
|
217
|
+
order?: Order;
|
218
|
+
}
|
219
|
+
|
374
220
|
export type Trade = {
|
375
|
-
// Reference to the Alpaca account used for the trade.
|
376
|
-
alpacaAccountId: string;
|
377
|
-
// Reference to the asset being traded.
|
378
|
-
assetId: string;
|
379
221
|
// Quantity of the asset being traded.
|
380
222
|
qty: number;
|
381
223
|
// Price at which the asset was traded.
|
@@ -396,8 +238,6 @@ export type Trade = {
|
|
396
238
|
status: TradeStatus;
|
397
239
|
// Relation to the AlpacaAccount model.
|
398
240
|
alpacaAccount: AlpacaAccount;
|
399
|
-
// Relation to the Asset model.
|
400
|
-
asset: Asset;
|
401
241
|
// If the asset.type is OPTION, then provide type of contract (CALL or PUT).
|
402
242
|
optionContractType?: OptionContractType;
|
403
243
|
// List of actions associated with this trade.
|
@@ -431,21 +271,13 @@ export type NewsArticle = {
|
|
431
271
|
topics: string[];
|
432
272
|
// URL to the logo image of the news source.
|
433
273
|
logo?: string;
|
434
|
-
// List of asset sentiments associated with this news article.
|
435
|
-
assets: NewsArticleAssetSentiment[];
|
436
274
|
}
|
437
275
|
|
438
276
|
export type NewsArticleAssetSentiment = {
|
439
|
-
// Reference to the associated asset.
|
440
|
-
assetId: string;
|
441
|
-
// Reference to the associated news article.
|
442
|
-
newsArticleId: string;
|
443
277
|
// URL of the news article, must be unique.
|
444
278
|
url: string;
|
445
279
|
// Relation to the NewsArticle model.
|
446
280
|
news: NewsArticle;
|
447
|
-
// Relation to the Asset model.
|
448
|
-
asset: Asset;
|
449
281
|
// Relevancy score indicating how relevant the news is to the asset.
|
450
282
|
relevancyScore?: string;
|
451
283
|
// Sentiment score derived from the news content.
|