adaptic-backend 1.0.71 → 1.0.73

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 (121) hide show
  1. package/generated/typeStrings/Account.cjs +0 -211
  2. package/generated/typeStrings/Account.d.ts +1 -1
  3. package/generated/typeStrings/Account.d.ts.map +1 -1
  4. package/generated/typeStrings/Account.js.map +1 -1
  5. package/generated/typeStrings/Action.cjs +143 -195
  6. package/generated/typeStrings/Action.d.ts +1 -1
  7. package/generated/typeStrings/Action.d.ts.map +1 -1
  8. package/generated/typeStrings/Action.js.map +1 -1
  9. package/generated/typeStrings/Alert.cjs +100 -268
  10. package/generated/typeStrings/Alert.d.ts +1 -1
  11. package/generated/typeStrings/Alert.d.ts.map +1 -1
  12. package/generated/typeStrings/Alert.js.map +1 -1
  13. package/generated/typeStrings/AlpacaAccount.cjs +31 -177
  14. package/generated/typeStrings/AlpacaAccount.d.ts +1 -1
  15. package/generated/typeStrings/AlpacaAccount.d.ts.map +1 -1
  16. package/generated/typeStrings/AlpacaAccount.js.map +1 -1
  17. package/generated/typeStrings/Asset.cjs +31 -199
  18. package/generated/typeStrings/Asset.d.ts +1 -1
  19. package/generated/typeStrings/Asset.d.ts.map +1 -1
  20. package/generated/typeStrings/Asset.js.map +1 -1
  21. package/generated/typeStrings/Authenticator.cjs +0 -211
  22. package/generated/typeStrings/Authenticator.d.ts +1 -1
  23. package/generated/typeStrings/Authenticator.d.ts.map +1 -1
  24. package/generated/typeStrings/Authenticator.js.map +1 -1
  25. package/generated/typeStrings/Customer.cjs +0 -211
  26. package/generated/typeStrings/Customer.d.ts +1 -1
  27. package/generated/typeStrings/Customer.d.ts.map +1 -1
  28. package/generated/typeStrings/Customer.js.map +1 -1
  29. package/generated/typeStrings/NewsArticle.cjs +0 -169
  30. package/generated/typeStrings/NewsArticle.d.ts +1 -1
  31. package/generated/typeStrings/NewsArticle.d.ts.map +1 -1
  32. package/generated/typeStrings/NewsArticle.js.map +1 -1
  33. package/generated/typeStrings/NewsArticleAssetSentiment.cjs +100 -81
  34. package/generated/typeStrings/NewsArticleAssetSentiment.d.ts +1 -1
  35. package/generated/typeStrings/NewsArticleAssetSentiment.d.ts.map +1 -1
  36. package/generated/typeStrings/NewsArticleAssetSentiment.js.map +1 -1
  37. package/generated/typeStrings/Order.cjs +31 -278
  38. package/generated/typeStrings/Order.d.ts +1 -1
  39. package/generated/typeStrings/Order.d.ts.map +1 -1
  40. package/generated/typeStrings/Order.js.map +1 -1
  41. package/generated/typeStrings/Position.cjs +67 -114
  42. package/generated/typeStrings/Position.d.ts +1 -1
  43. package/generated/typeStrings/Position.d.ts.map +1 -1
  44. package/generated/typeStrings/Position.js.map +1 -1
  45. package/generated/typeStrings/Session.cjs +0 -211
  46. package/generated/typeStrings/Session.d.ts +1 -1
  47. package/generated/typeStrings/Session.d.ts.map +1 -1
  48. package/generated/typeStrings/Session.js.map +1 -1
  49. package/generated/typeStrings/Trade.cjs +31 -278
  50. package/generated/typeStrings/Trade.d.ts +1 -1
  51. package/generated/typeStrings/Trade.d.ts.map +1 -1
  52. package/generated/typeStrings/Trade.js.map +1 -1
  53. package/generated/typeStrings/User.cjs +100 -222
  54. package/generated/typeStrings/User.d.ts +1 -1
  55. package/generated/typeStrings/User.d.ts.map +1 -1
  56. package/generated/typeStrings/User.js.map +1 -1
  57. package/generated/typeStrings/index.d.ts +14 -14
  58. package/index.cjs +3 -13
  59. package/index.d.ts +1 -1
  60. package/package.json +1 -1
  61. package/server/generated/typeStrings/Account.d.ts +1 -1
  62. package/server/generated/typeStrings/Account.d.ts.map +1 -1
  63. package/server/generated/typeStrings/Account.js.map +1 -1
  64. package/server/generated/typeStrings/Account.mjs +0 -211
  65. package/server/generated/typeStrings/Action.d.ts +1 -1
  66. package/server/generated/typeStrings/Action.d.ts.map +1 -1
  67. package/server/generated/typeStrings/Action.js.map +1 -1
  68. package/server/generated/typeStrings/Action.mjs +143 -195
  69. package/server/generated/typeStrings/Alert.d.ts +1 -1
  70. package/server/generated/typeStrings/Alert.d.ts.map +1 -1
  71. package/server/generated/typeStrings/Alert.js.map +1 -1
  72. package/server/generated/typeStrings/Alert.mjs +100 -268
  73. package/server/generated/typeStrings/AlpacaAccount.d.ts +1 -1
  74. package/server/generated/typeStrings/AlpacaAccount.d.ts.map +1 -1
  75. package/server/generated/typeStrings/AlpacaAccount.js.map +1 -1
  76. package/server/generated/typeStrings/AlpacaAccount.mjs +31 -177
  77. package/server/generated/typeStrings/Asset.d.ts +1 -1
  78. package/server/generated/typeStrings/Asset.d.ts.map +1 -1
  79. package/server/generated/typeStrings/Asset.js.map +1 -1
  80. package/server/generated/typeStrings/Asset.mjs +31 -199
  81. package/server/generated/typeStrings/Authenticator.d.ts +1 -1
  82. package/server/generated/typeStrings/Authenticator.d.ts.map +1 -1
  83. package/server/generated/typeStrings/Authenticator.js.map +1 -1
  84. package/server/generated/typeStrings/Authenticator.mjs +0 -211
  85. package/server/generated/typeStrings/Customer.d.ts +1 -1
  86. package/server/generated/typeStrings/Customer.d.ts.map +1 -1
  87. package/server/generated/typeStrings/Customer.js.map +1 -1
  88. package/server/generated/typeStrings/Customer.mjs +0 -211
  89. package/server/generated/typeStrings/NewsArticle.d.ts +1 -1
  90. package/server/generated/typeStrings/NewsArticle.d.ts.map +1 -1
  91. package/server/generated/typeStrings/NewsArticle.js.map +1 -1
  92. package/server/generated/typeStrings/NewsArticle.mjs +0 -169
  93. package/server/generated/typeStrings/NewsArticleAssetSentiment.d.ts +1 -1
  94. package/server/generated/typeStrings/NewsArticleAssetSentiment.d.ts.map +1 -1
  95. package/server/generated/typeStrings/NewsArticleAssetSentiment.js.map +1 -1
  96. package/server/generated/typeStrings/NewsArticleAssetSentiment.mjs +100 -81
  97. package/server/generated/typeStrings/Order.d.ts +1 -1
  98. package/server/generated/typeStrings/Order.d.ts.map +1 -1
  99. package/server/generated/typeStrings/Order.js.map +1 -1
  100. package/server/generated/typeStrings/Order.mjs +31 -278
  101. package/server/generated/typeStrings/Position.d.ts +1 -1
  102. package/server/generated/typeStrings/Position.d.ts.map +1 -1
  103. package/server/generated/typeStrings/Position.js.map +1 -1
  104. package/server/generated/typeStrings/Position.mjs +67 -114
  105. package/server/generated/typeStrings/Session.d.ts +1 -1
  106. package/server/generated/typeStrings/Session.d.ts.map +1 -1
  107. package/server/generated/typeStrings/Session.js.map +1 -1
  108. package/server/generated/typeStrings/Session.mjs +0 -211
  109. package/server/generated/typeStrings/Trade.d.ts +1 -1
  110. package/server/generated/typeStrings/Trade.d.ts.map +1 -1
  111. package/server/generated/typeStrings/Trade.js.map +1 -1
  112. package/server/generated/typeStrings/Trade.mjs +31 -278
  113. package/server/generated/typeStrings/User.d.ts +1 -1
  114. package/server/generated/typeStrings/User.d.ts.map +1 -1
  115. package/server/generated/typeStrings/User.js.map +1 -1
  116. package/server/generated/typeStrings/User.mjs +100 -222
  117. package/server/generated/typeStrings/index.d.ts +14 -14
  118. package/server/index.d.ts +1 -1
  119. package/server/index.d.ts.map +1 -1
  120. package/server/index.js.map +1 -1
  121. package/server/index.mjs +1 -1
