@adaptic/utils 0.1.44 → 0.1.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -153
- package/dist/index.cjs +5356 -60315
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +5356 -60054
- package/dist/index.mjs.map +1 -1
- package/dist/test.js +361 -824
- package/dist/test.js.map +1 -1
- package/dist/types/adaptic.d.ts +2 -2
- package/dist/types/adaptic.d.ts.map +1 -1
- package/dist/types/alpaca-functions.d.ts +233 -0
- package/dist/types/alpaca-functions.d.ts.map +1 -0
- package/dist/types/alpaca-market-data-api.d.ts +9 -24
- package/dist/types/alpaca-market-data-api.d.ts.map +1 -1
- package/dist/types/alpaca-trading-api.d.ts +12 -12
- package/dist/types/alpaca-trading-api.d.ts.map +1 -1
- package/dist/types/alphavantage.d.ts +1 -1
- package/dist/types/alphavantage.d.ts.map +1 -1
- package/dist/types/asset-allocation-algorithm.d.ts +1 -7
- package/dist/types/asset-allocation-algorithm.d.ts.map +1 -1
- package/dist/types/cache/stampede-protected-cache.d.ts.map +1 -1
- package/dist/types/crypto.d.ts +4 -4
- package/dist/types/crypto.d.ts.map +1 -1
- package/dist/types/display-manager.d.ts +1 -1
- package/dist/types/display-manager.d.ts.map +1 -1
- package/dist/types/examples/asset-allocation-example.d.ts +6 -7
- package/dist/types/examples/asset-allocation-example.d.ts.map +1 -1
- package/dist/types/format-tools.d.ts.map +1 -1
- package/dist/types/index.d.ts +55 -393
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logging.d.ts +1 -1
- package/dist/types/logging.d.ts.map +1 -1
- package/dist/types/market-hours.d.ts.map +1 -1
- package/dist/types/market-time.d.ts +13 -75
- package/dist/types/market-time.d.ts.map +1 -1
- package/dist/types/metrics-calcs.d.ts.map +1 -1
- package/dist/types/misc-utils.d.ts +1 -4
- package/dist/types/misc-utils.d.ts.map +1 -1
- package/dist/types/performance-metrics.d.ts +6 -6
- package/dist/types/performance-metrics.d.ts.map +1 -1
- package/dist/types/polygon-indices.d.ts +3 -3
- package/dist/types/polygon-indices.d.ts.map +1 -1
- package/dist/types/polygon.d.ts +1 -1
- package/dist/types/polygon.d.ts.map +1 -1
- package/dist/types/price-utils.d.ts.map +1 -1
- package/dist/types/technical-analysis.d.ts +9 -9
- package/dist/types/technical-analysis.d.ts.map +1 -1
- package/dist/types/time-utils.d.ts.map +1 -1
- package/dist/types/types/adaptic-types.d.ts +1 -1
- package/dist/types/types/adaptic-types.d.ts.map +1 -1
- package/dist/types/types/alpaca-types.d.ts +89 -252
- package/dist/types/types/alpaca-types.d.ts.map +1 -1
- package/dist/types/types/alphavantage-types.d.ts +2 -2
- package/dist/types/types/asset-allocation-types.d.ts +11 -11
- package/dist/types/types/index.d.ts +8 -8
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/types/logging-types.d.ts +2 -2
- package/dist/types/types/logging-types.d.ts.map +1 -1
- package/dist/types/types/market-time-types.d.ts +4 -4
- package/dist/types/types/market-time-types.d.ts.map +1 -1
- package/dist/types/types/metrics-types.d.ts +4 -4
- package/dist/types/types/metrics-types.d.ts.map +1 -1
- package/dist/types/types/polygon-indices-types.d.ts +6 -6
- package/dist/types/types/polygon-types.d.ts +3 -3
- package/dist/types/types/ta-types.d.ts +3 -3
- package/package.json +6 -24
- package/dist/types/__tests__/alpaca-functions.test.d.ts +0 -2
- package/dist/types/__tests__/alpaca-functions.test.d.ts.map +0 -1
- package/dist/types/__tests__/api-endpoints.test.d.ts +0 -2
- package/dist/types/__tests__/api-endpoints.test.d.ts.map +0 -1
- package/dist/types/__tests__/asset-allocation.test.d.ts +0 -2
- package/dist/types/__tests__/asset-allocation.test.d.ts.map +0 -1
- package/dist/types/__tests__/auth-validator.test.d.ts +0 -2
- package/dist/types/__tests__/auth-validator.test.d.ts.map +0 -1
- package/dist/types/__tests__/cache.test.d.ts +0 -2
- package/dist/types/__tests__/cache.test.d.ts.map +0 -1
- package/dist/types/__tests__/errors.test.d.ts +0 -2
- package/dist/types/__tests__/errors.test.d.ts.map +0 -1
- package/dist/types/__tests__/financial-regression.test.d.ts +0 -2
- package/dist/types/__tests__/financial-regression.test.d.ts.map +0 -1
- package/dist/types/__tests__/format-tools.test.d.ts +0 -2
- package/dist/types/__tests__/format-tools.test.d.ts.map +0 -1
- package/dist/types/__tests__/http-keep-alive.test.d.ts +0 -2
- package/dist/types/__tests__/http-keep-alive.test.d.ts.map +0 -1
- package/dist/types/__tests__/http-timeout.test.d.ts +0 -2
- package/dist/types/__tests__/http-timeout.test.d.ts.map +0 -1
- package/dist/types/__tests__/logger.test.d.ts +0 -2
- package/dist/types/__tests__/logger.test.d.ts.map +0 -1
- package/dist/types/__tests__/market-time.test.d.ts +0 -2
- package/dist/types/__tests__/market-time.test.d.ts.map +0 -1
- package/dist/types/__tests__/misc-utils.test.d.ts +0 -2
- package/dist/types/__tests__/misc-utils.test.d.ts.map +0 -1
- package/dist/types/__tests__/paginator.test.d.ts +0 -2
- package/dist/types/__tests__/paginator.test.d.ts.map +0 -1
- package/dist/types/__tests__/performance-metrics.test.d.ts +0 -2
- package/dist/types/__tests__/performance-metrics.test.d.ts.map +0 -1
- package/dist/types/__tests__/polygon.test.d.ts +0 -2
- package/dist/types/__tests__/polygon.test.d.ts.map +0 -1
- package/dist/types/__tests__/price-utils.test.d.ts +0 -2
- package/dist/types/__tests__/price-utils.test.d.ts.map +0 -1
- package/dist/types/__tests__/property-based-financial.test.d.ts +0 -2
- package/dist/types/__tests__/property-based-financial.test.d.ts.map +0 -1
- package/dist/types/__tests__/rate-limiter.test.d.ts +0 -2
- package/dist/types/__tests__/rate-limiter.test.d.ts.map +0 -1
- package/dist/types/__tests__/schema-validation.test.d.ts +0 -2
- package/dist/types/__tests__/schema-validation.test.d.ts.map +0 -1
- package/dist/types/__tests__/technical-analysis.test.d.ts +0 -2
- package/dist/types/__tests__/technical-analysis.test.d.ts.map +0 -1
- package/dist/types/__tests__/time-utils.test.d.ts +0 -2
- package/dist/types/__tests__/time-utils.test.d.ts.map +0 -1
- package/dist/types/alpaca/client.d.ts +0 -95
- package/dist/types/alpaca/client.d.ts.map +0 -1
- package/dist/types/alpaca/crypto/data.d.ts +0 -281
- package/dist/types/alpaca/crypto/data.d.ts.map +0 -1
- package/dist/types/alpaca/crypto/index.d.ts +0 -75
- package/dist/types/alpaca/crypto/index.d.ts.map +0 -1
- package/dist/types/alpaca/crypto/orders.d.ts +0 -221
- package/dist/types/alpaca/crypto/orders.d.ts.map +0 -1
- package/dist/types/alpaca/index.d.ts +0 -205
- package/dist/types/alpaca/index.d.ts.map +0 -1
- package/dist/types/alpaca/legacy/account.d.ts +0 -34
- package/dist/types/alpaca/legacy/account.d.ts.map +0 -1
- package/dist/types/alpaca/legacy/assets.d.ts +0 -13
- package/dist/types/alpaca/legacy/assets.d.ts.map +0 -1
- package/dist/types/alpaca/legacy/auth.d.ts +0 -18
- package/dist/types/alpaca/legacy/auth.d.ts.map +0 -1
- package/dist/types/alpaca/legacy/index.d.ts +0 -15
- package/dist/types/alpaca/legacy/index.d.ts.map +0 -1
- package/dist/types/alpaca/legacy/market-data.d.ts +0 -32
- package/dist/types/alpaca/legacy/market-data.d.ts.map +0 -1
- package/dist/types/alpaca/legacy/orders.d.ts +0 -84
- package/dist/types/alpaca/legacy/orders.d.ts.map +0 -1
- package/dist/types/alpaca/legacy/positions.d.ts +0 -66
- package/dist/types/alpaca/legacy/positions.d.ts.map +0 -1
- package/dist/types/alpaca/legacy/utils.d.ts +0 -18
- package/dist/types/alpaca/legacy/utils.d.ts.map +0 -1
- package/dist/types/alpaca/market-data/bars.d.ts +0 -142
- package/dist/types/alpaca/market-data/bars.d.ts.map +0 -1
- package/dist/types/alpaca/market-data/index.d.ts +0 -13
- package/dist/types/alpaca/market-data/index.d.ts.map +0 -1
- package/dist/types/alpaca/market-data/news.d.ts +0 -87
- package/dist/types/alpaca/market-data/news.d.ts.map +0 -1
- package/dist/types/alpaca/market-data/quotes.d.ts +0 -85
- package/dist/types/alpaca/market-data/quotes.d.ts.map +0 -1
- package/dist/types/alpaca/market-data/trades.d.ts +0 -98
- package/dist/types/alpaca/market-data/trades.d.ts.map +0 -1
- package/dist/types/alpaca/options/contracts.d.ts +0 -279
- package/dist/types/alpaca/options/contracts.d.ts.map +0 -1
- package/dist/types/alpaca/options/data.d.ts +0 -126
- package/dist/types/alpaca/options/data.d.ts.map +0 -1
- package/dist/types/alpaca/options/index.d.ts +0 -17
- package/dist/types/alpaca/options/index.d.ts.map +0 -1
- package/dist/types/alpaca/options/orders.d.ts +0 -366
- package/dist/types/alpaca/options/orders.d.ts.map +0 -1
- package/dist/types/alpaca/options/strategies.d.ts +0 -224
- package/dist/types/alpaca/options/strategies.d.ts.map +0 -1
- package/dist/types/alpaca/streams/base-stream.d.ts +0 -143
- package/dist/types/alpaca/streams/base-stream.d.ts.map +0 -1
- package/dist/types/alpaca/streams/crypto-stream.d.ts +0 -173
- package/dist/types/alpaca/streams/crypto-stream.d.ts.map +0 -1
- package/dist/types/alpaca/streams/index.d.ts +0 -54
- package/dist/types/alpaca/streams/index.d.ts.map +0 -1
- package/dist/types/alpaca/streams/option-stream.d.ts +0 -167
- package/dist/types/alpaca/streams/option-stream.d.ts.map +0 -1
- package/dist/types/alpaca/streams/stock-stream.d.ts +0 -176
- package/dist/types/alpaca/streams/stock-stream.d.ts.map +0 -1
- package/dist/types/alpaca/streams/stream-manager.d.ts +0 -277
- package/dist/types/alpaca/streams/stream-manager.d.ts.map +0 -1
- package/dist/types/alpaca/streams/trading-stream.d.ts +0 -186
- package/dist/types/alpaca/streams/trading-stream.d.ts.map +0 -1
- package/dist/types/alpaca/streams.d.ts +0 -88
- package/dist/types/alpaca/streams.d.ts.map +0 -1
- package/dist/types/alpaca/test-imports.d.ts +0 -7
- package/dist/types/alpaca/test-imports.d.ts.map +0 -1
- package/dist/types/alpaca/trading/account.d.ts +0 -198
- package/dist/types/alpaca/trading/account.d.ts.map +0 -1
- package/dist/types/alpaca/trading/bracket-orders.d.ts +0 -162
- package/dist/types/alpaca/trading/bracket-orders.d.ts.map +0 -1
- package/dist/types/alpaca/trading/clock.d.ts +0 -99
- package/dist/types/alpaca/trading/clock.d.ts.map +0 -1
- package/dist/types/alpaca/trading/index.d.ts +0 -15
- package/dist/types/alpaca/trading/index.d.ts.map +0 -1
- package/dist/types/alpaca/trading/oco-orders.d.ts +0 -203
- package/dist/types/alpaca/trading/oco-orders.d.ts.map +0 -1
- package/dist/types/alpaca/trading/order-utils.d.ts +0 -404
- package/dist/types/alpaca/trading/order-utils.d.ts.map +0 -1
- package/dist/types/alpaca/trading/orders.d.ts +0 -199
- package/dist/types/alpaca/trading/orders.d.ts.map +0 -1
- package/dist/types/alpaca/trading/oto-orders.d.ts +0 -282
- package/dist/types/alpaca/trading/oto-orders.d.ts.map +0 -1
- package/dist/types/alpaca/trading/positions.d.ts +0 -389
- package/dist/types/alpaca/trading/positions.d.ts.map +0 -1
- package/dist/types/alpaca/trading/smart-orders.d.ts +0 -301
- package/dist/types/alpaca/trading/smart-orders.d.ts.map +0 -1
- package/dist/types/alpaca/trading/trailing-stops.d.ts +0 -240
- package/dist/types/alpaca/trading/trailing-stops.d.ts.map +0 -1
- package/dist/types/config/api-endpoints.d.ts +0 -94
- package/dist/types/config/api-endpoints.d.ts.map +0 -1
- package/dist/types/errors/index.d.ts +0 -130
- package/dist/types/errors/index.d.ts.map +0 -1
- package/dist/types/examples/rate-limiter-example.d.ts +0 -7
- package/dist/types/examples/rate-limiter-example.d.ts.map +0 -1
- package/dist/types/http-timeout.d.ts +0 -37
- package/dist/types/http-timeout.d.ts.map +0 -1
- package/dist/types/logger.d.ts +0 -56
- package/dist/types/logger.d.ts.map +0 -1
- package/dist/types/rate-limiter.d.ts +0 -171
- package/dist/types/rate-limiter.d.ts.map +0 -1
- package/dist/types/schemas/alpaca-schemas.d.ts +0 -779
- package/dist/types/schemas/alpaca-schemas.d.ts.map +0 -1
- package/dist/types/schemas/alphavantage-schemas.d.ts +0 -255
- package/dist/types/schemas/alphavantage-schemas.d.ts.map +0 -1
- package/dist/types/schemas/index.d.ts +0 -21
- package/dist/types/schemas/index.d.ts.map +0 -1
- package/dist/types/schemas/polygon-schemas.d.ts +0 -551
- package/dist/types/schemas/polygon-schemas.d.ts.map +0 -1
- package/dist/types/schemas/validate-response.d.ts +0 -88
- package/dist/types/schemas/validate-response.d.ts.map +0 -1
- package/dist/types/utils/auth-validator.d.ts +0 -32
- package/dist/types/utils/auth-validator.d.ts.map +0 -1
- package/dist/types/utils/http-keep-alive.d.ts +0 -110
- package/dist/types/utils/http-keep-alive.d.ts.map +0 -1
- package/dist/types/utils/paginator.d.ts +0 -154
- package/dist/types/utils/paginator.d.ts.map +0 -1
- package/dist/types/utils/retry.d.ts +0 -78
- package/dist/types/utils/retry.d.ts.map +0 -1
package/dist/types/adaptic.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AssetOverviewResponse } from
|
|
2
|
-
import { type TokenProvider } from
|
|
1
|
+
import { AssetOverviewResponse } from './types';
|
|
2
|
+
import { type TokenProvider } from '@adaptic/backend-legacy';
|
|
3
3
|
export type { TokenProvider };
|
|
4
4
|
type ApolloClientType = any;
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adaptic.d.ts","sourceRoot":"","sources":["../../src/adaptic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"adaptic.d.ts","sourceRoot":"","sources":["../../src/adaptic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAiB,MAAM,SAAS,CAAC;AAC/D,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,yBAAyB,CAAC;AAGjC,YAAY,EAAE,aAAa,EAAE,CAAC;AAG9B,KAAK,gBAAgB,GAAG,GAAG,CAAC;AAQ5B;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,aAAa,GAAI,UAAU,aAAa,KAAG,IAcvD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAO,OAEnC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,QAAa,OAAO,CAAC,gBAAgB,CAWtE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAU,QAAQ,MAAM,KAAG,OAAO,CAAC,qBAAqB,CA0DtF,CAAC"}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { types } from '@adaptic/backend-legacy';
|
|
2
|
+
import { AccountConfiguration, AlpacaPosition, SimpleNews, CreateOrderParams, GetOrdersParams, AlpacaOrder, ReplaceOrderParams, AlpacaAuth, AlpacaAccountDetails, PortfolioHistoryResponse, FetchPortfolioHistoryProps, AlpacaAsset, DataFeed, LatestQuotesResponse } from './types/alpaca-types';
|
|
3
|
+
import { ApolloClientType, NormalizedCacheObject } from '@adaptic/backend-legacy';
|
|
4
|
+
/**
|
|
5
|
+
* Creates a new order in Alpaca.
|
|
6
|
+
* @param {AlpacaAuth} auth - The authentication details for Alpaca.
|
|
7
|
+
* @param {CreateOrderParams} params - The parameters for creating the order.
|
|
8
|
+
* @returns {Promise<Order>} The created order.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createOrder(auth: AlpacaAuth, params: CreateOrderParams): Promise<AlpacaOrder>;
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves a list of orders from Alpaca.
|
|
13
|
+
* @param {AlpacaAuth} auth - The authentication details for Alpaca.
|
|
14
|
+
* @param {GetOrdersParams} [params={}] - The parameters for fetching orders.
|
|
15
|
+
* @returns {Promise<AlpacaOrder[]>} The list of orders.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getOrders(auth: AlpacaAuth, params?: GetOrdersParams): Promise<AlpacaOrder[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Cancels all orders in Alpaca.
|
|
20
|
+
* @param {AlpacaAuth} auth - The authentication details for Alpaca.
|
|
21
|
+
* @returns {Promise<{ id: string; status: number }[]>} The list of canceled orders with their statuses.
|
|
22
|
+
*/
|
|
23
|
+
export declare function cancelAllOrders(auth: AlpacaAuth): Promise<{
|
|
24
|
+
id: string;
|
|
25
|
+
status: number;
|
|
26
|
+
}[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Retrieves a specific order from Alpaca.
|
|
29
|
+
* @param {AlpacaAuth} auth - The authentication details for Alpaca.
|
|
30
|
+
* @param {string} orderId - The ID of the order to retrieve.
|
|
31
|
+
* @param {boolean} [nested] - Whether to include nested details.
|
|
32
|
+
* @returns {Promise<Order>} The requested order.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getOrder(auth: AlpacaAuth, orderId: string, nested?: boolean): Promise<AlpacaOrder>;
|
|
35
|
+
/**
|
|
36
|
+
* Replaces an existing order in Alpaca.
|
|
37
|
+
* @param {AlpacaAuth} auth - The authentication details for Alpaca.
|
|
38
|
+
* @param {string} orderId - The ID of the order to replace.
|
|
39
|
+
* @param {ReplaceOrderParams} params - The parameters for replacing the order.
|
|
40
|
+
* @returns {Promise<Order>} The updated order.
|
|
41
|
+
*/
|
|
42
|
+
export declare function replaceOrder(auth: AlpacaAuth, orderId: string, params: ReplaceOrderParams): Promise<AlpacaOrder>;
|
|
43
|
+
/**
|
|
44
|
+
* Cancels a specific order in Alpaca.
|
|
45
|
+
* @param {AlpacaAuth} auth - The authentication details for Alpaca.
|
|
46
|
+
* @param {string} orderId - The ID of the order to cancel.
|
|
47
|
+
* @returns {Promise<{ success: boolean; message?: string }>} - Success status and optional message if order not found.
|
|
48
|
+
*/
|
|
49
|
+
export declare function cancelOrder(auth: AlpacaAuth, orderId: string): Promise<{
|
|
50
|
+
success: boolean;
|
|
51
|
+
message?: string;
|
|
52
|
+
}>;
|
|
53
|
+
/**
|
|
54
|
+
* Fetches news articles from Alpaca API for specified symbols.
|
|
55
|
+
* @param {string} symbols - The symbols to fetch news for (comma-separated for multiple symbols, e.g. "AAPL,MSFT,GOOG")
|
|
56
|
+
* @param {Object} params - Optional parameters for fetching news
|
|
57
|
+
* @param {AlpacaAuth} params.auth - Optional Alpaca authentication details
|
|
58
|
+
* @param {Date | string} params.start - Start date for fetching news (default is last 24 hours)
|
|
59
|
+
* @param {Date | string} params.end - End date for fetching news (default is now)
|
|
60
|
+
* @param {number} params.limit - Maximum number of articles to return (default is 10)
|
|
61
|
+
* @param {'asc' | 'desc'} params.sort - Sorting order (default is descending)
|
|
62
|
+
* @param {string} params.page_token - Token for pagination
|
|
63
|
+
* @param {boolean} params.include_content - Whether to include content in the news articles (default is true)
|
|
64
|
+
* @returns {Promise<{ news: SimpleNews[]; nextPageToken?: string }>} The fetched news articles.
|
|
65
|
+
*/
|
|
66
|
+
export declare function fetchNews(symbols: string, params?: {
|
|
67
|
+
auth?: AlpacaAuth;
|
|
68
|
+
start?: Date | string;
|
|
69
|
+
end?: Date | string;
|
|
70
|
+
limit?: number;
|
|
71
|
+
sort?: 'asc' | 'desc';
|
|
72
|
+
page_token?: string;
|
|
73
|
+
include_content?: boolean;
|
|
74
|
+
}): Promise<{
|
|
75
|
+
news: SimpleNews[];
|
|
76
|
+
nextPageToken?: string;
|
|
77
|
+
}>;
|
|
78
|
+
export interface FetchAccountDetailsProps {
|
|
79
|
+
auth?: AlpacaAuth;
|
|
80
|
+
accountId?: string;
|
|
81
|
+
client?: ApolloClientType<NormalizedCacheObject>;
|
|
82
|
+
alpacaAccount?: types.AlpacaAccount;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Fetches account details from Alpaca API.
|
|
86
|
+
* @param {FetchAccountDetailsProps} props - The properties for fetching account details.
|
|
87
|
+
* @returns {Promise<AlpacaAccountDetails>} The account details.
|
|
88
|
+
*/
|
|
89
|
+
export declare function fetchAccountDetails({ accountId, client, alpacaAccount, auth }: FetchAccountDetailsProps): Promise<AlpacaAccountDetails>;
|
|
90
|
+
/**
|
|
91
|
+
* Fetches portfolio history for one Alpaca account.
|
|
92
|
+
* @param {FetchPortfolioHistoryProps} props - The properties for fetching portfolio history.
|
|
93
|
+
* @returns {Promise<PortfolioHistoryResponse>} The portfolio history.
|
|
94
|
+
*/
|
|
95
|
+
/** Fetches portfolio history for one Alpaca account, as stored in Adaptic backend
|
|
96
|
+
*/
|
|
97
|
+
export declare function fetchPortfolioHistory({ params, accountId, client, alpacaAccount }: FetchPortfolioHistoryProps): Promise<PortfolioHistoryResponse>;
|
|
98
|
+
/**
|
|
99
|
+
* Fetches all positions for an Alpaca trading account.
|
|
100
|
+
* @param {AlpacaAuth} auth - The authentication details for Alpaca.
|
|
101
|
+
* @returns {Promise<AlpacaPosition[]>} The list of positions.
|
|
102
|
+
*/
|
|
103
|
+
export declare function fetchAllPositions(auth: AlpacaAuth): Promise<AlpacaPosition[]>;
|
|
104
|
+
/**
|
|
105
|
+
* Fetches a specific position for an Alpaca account.
|
|
106
|
+
* @param {AlpacaAuth} auth - The authentication details for Alpaca.
|
|
107
|
+
* @param {string} symbolOrAssetId - The symbol or asset ID to fetch the position for.
|
|
108
|
+
* @returns {Promise<{ position: AlpacaPosition | null; message?: string }>} The position details or null with message if not found.
|
|
109
|
+
*/
|
|
110
|
+
export declare function fetchPosition(auth: AlpacaAuth, symbolOrAssetId: string): Promise<{
|
|
111
|
+
position: AlpacaPosition | null;
|
|
112
|
+
message?: string;
|
|
113
|
+
}>;
|
|
114
|
+
/**
|
|
115
|
+
* Closes a specific position in Alpaca.
|
|
116
|
+
* @param {AlpacaAuth} auth - The authentication details for Alpaca.
|
|
117
|
+
* @param {string} symbolOrAssetId - The symbol or asset ID of the position to close.
|
|
118
|
+
* @param {Object} [params] - Optional parameters for closing the position.
|
|
119
|
+
* @param {number} [params.qty] - Quantity of shares to close (up to 9 decimal places).
|
|
120
|
+
* @param {number} [params.percentage] - Percentage of position to close (0-100, up to 9 decimal places).
|
|
121
|
+
* @param {boolean} [params.useLimitOrder] - Whether to use a limit order to close the position.
|
|
122
|
+
* @param {boolean} [params.cancelOrders] - Whether to cancel open orders for the symbol before closing.
|
|
123
|
+
* @param {number} [params.slippagePercent1] - Slippage percentage for limit orders (default: 0.1).
|
|
124
|
+
* @param {boolean} [params.extendedHours] - Whether to enable extended hours trading (default: false).
|
|
125
|
+
* @returns {Promise<AlpacaOrder>} The order created to close the position.
|
|
126
|
+
*/
|
|
127
|
+
export declare function closePosition(auth: AlpacaAuth, symbolOrAssetId: string, params?: {
|
|
128
|
+
qty?: number;
|
|
129
|
+
percentage?: number;
|
|
130
|
+
useLimitOrder?: boolean;
|
|
131
|
+
cancelOrders?: boolean;
|
|
132
|
+
slippagePercent1?: number;
|
|
133
|
+
extendedHours?: boolean;
|
|
134
|
+
}): Promise<AlpacaOrder>;
|
|
135
|
+
export declare function makeRequest(auth: AlpacaAuth, params: {
|
|
136
|
+
endpoint: string;
|
|
137
|
+
method: string;
|
|
138
|
+
body?: any;
|
|
139
|
+
queryString?: string;
|
|
140
|
+
apiBaseUrl?: string;
|
|
141
|
+
}): Promise<any>;
|
|
142
|
+
/**
|
|
143
|
+
* Create a limit order
|
|
144
|
+
* @param symbol (string) - the symbol of the order
|
|
145
|
+
* @param qty (number) - the quantity of the order
|
|
146
|
+
* @param side (string) - the side of the order
|
|
147
|
+
* @param limitPrice (number) - the limit price of the order
|
|
148
|
+
* @param position_intent (string) - the position intent of the order
|
|
149
|
+
* @param extended_hours (boolean) - whether the order is in extended hours
|
|
150
|
+
* @param client_order_id (string) - the client order id of the order
|
|
151
|
+
*/
|
|
152
|
+
export declare function createLimitOrder(auth: AlpacaAuth, params?: {
|
|
153
|
+
symbol: string;
|
|
154
|
+
qty: number;
|
|
155
|
+
side: 'buy' | 'sell';
|
|
156
|
+
limitPrice: number;
|
|
157
|
+
position_intent: 'buy_to_open' | 'buy_to_close' | 'sell_to_open' | 'sell_to_close';
|
|
158
|
+
extended_hours: boolean;
|
|
159
|
+
client_order_id?: string;
|
|
160
|
+
}): Promise<AlpacaOrder>;
|
|
161
|
+
/**
|
|
162
|
+
* Closes all positions in Alpaca.
|
|
163
|
+
* @param {AlpacaAuth} auth - The authentication details for Alpaca.
|
|
164
|
+
* @param {Object} [params] - Optional parameters for closing all positions.
|
|
165
|
+
* @param {boolean} [params.cancelOrders] - If true, cancels all open orders before closing positions.
|
|
166
|
+
* @param {boolean} [params.useLimitOrders] - If true, uses limit orders to close positions.
|
|
167
|
+
* @returns {Promise<Array<{ symbol: string; status: number; body?: Order }>>} The status of each position closure attempt.
|
|
168
|
+
*/
|
|
169
|
+
export declare function closeAllPositions(auth: AlpacaAuth, params?: {
|
|
170
|
+
cancel_orders?: boolean;
|
|
171
|
+
useLimitOrders?: boolean;
|
|
172
|
+
slippagePercent1?: number;
|
|
173
|
+
}): Promise<Array<{
|
|
174
|
+
symbol: string;
|
|
175
|
+
status: number;
|
|
176
|
+
body?: AlpacaOrder;
|
|
177
|
+
}> | void>;
|
|
178
|
+
/**
|
|
179
|
+
* Close all positions using limit orders during extended hours trading
|
|
180
|
+
* @param cancelOrders Whether to cancel related orders (default: true)
|
|
181
|
+
* @returns Promise that resolves when all positions are closed
|
|
182
|
+
*/
|
|
183
|
+
/**
|
|
184
|
+
* Closes all positions in Alpaca using limit orders during extended hours trading.
|
|
185
|
+
* @param {AlpacaAuth} auth - The authentication details for Alpaca.
|
|
186
|
+
* @param {Object} [params] - Optional parameters for closing all positions.
|
|
187
|
+
* @param {boolean} [params.cancelOrders] - If true, cancels all open orders before closing positions.
|
|
188
|
+
* @returns {Promise<Array<{ symbol: string; status: number; body?: Order }>>} The status of each position closure attempt.
|
|
189
|
+
*/
|
|
190
|
+
export declare function closeAllPositionsAfterHours(auth: AlpacaAuth, params?: {
|
|
191
|
+
cancel_orders?: boolean;
|
|
192
|
+
slippagePercent1?: number;
|
|
193
|
+
}): Promise<Array<{
|
|
194
|
+
symbol: string;
|
|
195
|
+
status: number;
|
|
196
|
+
body?: AlpacaOrder;
|
|
197
|
+
}> | void>;
|
|
198
|
+
/**
|
|
199
|
+
* Get the most recent quotes for requested symbols
|
|
200
|
+
* @param symbols Array of stock symbols to query
|
|
201
|
+
* @param feed Optional data source (sip/iex/delayed_sip)
|
|
202
|
+
* @param currency Optional currency in ISO 4217 format
|
|
203
|
+
* @returns Latest quote data for each symbol
|
|
204
|
+
* @throws Error if request fails or rate limit exceeded
|
|
205
|
+
*/
|
|
206
|
+
export declare function getLatestQuotes(auth: AlpacaAuth, params: {
|
|
207
|
+
symbols: string[];
|
|
208
|
+
feed?: DataFeed;
|
|
209
|
+
currency?: string;
|
|
210
|
+
}): Promise<LatestQuotesResponse>;
|
|
211
|
+
/**
|
|
212
|
+
* Retrieves the configuration for a specific Alpaca account.
|
|
213
|
+
* @param {types.AlpacaAccount} account - The Alpaca account to retrieve the configuration for.
|
|
214
|
+
* @returns {Promise<AccountConfiguration>} The account configuration.
|
|
215
|
+
*/
|
|
216
|
+
export declare function getConfiguration(account: types.AlpacaAccount): Promise<AccountConfiguration>;
|
|
217
|
+
/**
|
|
218
|
+
* Updates the configuration for a specific Alpaca account.
|
|
219
|
+
* @param {types.User} user - The user making the update.
|
|
220
|
+
* @param {types.AlpacaAccount} account - The Alpaca account to update.
|
|
221
|
+
* @param {AccountConfiguration} updatedConfig - The updated configuration.
|
|
222
|
+
* @returns {Promise<AccountConfiguration>} The updated account configuration.
|
|
223
|
+
*/
|
|
224
|
+
export declare function updateConfiguration(user: types.User, account: types.AlpacaAccount, updatedConfig: AccountConfiguration): Promise<AccountConfiguration>;
|
|
225
|
+
export declare function cleanContent(htmlContent: string): string;
|
|
226
|
+
/**
|
|
227
|
+
* Retrieves an asset from Alpaca by symbol or asset ID.
|
|
228
|
+
* @param {AlpacaAuth} auth - The authentication details for Alpaca.
|
|
229
|
+
* @param {string} symbolOrAssetId - The symbol or asset ID to retrieve.
|
|
230
|
+
* @returns {Promise<Asset>} The requested asset.
|
|
231
|
+
*/
|
|
232
|
+
export declare function getAsset(auth: AlpacaAuth, symbolOrAssetId: string): Promise<AlpacaAsset>;
|
|
233
|
+
//# sourceMappingURL=alpaca-functions.d.ts.map
|
|
@@ -0,0 +1 @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BAAoB,CAAC,CAuN/B;AAED,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CA0BxD;AAED;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CA4B9F"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Bar, AlpacaQuote, TimeFrame, AlpacaAsset, OptionBar,
|
|
2
|
-
import { EventEmitter } from
|
|
1
|
+
import { Bar, AlpacaQuote, TimeFrame, AlpacaAsset, OptionBar, OptionsChainParams, OptionsChainResponse, LatestOptionsTradesParams, LatestOptionsTradesResponse, LatestOptionsQuotesParams, LatestOptionsQuotesResponse, LatestQuotesResponse, LatestTradesResponse, HistoricalOptionsBarsParams, HistoricalOptionsBarsResponse, HistoricalOptionsTradesParams, HistoricalOptionsTradesResponse, OptionsSnapshotsParams, OptionsSnapshotsResponse, OptionsConditionCodesResponse, OptionsExchangeCodesResponse, OptionTickType, SimpleNews, DataFeed, StockStreamEventName, OptionStreamEventName, StockStreamEventMap, OptionStreamEventMap } from './types/alpaca-types';
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
3
|
/**
|
|
4
4
|
* Parameters for retrieving historical market data bars
|
|
5
5
|
* @see https://data.alpaca.markets/v2/stocks/bars
|
|
@@ -40,7 +40,7 @@ export interface HistoricalBarsParams {
|
|
|
40
40
|
* - asc: Oldest to newest (default)
|
|
41
41
|
* - desc: Newest to oldest
|
|
42
42
|
*/
|
|
43
|
-
sort?:
|
|
43
|
+
sort?: 'asc' | 'desc';
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* Response from historical bars endpoint
|
|
@@ -115,47 +115,32 @@ export declare class AlpacaMarketDataAPI extends EventEmitter {
|
|
|
115
115
|
private dataURL;
|
|
116
116
|
private apiURL;
|
|
117
117
|
private v1beta1url;
|
|
118
|
-
/** Whether API credentials are valid and available. False during build time when env vars are missing. */
|
|
119
|
-
private credentialsValid;
|
|
120
118
|
private stockStreamUrl;
|
|
121
119
|
private optionStreamUrl;
|
|
122
|
-
private cryptoStreamUrl;
|
|
123
120
|
private stockWs;
|
|
124
121
|
private optionWs;
|
|
125
|
-
private cryptoWs;
|
|
126
122
|
private stockSubscriptions;
|
|
127
123
|
private optionSubscriptions;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
getMode(): "sandbox" | "test" | "production";
|
|
124
|
+
setMode(mode?: 'sandbox' | 'test' | 'production'): void;
|
|
125
|
+
getMode(): 'sandbox' | 'test' | 'production';
|
|
131
126
|
private constructor();
|
|
132
127
|
static getInstance(): AlpacaMarketDataAPI;
|
|
133
128
|
on<K extends StockStreamEventName>(event: K, listener: (data: StockStreamEventMap[K]) => void): this;
|
|
134
129
|
on<K extends OptionStreamEventName>(event: K, listener: (data: OptionStreamEventMap[K]) => void): this;
|
|
135
|
-
on<K extends CryptoStreamEventName>(event: K, listener: (data: CryptoStreamEventMap[K]) => void): this;
|
|
136
130
|
emit<K extends StockStreamEventName>(event: K, data: StockStreamEventMap[K]): boolean;
|
|
137
131
|
emit<K extends OptionStreamEventName>(event: K, data: OptionStreamEventMap[K]): boolean;
|
|
138
|
-
emit<K extends CryptoStreamEventName>(event: K, data: CryptoStreamEventMap[K]): boolean;
|
|
139
132
|
private connect;
|
|
140
133
|
private sendSubscription;
|
|
141
134
|
connectStockStream(): void;
|
|
142
135
|
connectOptionStream(): void;
|
|
143
|
-
connectCryptoStream(): void;
|
|
144
136
|
disconnectStockStream(): void;
|
|
145
137
|
disconnectOptionStream(): void;
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Check if a specific stream is connected
|
|
149
|
-
* @param streamType - The type of stream to check
|
|
150
|
-
* @returns True if the stream is connected
|
|
151
|
-
*/
|
|
152
|
-
isStreamConnected(streamType: "stock" | "option" | "crypto"): boolean;
|
|
153
|
-
subscribe(streamType: "stock" | "option" | "crypto", subscriptions: {
|
|
138
|
+
subscribe(streamType: 'stock' | 'option', subscriptions: {
|
|
154
139
|
trades?: string[];
|
|
155
140
|
quotes?: string[];
|
|
156
141
|
bars?: string[];
|
|
157
142
|
}): void;
|
|
158
|
-
unsubscribe(streamType:
|
|
143
|
+
unsubscribe(streamType: 'stock' | 'option', subscriptions: {
|
|
159
144
|
trades?: string[];
|
|
160
145
|
quotes?: string[];
|
|
161
146
|
bars?: string[];
|
|
@@ -353,7 +338,7 @@ export declare class AlpacaMarketDataAPI extends EventEmitter {
|
|
|
353
338
|
* @param greeks Option greeks object
|
|
354
339
|
* @returns Formatted string with greek values
|
|
355
340
|
*/
|
|
356
|
-
static formatOptionGreeks(greeks:
|
|
341
|
+
static formatOptionGreeks(greeks: any): string;
|
|
357
342
|
/**
|
|
358
343
|
* Interprets condition codes using the provided condition codes mapping
|
|
359
344
|
* @param conditionCodes Array of condition codes from trade or quote
|
|
@@ -378,7 +363,7 @@ export declare class AlpacaMarketDataAPI extends EventEmitter {
|
|
|
378
363
|
start?: Date | string;
|
|
379
364
|
end?: Date | string;
|
|
380
365
|
limit?: number;
|
|
381
|
-
sort?:
|
|
366
|
+
sort?: 'asc' | 'desc';
|
|
382
367
|
include_content?: boolean;
|
|
383
368
|
}): Promise<SimpleNews[]>;
|
|
384
369
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpaca-market-data-api.d.ts","sourceRoot":"","sources":["../../src/alpaca-market-data-api.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,GAAG,EACH,WAAW,EACX,SAAS,EAET,WAAW,EACX,SAAS,EAET,
|
|
1
|
+
{"version":3,"file":"alpaca-market-data-api.d.ts","sourceRoot":"","sources":["../../src/alpaca-market-data-api.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,GAAG,EACH,WAAW,EACX,SAAS,EAET,WAAW,EACX,SAAS,EAET,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,EACzB,2BAA2B,EAC3B,yBAAyB,EACzB,2BAA2B,EA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,MAAM;IAYlH;;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,gBAAgB,EAAE,4BAA4B,GAAG,MAAM;IAIpG;;;;;OAKG;IACG,SAAS,CACb,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QACtB,GAAG,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;QACtB,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,GACA,OAAO,CAAC,UAAU,EAAE,CAAC;CAwEzB;AAGD,eAAO,MAAM,aAAa,qBAAoC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AlpacaAccountDetails, AlpacaCredentials, AlpacaPosition, AssetClass, GetOptionContractsParams, GetOrdersParams, OptionAccountActivity, OptionContract, OptionContractsResponse, AlpacaOrder, OrderLeg, TradeUpdate
|
|
1
|
+
import { AlpacaAccountDetails, AlpacaCredentials, AlpacaPosition, AssetClass, GetOptionContractsParams, GetOrdersParams, OptionAccountActivity, OptionContract, OptionContractsResponse, AlpacaOrder, OrderLeg, TradeUpdate } from './types/alpaca-types';
|
|
2
2
|
/**
|
|
3
3
|
Websocket example
|
|
4
4
|
const alpacaAPI = createAlpacaTradingAPI(credentials); // type AlpacaCredentials
|
|
@@ -75,7 +75,7 @@ export declare class AlpacaTradingAPI {
|
|
|
75
75
|
* @param trailPercent100 (number) - the trail percent of the order (scale 100, i.e. 0.5 = 0.5%)
|
|
76
76
|
* @param position_intent (string) - the position intent of the order
|
|
77
77
|
*/
|
|
78
|
-
createTrailingStop(symbol: string, qty: number, side:
|
|
78
|
+
createTrailingStop(symbol: string, qty: number, side: 'buy' | 'sell', trailPercent100: number, position_intent: 'buy_to_open' | 'buy_to_close' | 'sell_to_open' | 'sell_to_close'): Promise<void>;
|
|
79
79
|
/**
|
|
80
80
|
* Create a market order
|
|
81
81
|
* @param symbol (string) - the symbol of the order
|
|
@@ -83,7 +83,7 @@ export declare class AlpacaTradingAPI {
|
|
|
83
83
|
* @param side (string) - the side of the order
|
|
84
84
|
* @param position_intent (string) - the position intent of the order. Important for knowing if a position needs a trailing stop.
|
|
85
85
|
*/
|
|
86
|
-
createMarketOrder(symbol: string, qty: number, side:
|
|
86
|
+
createMarketOrder(symbol: string, qty: number, side: 'buy' | 'sell', position_intent: 'buy_to_open' | 'buy_to_close' | 'sell_to_open' | 'sell_to_close', client_order_id?: string): Promise<AlpacaOrder>;
|
|
87
87
|
/**
|
|
88
88
|
* Get the current trail percent for a symbol, assuming that it has an open position and a trailing stop order to close it. Because this relies on an orders request for one symbol, you can't do it too often.
|
|
89
89
|
* @param symbol (string) - the symbol of the order
|
|
@@ -117,7 +117,7 @@ export declare class AlpacaTradingAPI {
|
|
|
117
117
|
* @param extended_hours (boolean) - whether the order is in extended hours
|
|
118
118
|
* @param client_order_id (string) - the client order id of the order
|
|
119
119
|
*/
|
|
120
|
-
createLimitOrder(symbol: string, qty: number, side:
|
|
120
|
+
createLimitOrder(symbol: string, qty: number, side: 'buy' | 'sell', limitPrice: number, position_intent: 'buy_to_open' | 'buy_to_close' | 'sell_to_open' | 'sell_to_close', extended_hours?: boolean, client_order_id?: string): Promise<AlpacaOrder>;
|
|
121
121
|
/**
|
|
122
122
|
* Close all equities positions
|
|
123
123
|
* @param options (object) - the options for closing the positions
|
|
@@ -141,7 +141,7 @@ export declare class AlpacaTradingAPI {
|
|
|
141
141
|
* @returns Portfolio history data
|
|
142
142
|
*/
|
|
143
143
|
getPortfolioHistory(params: {
|
|
144
|
-
timeframe?:
|
|
144
|
+
timeframe?: '1Min' | '5Min' | '15Min' | '1H' | '1D';
|
|
145
145
|
period?: string;
|
|
146
146
|
extended_hours?: boolean;
|
|
147
147
|
date_end?: string;
|
|
@@ -175,7 +175,7 @@ export declare class AlpacaTradingAPI {
|
|
|
175
175
|
* @param limitPrice Limit price (required for limit orders)
|
|
176
176
|
* @returns The created order
|
|
177
177
|
*/
|
|
178
|
-
createOptionOrder(symbol: string, qty: number, side:
|
|
178
|
+
createOptionOrder(symbol: string, qty: number, side: 'buy' | 'sell', position_intent: 'buy_to_open' | 'buy_to_close' | 'sell_to_open' | 'sell_to_close', type: 'market' | 'limit', limitPrice?: number): Promise<AlpacaOrder>;
|
|
179
179
|
/**
|
|
180
180
|
* Create a multi-leg option order
|
|
181
181
|
* @param legs Array of order legs
|
|
@@ -184,13 +184,13 @@ export declare class AlpacaTradingAPI {
|
|
|
184
184
|
* @param limitPrice Limit price (required for limit orders)
|
|
185
185
|
* @returns The created multi-leg order
|
|
186
186
|
*/
|
|
187
|
-
createMultiLegOptionOrder(legs: OrderLeg[], qty: number, type:
|
|
187
|
+
createMultiLegOptionOrder(legs: OrderLeg[], qty: number, type: 'market' | 'limit', limitPrice?: number): Promise<AlpacaOrder>;
|
|
188
188
|
/**
|
|
189
189
|
* Exercise an option contract
|
|
190
190
|
* @param symbolOrContractId The symbol or ID of the option contract to exercise
|
|
191
191
|
* @returns Response from the exercise request
|
|
192
192
|
*/
|
|
193
|
-
exerciseOption(symbolOrContractId: string): Promise<
|
|
193
|
+
exerciseOption(symbolOrContractId: string): Promise<any>;
|
|
194
194
|
/**
|
|
195
195
|
* Get option positions
|
|
196
196
|
* @returns Array of option positions
|
|
@@ -203,7 +203,7 @@ export declare class AlpacaTradingAPI {
|
|
|
203
203
|
* @param date Date to filter activities (YYYY-MM-DD format)
|
|
204
204
|
* @returns Array of option account activities
|
|
205
205
|
*/
|
|
206
|
-
getOptionActivities(activityType?:
|
|
206
|
+
getOptionActivities(activityType?: 'OPEXC' | 'OPASN' | 'OPEXP', date?: string): Promise<OptionAccountActivity[]>;
|
|
207
207
|
/**
|
|
208
208
|
* Create a long call spread (buy lower strike call, sell higher strike call)
|
|
209
209
|
* @param lowerStrikeCallSymbol Symbol of the lower strike call option
|
|
@@ -251,7 +251,7 @@ export declare class AlpacaTradingAPI {
|
|
|
251
251
|
* @param limitPrice Net limit price for the roll
|
|
252
252
|
* @returns The created multi-leg order
|
|
253
253
|
*/
|
|
254
|
-
rollOptionPosition(currentOptionSymbol: string, newOptionSymbol: string, qty: number, currentPositionSide:
|
|
254
|
+
rollOptionPosition(currentOptionSymbol: string, newOptionSymbol: string, qty: number, currentPositionSide: 'buy' | 'sell', limitPrice: number): Promise<AlpacaOrder>;
|
|
255
255
|
/**
|
|
256
256
|
* Get option chain for a specific underlying symbol and expiration date
|
|
257
257
|
* @param underlyingSymbol The underlying stock symbol
|
|
@@ -297,10 +297,10 @@ export declare class AlpacaTradingAPI {
|
|
|
297
297
|
createEquitiesTrade(params: {
|
|
298
298
|
symbol: string;
|
|
299
299
|
qty: number;
|
|
300
|
-
side:
|
|
300
|
+
side: 'buy' | 'sell';
|
|
301
301
|
referencePrice?: number;
|
|
302
302
|
}, options?: {
|
|
303
|
-
type?:
|
|
303
|
+
type?: 'market' | 'limit';
|
|
304
304
|
limitPrice?: number;
|
|
305
305
|
extendedHours?: boolean;
|
|
306
306
|
useStopLoss?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpaca-trading-api.d.ts","sourceRoot":"","sources":["../../src/alpaca-trading-api.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,wBAAwB,EACxB,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,WAAW,EACX,QAAQ,EACR,WAAW,
|
|
1
|
+
{"version":3,"file":"alpaca-trading-api.d.ts","sourceRoot":"","sources":["../../src/alpaca-trading-api.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,wBAAwB,EACxB,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,WAAW,EACX,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@@
|
|
|
1
1
|
/**********************************************************************************
|
|
2
2
|
* AlphaVantage calls
|
|
3
3
|
**********************************************************************************/
|
|
4
|
-
import { AlphaVantageQuoteResponse, AVNewsArticle } from
|
|
4
|
+
import { AlphaVantageQuoteResponse, AVNewsArticle } from './types';
|
|
5
5
|
/**
|
|
6
6
|
* Fetches the current quote for a given ticker symbol.
|
|
7
7
|
* @param {string} ticker - The ticker symbol to fetch the quote for.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alphavantage.d.ts","sourceRoot":"","sources":["../../src/alphavantage.ts"],"names":[],"mappings":"AAAA;;oFAEoF;AAEpF,OAAO,
|
|
1
|
+
{"version":3,"file":"alphavantage.d.ts","sourceRoot":"","sources":["../../src/alphavantage.ts"],"names":[],"mappings":"AAAA;;oFAEoF;AAEpF,OAAO,EAAE,yBAAyB,EAAkB,aAAa,EAAE,MAAM,SAAS,CAAC;AAmBnF;;;;;;GAMG;AAEH,eAAO,MAAM,UAAU,GAAU,QAAQ,MAAM,EAAE,UAAU;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,KAAG,OAAO,CAAC,yBAAyB,CAajH,CAAC;AAEF;;;;GAIG;AAEH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAU7D;AAED;;;;GAIG;AAEH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CASrE;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,GAC1B,QAAQ,MAAM,EACd,UAAS;IAAE,KAAK,CAAC,EAAE,IAAI,CAAC;IAAC,GAAG,CAAC,EAAE,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAA;CAK/G,KACA,OAAO,CAAC,aAAa,EAAE,CAgDzB,CAAC"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* - Risk-adjusted returns
|
|
11
11
|
* - Diversification optimization
|
|
12
12
|
*/
|
|
13
|
-
import { RiskProfile, AllocationInput, AllocationRecommendation, AllocationStrategyConfig, DefaultRiskProfile } from
|
|
13
|
+
import { RiskProfile, AllocationInput, AllocationRecommendation, AllocationStrategyConfig, DefaultRiskProfile } from './types/asset-allocation-types';
|
|
14
14
|
/**
|
|
15
15
|
* Asset Allocation Engine
|
|
16
16
|
*
|
|
@@ -29,12 +29,6 @@ export declare class AssetAllocationEngine {
|
|
|
29
29
|
*/
|
|
30
30
|
private readonly defaultRiskProfiles;
|
|
31
31
|
constructor(config?: AllocationStrategyConfig);
|
|
32
|
-
/**
|
|
33
|
-
* Get default risk profile characteristics
|
|
34
|
-
* @param profile - The risk profile to retrieve
|
|
35
|
-
* @returns The default risk profile characteristics or undefined if not found
|
|
36
|
-
*/
|
|
37
|
-
getDefaultRiskProfile(profile: RiskProfile): DefaultRiskProfile | undefined;
|
|
38
32
|
/**
|
|
39
33
|
* Generate optimal asset allocation recommendation
|
|
40
34
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset-allocation-algorithm.d.ts","sourceRoot":"","sources":["../../src/asset-allocation-algorithm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAEL,WAAW,EAEX,eAAe,EACf,wBAAwB,EAMxB,wBAAwB,EAMxB,kBAAkB,EAEnB,MAAM,gCAAgC,CAAC;AAExC;;;;;;;;;GASG;AACH,qBAAa,qBAAqB;
|
|
1
|
+
{"version":3,"file":"asset-allocation-algorithm.d.ts","sourceRoot":"","sources":["../../src/asset-allocation-algorithm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAEL,WAAW,EAEX,eAAe,EACf,wBAAwB,EAMxB,wBAAwB,EAMxB,kBAAkB,EAEnB,MAAM,gCAAgC,CAAC;AAExC;;;;;;;;;GASG;AACH,qBAA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7C,KAAK,EAAE,eAAe,EACtB,MAAM,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GACzC,OAAO,CAAC,wBAAwB,CAAC,CAGnC;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,WAAW,GAAG,kBAAkB,GAAG,SAAS,CAG1F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stampede-protected-cache.d.ts","sourceRoot":"","sources":["../../../src/cache/stampede-protected-cache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stampede-protected-cache.d.ts","sourceRoot":"","sources":["../../../src/cache/stampede-protected-cache.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B;;;OAGG;IACH,KAAK,EAAE,CAAC,CAAC;IAET;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,YAAY,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAEjC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;;OAGG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CAAC,WAAW;IAQnB;;;;;;;;;;;;;OAaG;IACH,UAAU,IAAI,IAAI;CASnB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,EAC5C,OAAO,EAAE,6BAA6B,GACrC,sBAAsB,CAAC,CAAC,CAAC,CAE3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,qBAAqB,EAAE,6BAOnC,CAAC"}
|
package/dist/types/crypto.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CryptoBarsParams, CryptoBar, AlpacaNewsArticle, LatestTradesResponse, LatestQuotesResponse } from
|
|
1
|
+
import type { CryptoBarsParams, CryptoBar, AlpacaNewsArticle, LatestTradesResponse, LatestQuotesResponse } from './types/alpaca-types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Fetches cryptocurrency bars for the specified parameters.
|
|
4
4
|
* This function retrieves historical price data for multiple cryptocurrencies.
|
|
@@ -17,9 +17,9 @@ export declare function fetchBars(params: CryptoBarsParams): Promise<{
|
|
|
17
17
|
[symbol: string]: CryptoBar[];
|
|
18
18
|
}>;
|
|
19
19
|
type AlpacaAuth = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
type?:
|
|
20
|
+
APIKey: string;
|
|
21
|
+
APISecret: string;
|
|
22
|
+
type?: 'PAPER' | 'LIVE';
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
25
|
* Fetches news articles related to a specific cryptocurrency symbol.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,SAAS,EACT,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mapp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