@@ -7,10 +7,6 @@ Your response should adhere to the following type definition for the "Trade" typ
7
7
  Importantly, DO NOT include any annotations in your response (i.e. remove the ones we have provided for your reference below).
8
8
 
9
9
  export type Trade = {
10
- // Reference to the Alpaca account used for the trade.
11
- alpacaAccountId: string;
12
- // Reference to the asset being traded.
13
- assetId: string;
14
10
  // Quantity of the asset being traded.
15
11
  qty: number;
16
12
  // Price at which the asset was traded.
@@ -63,76 +59,6 @@ export enum SubscriptionPlan {
63
59
  BUSINESS = "BUSINESS"
64
60
  }
65
61
 
66
- export type Customer = {
67
- // Reference to the authenticated user associated with the customer.
68
- authUserId: string;
69
- // Name of the customer.
70
- name?: string;
71
- // Subscription plan the customer is enrolled in.
72
- plan?: SubscriptionPlan;
73
- // Unique Stripe customer ID for billing.
74
- stripeCustomerId?: string;
75
- // Unique Stripe subscription ID.
76
- stripeSubscriptionId?: string;
77
- // Stripe price ID associated with the customer's subscription.
78
- stripePriceId?: string;
79
- // End date of the current billing period in Stripe.
80
- stripeCurrentPeriodEnd?: Date;
81
- // List of users associated with the customer.
82
- users: User[];
83
- }
84
-
85
- export type Account = {
86
- // Reference to the user who owns this account.
87
- userId: string;
88
- // Type of the account (e.g., OAuth provider).
89
- type: string;
90
- // Provider of the account (e.g., Google, GitHub).
91
- provider: string;
92
- // Unique identifier provided by the external provider.
93
- providerAccountId: string;
94
- // Refresh token for the external account, if applicable.
95
- refresh_token?: string;
96
- // Access token for the external account, if applicable.
97
- access_token?: string;
98
- // Expiration time of the access token.
99
- expires_at?: number;
100
- // Type of the token (e.g., Bearer).
101
- token_type?: string;
102
- // Scope of access granted by the token.
103
- scope?: string;
104
- // ID token for authentication, if applicable.
105
- id_token?: string;
106
- // State of the session associated with the account.
107
- session_state?: string;
108
- // Relation to the User model.
109
- user: User;
110
- }
111
-
112
- export type Session = {
113
- // Token associated with the session for authentication.
114
- sessionToken: string;
115
- // Reference to the user who owns this session.
116
- userId: string;
117
- // Expiration date and time of the session.
118
- expires: Date;
119
- // Relation to the User model.
120
- user: User;
121
- }
122
-
123
- export type Authenticator = {
124
- // Reference to the user who owns this authenticator.
125
- userId: string;
126
- // Unique credential ID for the authenticator.
127
- credentialID: string;
128
- // Public key associated with the authenticator.
129
- publicKey: string;
130
- // Counter for the number of authentication attempts.
131
- counter: number;
132
- // Relation to the User model.
133
- user: User;
134
- }
135
-
136
62
  export type User = {
137
63
  // The user's full name.
138
64
  name?: string;
@@ -152,8 +78,6 @@ export type User = {
152
78
  currentAccount: AlpacaAccountType;
153
79
  // Relation to the Customer model, if applicable.
154
80
  customer?: Customer;
155
- // Foreign key referencing the Customer.
156
- customerId?: number;
157
81
  // List of accounts associated with the user.
158
82
  accounts: Account[];
159
83
  // List of sessions associated with the user.
@@ -162,8 +86,6 @@ export type User = {
162
86
  authenticators: Authenticator[];
163
87
  // The subscription plan the user is enrolled in.
164
88
  plan?: SubscriptionPlan;
165
- // List of Alpaca accounts linked to the user.
166
- alpacaAccounts: AlpacaAccount[];
167
89
  }
168
90
 
169
91
  export enum OrderSide {
@@ -198,193 +120,7 @@ export enum OrderStatus {
198
120
  EXPIRED = "EXPIRED"
199
121
  }
200
122
 
201
- export enum ActionType {
202
- BUY = "BUY",
203
- GET_OPTION_CONTRACTS = "GET_OPTION_CONTRACTS",
204
- EXERCISE_OPTION = "EXERCISE_OPTION",
205
- SELL = "SELL",
206
- CANCEL = "CANCEL",
207
- ADJUST = "ADJUST",
208
- HEDGE = "HEDGE"
209
- }
210
-
211
- export enum ActionStatus {
212
- STAGED = "STAGED",
213
- EXECUTED = "EXECUTED",
214
- COMPLETED = "COMPLETED"
215
- }
216
-
217
- export type Action = {
218
- // Sequence number of the action within the trade.
219
- sequence: number;
220
- // Reference to the trade this action is part of.
221
- tradeId: string;
222
- // Type of trade action, defined by ActionType enum.
223
- type: ActionType;
224
- // Reference to the order ID associated with the action.
225
- orderId?: string;
226
- // Additional notes or comments about the action.
227
- note: string;
228
- // Current status of the trade action.
229
- status: ActionStatus;
230
- // Fees associated with the action.
231
- fee?: number;
232
- // The trade this action is part of.
233
- trade: Trade;
234
- // The order associated with this action.
235
- order?: Order;
236
- }
237
-
238
- export enum AssetType {
239
- STOCK = "STOCK",
240
- ETF = "ETF",
241
- MUTUAL_FUND = "MUTUAL_FUND",
242
- CRYPTOCURRENCY = "CRYPTOCURRENCY",
243
- INDEX = "INDEX",
244
- COMMODITY = "COMMODITY",
245
- CURRENCY = "CURRENCY",
246
- OPTION = "OPTION",
247
- FUTURE = "FUTURE",
248
- BOND = "BOND",
249
- WARRANT = "WARRANT",
250
- ADR = "ADR",
251
- GDR = "GDR",
252
- UNIT = "UNIT",
253
- RIGHT = "RIGHT",
254
- REIT = "REIT",
255
- STRUCTURED_PRODUCT = "STRUCTURED_PRODUCT",
256
- SWAP = "SWAP",
257
- SPOT = "SPOT",
258
- FORWARD = "FORWARD",
259
- OTHER = "OTHER"
260
- }
261
-
262
- export type Asset = {
263
- // Ticker symbol of the asset, must be unique.
264
- symbol: string;
265
- // Full name of the asset, must be unique.
266
- name: string;
267
- // Type of the asset, defined by AssetType enum.
268
- type: AssetType;
269
- // URL to the asset's logo image.
270
- logoUrl?: string;
271
- // Description of the asset.
272
- description?: string;
273
- // Central Index Key for the asset.
274
- cik?: string;
275
- // Stock exchange where the asset is listed.
276
- exchange?: string;
277
- // Currency in which the asset is traded.
278
- currency?: string;
279
- // Country where the asset is based.
280
- country?: string;
281
- // Sector classification of the asset.
282
- sector?: string;
283
- // Industry classification of the asset.
284
- industry?: string;
285
- // Physical address associated with the asset.
286
- address?: string;
287
- // Official website of the asset.
288
- officialSite?: string;
289
- // Fiscal year-end date of the asset.
290
- fiscalYearEnd?: string;
291
- // Date of the latest financial quarter.
292
- latestQuarter?: string;
293
- // Market capitalization of the asset.
294
- marketCapitalization?: string;
295
- // Earnings Before Interest, Taxes, Depreciation, and Amortization.
296
- ebitda?: string;
297
- // Price-to-Earnings ratio.
298
- peRatio?: string;
299
- // Price/Earnings to Growth ratio.
300
- pegRatio?: string;
301
- // Book value per share.
302
- bookValue?: string;
303
- // Dividend per share.
304
- dividendPerShare?: string;
305
- // Dividend yield percentage.
306
- dividendYield?: string;
307
- // Earnings per share.
308
- eps?: string;
309
- // Revenue per share over the trailing twelve months.
310
- revenuePerShareTTM?: string;
311
- // Profit margin percentage.
312
- profitMargin?: string;
313
- // Operating margin over the trailing twelve months.
314
- operatingMarginTTM?: string;
315
- // Return on assets over the trailing twelve months.
316
- returnOnAssetsTTM?: string;
317
- // Return on equity over the trailing twelve months.
318
- returnOnEquityTTM?: string;
319
- // Total revenue over the trailing twelve months.
320
- revenueTTM?: string;
321
- // Gross profit over the trailing twelve months.
322
- grossProfitTTM?: string;
323
- // Diluted earnings per share over the trailing twelve months.
324
- dilutedEPSTTM?: string;
325
- // Year-over-year growth in quarterly earnings.
326
- quarterlyEarningsGrowthYOY?: string;
327
- // Year-over-year growth in quarterly revenue.
328
- quarterlyRevenueGrowthYOY?: string;
329
- // Analyst target price for the asset.
330
- analystTargetPrice?: string;
331
- // Percentage of analysts rating the asset as Strong Buy.
332
- analystRatingStrongBuy?: string;
333
- // Percentage of analysts rating the asset as Buy.
334
- analystRatingBuy?: string;
335
- // Percentage of analysts rating the asset as Hold.
336
- analystRatingHold?: string;
337
- // Percentage of analysts rating the asset as Sell.
338
- analystRatingSell?: string;
339
- // Percentage of analysts rating the asset as Strong Sell.
340
- analystRatingStrongSell?: string;
341
- // Trailing Price-to-Earnings ratio.
342
- trailingPE?: string;
343
- // Forward Price-to-Earnings ratio.
344
- forwardPE?: string;
345
- // Price-to-Sales ratio over the trailing twelve months.
346
- priceToSalesRatioTTM?: string;
347
- // Price-to-Book ratio.
348
- priceToBookRatio?: string;
349
- // Enterprise Value to Revenue ratio.
350
- evToRevenue?: string;
351
- // Enterprise Value to EBITDA ratio.
352
- evToEbitda?: string;
353
- // Beta coefficient measuring volatility.
354
- beta?: string;
355
- // 52-week high price of the asset.
356
- week52High?: string;
357
- // 52-week low price of the asset.
358
- week52Low?: string;
359
- // 50-day moving average price.
360
- day50MovingAverage?: string;
361
- // 200-day moving average price.
362
- day200MovingAverage?: string;
363
- // Total number of shares outstanding.
364
- sharesOutstanding?: string;
365
- // Date when the next dividend is paid.
366
- dividendDate?: string;
367
- // Date when the asset goes ex-dividend.
368
- exDividendDate?: string;
369
- // Last sell price of the asset.
370
- sellPrice?: string;
371
- // Last buy price of the asset.
372
- buyPrice?: string;
373
- // List of trades involving this asset.
374
- trades: Trade[];
375
- // List of orders involving this asset.
376
- orders: Order[];
377
- // List of positions involving this asset.
378
- positions: Position[];
379
- // List of news article sentiments related to this asset.
380
- newsMentions: NewsArticleAssetSentiment[];
381
- }
382
-
383
123
  export type Order = {
384
- // Reference to the Alpaca account used for the order.
385
- alpacaAccountId: string;
386
- // Reference to the asset being ordered.
387
- assetId: string;
388
124
  // Quantity of the asset to be ordered.
389
125
  qty?: number;
390
126
  // Notional value of the order. Optional, used if qty is not provided.
@@ -405,8 +141,6 @@ export type Order = {
405
141
  trailPercent?: number;
406
142
  // Whether the order is eligible for extended hours.
407
143
  extendedHours?: boolean;
408
- // Client-supplied identifier for the order.
409
- clientOrderId?: string;
410
144
  // Current status of the order.
411
145
  status: OrderStatus;
412
146
  // Timestamp when the order was submitted.
@@ -415,10 +149,6 @@ export type Order = {
415
149
  filledAt?: Date;
416
150
  // Average price at which the order was filled.
417
151
  filledAvgPrice?: number;
418
- // Reference to the action associated with the order.
419
- actionId: string;
420
- // The Alpaca account this order is associated with.
421
- alpacaAccount: AlpacaAccount;
422
152
  // The action this order is associated with.
423
153
  action: Action;
424
154
  // The asset this order is for.
@@ -427,6 +157,37 @@ export type Order = {
427
157
  fee?: number;
428
158
  }
429
159
 
160
+ export type Position = {
161
+ // Relation to the Asset model.
162
+ asset: Asset;
163
+ // The average price at which the asset was acquired.
164
+ averageEntryPrice: number;
165
+ // Total quantity of the asset held.
166
+ qty: number;
167
+ // Quantity of the asset available for trading.
168
+ qtyAvailable: number;
169
+ // Current market value of the position.
170
+ marketValue: number;
171
+ // Total cost basis of the position.
172
+ costBasis: number;
173
+ // Unrealized profit or loss of the position.
174
+ unrealizedPL: number;
175
+ // Unrealized profit or loss as a percentage.
176
+ unrealizedPLPC: number;
177
+ // Unrealized intraday profit or loss.
178
+ unrealisedIntradayPL: number;
179
+ // Unrealized intraday profit or loss as a percentage.
180
+ unrealisedIntradayPLPC: number;
181
+ // Current price of the asset.
182
+ currentPrice: number;
183
+ // Last traded price of the asset.
184
+ lastTradePrice: number;
185
+ // Price change of the asset for the day.
186
+ changeToday: number;
187
+ // Indicates if the asset is marginable.
188
+ assetMarginable: boolean;
189
+ }
190
+
430
191
  export enum AlertType {
431
192
  SUCCESS = "SUCCESS",
432
193
  WARNING = "WARNING",
@@ -435,16 +196,12 @@ export enum AlertType {
435
196
  }
436
197
 
437
198
  export type Alert = {
438
- // Reference to the Alpaca account associated with the alert.
439
- alpacaAccountId: string;
440
199
  // Message content of the alert.
441
200
  message: string;
442
201
  // Type of the alert, defined by AlertType enum.
443
202
  type: AlertType;
444
203
  // Indicates whether the alert has been read by the user.
445
204
  isRead: boolean;
446
- // Relation to the AlpacaAccount model.
447
- alpacaAccount: AlpacaAccount;
448
205
  }
449
206
 
450
207
  export type AlpacaAccount = {
@@ -460,10 +217,6 @@ export type AlpacaAccount = {
460
217
  marketOpen: boolean;
461
218
  // Relation to the User model who owns this Alpaca account.
462
219
  user: User;
463
- // Foreign key referencing the User.
464
- userId: string;
465
- // List of trades executed through this Alpaca account.
466
- trades: Trade[];
467
220
  // List of orders placed through this Alpaca account.
468
221
  orders: Order[];
469
222
  // List of positions held in this Alpaca account.
@@ -1,2 +1,2 @@
1
- export declare const TradeTypeString = "\nYour response should adhere to the following type definition for the \"Trade\" type, and its nested object types (which include 'AlpacaAccount', 'Asset', 'Action' types), as well as any ENUMS used by it (which include 'TradeStatus', 'OptionContractType' enums).\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 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 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 Customer = {\n // Reference to the authenticated user associated with the customer.\n authUserId: string;\n // Name of the customer.\n name?: string;\n // Subscription plan the customer is enrolled in.\n plan?: SubscriptionPlan;\n // Unique Stripe customer ID for billing.\n stripeCustomerId?: string;\n // Unique Stripe subscription ID.\n stripeSubscriptionId?: string;\n // Stripe price ID associated with the customer's subscription.\n stripePriceId?: string;\n // End date of the current billing period in Stripe.\n stripeCurrentPeriodEnd?: Date;\n // List of users associated with the customer.\n users: User[];\n}\n\nexport type Account = {\n // Reference to the user who owns this account.\n userId: string;\n // Type of the account (e.g., OAuth provider).\n type: string;\n // Provider of the account (e.g., Google, GitHub).\n provider: string;\n // Unique identifier provided by the external provider.\n providerAccountId: string;\n // Refresh token for the external account, if applicable.\n refresh_token?: string;\n // Access token for the external account, if applicable.\n access_token?: string;\n // Expiration time of the access token.\n expires_at?: number;\n // Type of the token (e.g., Bearer).\n token_type?: string;\n // Scope of access granted by the token.\n scope?: string;\n // ID token for authentication, if applicable.\n id_token?: string;\n // State of the session associated with the account.\n session_state?: string;\n // Relation to the User model.\n user: User;\n}\n\nexport type Session = {\n // Token associated with the session for authentication.\n sessionToken: string;\n // Reference to the user who owns this session.\n userId: string;\n // Expiration date and time of the session.\n expires: Date;\n // Relation to the User model.\n user: User;\n}\n\nexport type Authenticator = {\n // Reference to the user who owns this authenticator.\n userId: string;\n // Unique credential ID for the authenticator.\n credentialID: string;\n // Public key associated with the authenticator.\n publicKey: string;\n // Counter for the number of authentication attempts.\n counter: number;\n // Relation to the User model.\n user: User;\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 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 // Reference to the trade this action is part of.\n tradeId: string;\n // Type of trade action, defined by ActionType enum.\n type: ActionType;\n // Reference to the order ID associated with the action.\n orderId?: string;\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 trade this action is part of.\n trade: Trade;\n // The order associated with this action.\n order?: Order;\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 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 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 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\n";
1
+ export declare const TradeTypeString = "\nYour response should adhere to the following type definition for the \"Trade\" type, and its nested object types (which include 'AlpacaAccount', 'Asset', 'Action' types), as well as any ENUMS used by it (which include 'TradeStatus', 'OptionContractType' enums).\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 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 // 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 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 // 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}\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 // 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 // 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 // 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 // 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}\n\nexport enum AlertType {\n SUCCESS = \"SUCCESS\",\n WARNING = \"WARNING\",\n ERROR = \"ERROR\",\n INFO = \"INFO\"\n}\n\nexport type Alert = {\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}\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\n";
2
2
  //# sourceMappingURL=Trade.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Trade.d.ts","sourceRoot":"","sources":["../../../src/generated/typeStrings/Trade.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,45cA4d3B,CAAC"}
1
+ {"version":3,"file":"Trade.d.ts","sourceRoot":"","sources":["../../../src/generated/typeStrings/Trade.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,omNAqO3B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Trade.js","sourceRoot":"","sources":["../../../src/generated/typeStrings/Trade.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4d9B,CAAC"}
1
+ {"version":3,"file":"Trade.js","sourceRoot":"","sources":["../../../src/generated/typeStrings/Trade.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqO9B,CAAC"}