@luisjpf/alpaca-sdk 0.3.3 → 0.3.4

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/dist/index.d.cts CHANGED
@@ -5358,7 +5358,7 @@ declare function createTradingClient(config: TradingClientConfig): {
5358
5358
  hwm?: string | null;
5359
5359
  position_intent?: components$2["schemas"]["PositionIntent"];
5360
5360
  }>;
5361
- /** Cancel an order */
5361
+ /** Cancel an order. Returns void on success (204 No Content). */
5362
5362
  cancel(orderId: string, options?: RequestOptions): Promise<void>;
5363
5363
  /** Cancel all open orders */
5364
5364
  cancelAll(options?: RequestOptions): Promise<{
@@ -5575,7 +5575,7 @@ declare function createTradingClient(config: TradingClientConfig): {
5575
5575
  name: string;
5576
5576
  assets?: components$2["schemas"]["Assets"][];
5577
5577
  }>;
5578
- /** Delete a watchlist */
5578
+ /** Delete a watchlist. Returns void on success (204 No Content). */
5579
5579
  delete(watchlistId: string, options?: RequestOptions): Promise<void>;
5580
5580
  };
5581
5581
  };
@@ -26044,7 +26044,7 @@ declare function createBrokerClient(config: BrokerClientConfig): {
26044
26044
  fee_payment_method?: string | null;
26045
26045
  ira?: components["schemas"]["TransferIRADetails"];
26046
26046
  }>;
26047
- /** Delete/cancel a transfer */
26047
+ /** Delete/cancel a transfer. Returns void on success (204 No Content). */
26048
26048
  delete(accountId: string, transferId: string, options?: RequestOptions): Promise<void>;
26049
26049
  };
26050
26050
  /** ACH relationship operations */
@@ -26075,7 +26075,7 @@ declare function createBrokerClient(config: BrokerClientConfig): {
26075
26075
  bank_routing_number?: string;
26076
26076
  nickname?: string;
26077
26077
  }>;
26078
- /** Delete an ACH relationship */
26078
+ /** Delete an ACH relationship. Returns void on success (204 No Content). */
26079
26079
  delete(accountId: string, achRelationshipId: string, options?: RequestOptions): Promise<void>;
26080
26080
  };
26081
26081
  /** Trading operations on behalf of accounts */
@@ -26254,7 +26254,7 @@ declare function createBrokerClient(config: BrokerClientConfig): {
26254
26254
  swap_fee_bps?: string;
26255
26255
  usd?: Record<string, never>;
26256
26256
  }>;
26257
- /** Cancel an order */
26257
+ /** Cancel an order. Returns void on success (204 No Content). */
26258
26258
  cancel(accountId: string, orderId: string, options?: RequestOptions): Promise<void>;
26259
26259
  /** Cancel all orders */
26260
26260
  cancelAll(accountId: string, options?: RequestOptions): Promise<{
@@ -26531,6 +26531,21 @@ interface TradeUpdate {
26531
26531
  qty?: string;
26532
26532
  timestamp?: string;
26533
26533
  }
26534
+ /**
26535
+ * Type guard to check if a message is a Trade.
26536
+ * Validates both the discriminant (T) and the symbol (S) property.
26537
+ */
26538
+ declare function isTrade(message: unknown): message is Trade;
26539
+ /**
26540
+ * Type guard to check if a message is a Quote.
26541
+ * Validates both the discriminant (T) and the symbol (S) property.
26542
+ */
26543
+ declare function isQuote(message: unknown): message is Quote;
26544
+ /**
26545
+ * Type guard to check if a message is a Bar.
26546
+ * Validates both the discriminant (T) and the symbol (S) property.
26547
+ */
26548
+ declare function isBar(message: unknown): message is Bar;
26534
26549
 
26535
26550
  /**
26536
26551
  * Stock market data streaming
@@ -26727,4 +26742,4 @@ interface AlpacaClient {
26727
26742
  */
26728
26743
  declare function createAlpacaClient(config: AlpacaClientConfig): AlpacaClient;
26729
26744
 
26730
- export { type ACHRelationship, ALPACA_URLS, type AccountActivity, type AccountCreationRequest, type AccountDocument, type AccountExtended, type AccountStatus, type AccountUpdateRequest, type Activity, type ActivityType, type AlpacaClient, type AlpacaClientConfig, type AlpacaConfig, type AlpacaEnvironment, AlpacaError, type ApiError, type ApiKeyAuth, type AuthHeaders, type AuthenticationApiError, AuthenticationError, type BasicAuth, type Account as BrokerAccount, type AccountConfigurations as BrokerAccountConfigurations, type Calendar as BrokerCalendar, type BrokerClient, type BrokerClientConfig, type Clock as BrokerClock, type NonTradeActivity as BrokerNonTradeActivity, type Order as BrokerOrder, type OrderClass as BrokerOrderClass, type OrderSide as BrokerOrderSide, type OrderType as BrokerOrderType, type Position as BrokerPosition, type TimeInForce as BrokerTimeInForce, type TradeActivity as BrokerTradeActivity, type Contact, type CorporateActions, type CreateACHRelationshipRequest, type CreateOrderRequest, type CreateTransferRequest, type CryptoBar, type CryptoOrderbook, type CryptoQuote, type CryptoSnapshot, type CryptoStream, type CryptoTrade, type Disclosures, ErrorType, type ForbiddenApiError, ForbiddenError, type Identity, type InsufficientFundsApiError, InsufficientFundsError, type MarketClosedApiError, MarketClosedError, type MarketDataClient, type MarketDataClientConfig, type MostActive, type Mover, type News, type NewsImage, type NonTradeActivity$1 as NonTradeActivity, type NotFoundApiError, NotFoundError, NotImplementedError, type OAuthAuth, type OpenApiFetchResponse, type OptionBar, type OptionGreeks, type OptionQuote, type OptionSnapshot, type OptionTrade, type OrderRequest, type OrderStatus, type OwnerDocument, type PatchOrderRequest, type PortfolioHistory, type RateLimitApiError, RateLimitError, type RequestOptions, type ResolvedAlpacaConfig, type Result, type ServerApiError, ServerError, type StockAuction, type StockBar, type StockQuote, type StockSnapshot, type StockStream, type StockTrade, type StreamConfig, type StreamState, type TradeAccount, type TradeUpdatesStream, type Account$1 as TradingAccount, type AccountConfigurations$1 as TradingAccountConfigurations, type TradingActivity, type Asset as TradingAsset, type Calendar$1 as TradingCalendar, type TradingClient, type TradingClientConfig, type Clock$1 as TradingClock, type Order$1 as TradingOrder, type OrderClass$1 as TradingOrderClass, type OrderSide$1 as TradingOrderSide, type OrderType$1 as TradingOrderType, type Position$1 as TradingPosition, type TimeInForce$1 as TradingTimeInForce, type Transfer, type TransferDirection, type TransferType, type TrustedContact, type UnknownApiError, type ValidationApiError, ValidationError, type Watchlist, type WebSocketAuthMessage, createAlpacaClient, createAlpacaError, createApiError, createApiFetch, createApiKeyAuth, createBasicAuth, createBrokerClient, createCryptoStream, createHeaders, createMarketDataClient, createOAuthAuth, createStockStream, createTradeUpdatesStream, createTradingClient, createWebSocketAuth, createWebSocketOAuth, err, fetchWithRetry, isApiError, isAuthenticationError, isInsufficientFundsError, isMarketClosedError, isNotFoundError, isRateLimitError, isServerError, isValidationError, ok, resolveConfig, toApiError, unwrap, unwrapList, unwrapOptional };
26745
+ export { type ACHRelationship, ALPACA_URLS, type AccountActivity, type AccountCreationRequest, type AccountDocument, type AccountExtended, type AccountStatus, type AccountUpdateRequest, type Activity, type ActivityType, type AlpacaClient, type AlpacaClientConfig, type AlpacaConfig, type AlpacaEnvironment, AlpacaError, type ApiError, type ApiKeyAuth, type AuthHeaders, type AuthenticationApiError, AuthenticationError, type Bar, type BasicAuth, type Account as BrokerAccount, type AccountConfigurations as BrokerAccountConfigurations, type Calendar as BrokerCalendar, type BrokerClient, type BrokerClientConfig, type Clock as BrokerClock, type NonTradeActivity as BrokerNonTradeActivity, type Order as BrokerOrder, type OrderClass as BrokerOrderClass, type OrderSide as BrokerOrderSide, type OrderType as BrokerOrderType, type Position as BrokerPosition, type TimeInForce as BrokerTimeInForce, type TradeActivity as BrokerTradeActivity, type Contact, type CorporateActions, type CreateACHRelationshipRequest, type CreateOrderRequest, type CreateTransferRequest, type CryptoBar, type CryptoOrderbook, type CryptoQuote, type CryptoSnapshot, type CryptoStream, type CryptoTrade, type Disclosures, ErrorType, type ForbiddenApiError, ForbiddenError, type Identity, type InsufficientFundsApiError, InsufficientFundsError, type MarketClosedApiError, MarketClosedError, type MarketDataClient, type MarketDataClientConfig, type MostActive, type Mover, type News, type NewsImage, type NonTradeActivity$1 as NonTradeActivity, type NotFoundApiError, NotFoundError, NotImplementedError, type OAuthAuth, type OpenApiFetchResponse, type OptionBar, type OptionGreeks, type OptionQuote, type OptionSnapshot, type OptionTrade, type OrderRequest, type OrderStatus, type OwnerDocument, type PatchOrderRequest, type PortfolioHistory, type Quote, type RateLimitApiError, RateLimitError, type RequestOptions, type ResolvedAlpacaConfig, type Result, type ServerApiError, ServerError, type StockAuction, type StockBar, type StockQuote, type StockSnapshot, type StockStream, type StockTrade, type StreamConfig, type StreamState, type Trade, type TradeAccount, type TradeUpdate, type TradeUpdatesStream, type Account$1 as TradingAccount, type AccountConfigurations$1 as TradingAccountConfigurations, type TradingActivity, type Asset as TradingAsset, type Calendar$1 as TradingCalendar, type TradingClient, type TradingClientConfig, type Clock$1 as TradingClock, type Order$1 as TradingOrder, type OrderClass$1 as TradingOrderClass, type OrderSide$1 as TradingOrderSide, type OrderType$1 as TradingOrderType, type Position$1 as TradingPosition, type TimeInForce$1 as TradingTimeInForce, type Transfer, type TransferDirection, type TransferType, type TrustedContact, type UnknownApiError, type ValidationApiError, ValidationError, type Watchlist, type WebSocketAuthMessage, createAlpacaClient, createAlpacaError, createApiError, createApiFetch, createApiKeyAuth, createBasicAuth, createBrokerClient, createCryptoStream, createHeaders, createMarketDataClient, createOAuthAuth, createStockStream, createTradeUpdatesStream, createTradingClient, createWebSocketAuth, createWebSocketOAuth, err, fetchWithRetry, isApiError, isAuthenticationError, isBar, isInsufficientFundsError, isMarketClosedError, isNotFoundError, isQuote, isRateLimitError, isServerError, isTrade, isValidationError, ok, resolveConfig, toApiError, unwrap, unwrapList, unwrapOptional };
package/dist/index.d.ts CHANGED
@@ -5358,7 +5358,7 @@ declare function createTradingClient(config: TradingClientConfig): {
5358
5358
  hwm?: string | null;
5359
5359
  position_intent?: components$2["schemas"]["PositionIntent"];
5360
5360
  }>;
5361
- /** Cancel an order */
5361
+ /** Cancel an order. Returns void on success (204 No Content). */
5362
5362
  cancel(orderId: string, options?: RequestOptions): Promise<void>;
5363
5363
  /** Cancel all open orders */
5364
5364
  cancelAll(options?: RequestOptions): Promise<{
@@ -5575,7 +5575,7 @@ declare function createTradingClient(config: TradingClientConfig): {
5575
5575
  name: string;
5576
5576
  assets?: components$2["schemas"]["Assets"][];
5577
5577
  }>;
5578
- /** Delete a watchlist */
5578
+ /** Delete a watchlist. Returns void on success (204 No Content). */
5579
5579
  delete(watchlistId: string, options?: RequestOptions): Promise<void>;
5580
5580
  };
5581
5581
  };
@@ -26044,7 +26044,7 @@ declare function createBrokerClient(config: BrokerClientConfig): {
26044
26044
  fee_payment_method?: string | null;
26045
26045
  ira?: components["schemas"]["TransferIRADetails"];
26046
26046
  }>;
26047
- /** Delete/cancel a transfer */
26047
+ /** Delete/cancel a transfer. Returns void on success (204 No Content). */
26048
26048
  delete(accountId: string, transferId: string, options?: RequestOptions): Promise<void>;
26049
26049
  };
26050
26050
  /** ACH relationship operations */
@@ -26075,7 +26075,7 @@ declare function createBrokerClient(config: BrokerClientConfig): {
26075
26075
  bank_routing_number?: string;
26076
26076
  nickname?: string;
26077
26077
  }>;
26078
- /** Delete an ACH relationship */
26078
+ /** Delete an ACH relationship. Returns void on success (204 No Content). */
26079
26079
  delete(accountId: string, achRelationshipId: string, options?: RequestOptions): Promise<void>;
26080
26080
  };
26081
26081
  /** Trading operations on behalf of accounts */
@@ -26254,7 +26254,7 @@ declare function createBrokerClient(config: BrokerClientConfig): {
26254
26254
  swap_fee_bps?: string;
26255
26255
  usd?: Record<string, never>;
26256
26256
  }>;
26257
- /** Cancel an order */
26257
+ /** Cancel an order. Returns void on success (204 No Content). */
26258
26258
  cancel(accountId: string, orderId: string, options?: RequestOptions): Promise<void>;
26259
26259
  /** Cancel all orders */
26260
26260
  cancelAll(accountId: string, options?: RequestOptions): Promise<{
@@ -26531,6 +26531,21 @@ interface TradeUpdate {
26531
26531
  qty?: string;
26532
26532
  timestamp?: string;
26533
26533
  }
26534
+ /**
26535
+ * Type guard to check if a message is a Trade.
26536
+ * Validates both the discriminant (T) and the symbol (S) property.
26537
+ */
26538
+ declare function isTrade(message: unknown): message is Trade;
26539
+ /**
26540
+ * Type guard to check if a message is a Quote.
26541
+ * Validates both the discriminant (T) and the symbol (S) property.
26542
+ */
26543
+ declare function isQuote(message: unknown): message is Quote;
26544
+ /**
26545
+ * Type guard to check if a message is a Bar.
26546
+ * Validates both the discriminant (T) and the symbol (S) property.
26547
+ */
26548
+ declare function isBar(message: unknown): message is Bar;
26534
26549
 
26535
26550
  /**
26536
26551
  * Stock market data streaming
@@ -26727,4 +26742,4 @@ interface AlpacaClient {
26727
26742
  */
26728
26743
  declare function createAlpacaClient(config: AlpacaClientConfig): AlpacaClient;
26729
26744
 
26730
- export { type ACHRelationship, ALPACA_URLS, type AccountActivity, type AccountCreationRequest, type AccountDocument, type AccountExtended, type AccountStatus, type AccountUpdateRequest, type Activity, type ActivityType, type AlpacaClient, type AlpacaClientConfig, type AlpacaConfig, type AlpacaEnvironment, AlpacaError, type ApiError, type ApiKeyAuth, type AuthHeaders, type AuthenticationApiError, AuthenticationError, type BasicAuth, type Account as BrokerAccount, type AccountConfigurations as BrokerAccountConfigurations, type Calendar as BrokerCalendar, type BrokerClient, type BrokerClientConfig, type Clock as BrokerClock, type NonTradeActivity as BrokerNonTradeActivity, type Order as BrokerOrder, type OrderClass as BrokerOrderClass, type OrderSide as BrokerOrderSide, type OrderType as BrokerOrderType, type Position as BrokerPosition, type TimeInForce as BrokerTimeInForce, type TradeActivity as BrokerTradeActivity, type Contact, type CorporateActions, type CreateACHRelationshipRequest, type CreateOrderRequest, type CreateTransferRequest, type CryptoBar, type CryptoOrderbook, type CryptoQuote, type CryptoSnapshot, type CryptoStream, type CryptoTrade, type Disclosures, ErrorType, type ForbiddenApiError, ForbiddenError, type Identity, type InsufficientFundsApiError, InsufficientFundsError, type MarketClosedApiError, MarketClosedError, type MarketDataClient, type MarketDataClientConfig, type MostActive, type Mover, type News, type NewsImage, type NonTradeActivity$1 as NonTradeActivity, type NotFoundApiError, NotFoundError, NotImplementedError, type OAuthAuth, type OpenApiFetchResponse, type OptionBar, type OptionGreeks, type OptionQuote, type OptionSnapshot, type OptionTrade, type OrderRequest, type OrderStatus, type OwnerDocument, type PatchOrderRequest, type PortfolioHistory, type RateLimitApiError, RateLimitError, type RequestOptions, type ResolvedAlpacaConfig, type Result, type ServerApiError, ServerError, type StockAuction, type StockBar, type StockQuote, type StockSnapshot, type StockStream, type StockTrade, type StreamConfig, type StreamState, type TradeAccount, type TradeUpdatesStream, type Account$1 as TradingAccount, type AccountConfigurations$1 as TradingAccountConfigurations, type TradingActivity, type Asset as TradingAsset, type Calendar$1 as TradingCalendar, type TradingClient, type TradingClientConfig, type Clock$1 as TradingClock, type Order$1 as TradingOrder, type OrderClass$1 as TradingOrderClass, type OrderSide$1 as TradingOrderSide, type OrderType$1 as TradingOrderType, type Position$1 as TradingPosition, type TimeInForce$1 as TradingTimeInForce, type Transfer, type TransferDirection, type TransferType, type TrustedContact, type UnknownApiError, type ValidationApiError, ValidationError, type Watchlist, type WebSocketAuthMessage, createAlpacaClient, createAlpacaError, createApiError, createApiFetch, createApiKeyAuth, createBasicAuth, createBrokerClient, createCryptoStream, createHeaders, createMarketDataClient, createOAuthAuth, createStockStream, createTradeUpdatesStream, createTradingClient, createWebSocketAuth, createWebSocketOAuth, err, fetchWithRetry, isApiError, isAuthenticationError, isInsufficientFundsError, isMarketClosedError, isNotFoundError, isRateLimitError, isServerError, isValidationError, ok, resolveConfig, toApiError, unwrap, unwrapList, unwrapOptional };
26745
+ export { type ACHRelationship, ALPACA_URLS, type AccountActivity, type AccountCreationRequest, type AccountDocument, type AccountExtended, type AccountStatus, type AccountUpdateRequest, type Activity, type ActivityType, type AlpacaClient, type AlpacaClientConfig, type AlpacaConfig, type AlpacaEnvironment, AlpacaError, type ApiError, type ApiKeyAuth, type AuthHeaders, type AuthenticationApiError, AuthenticationError, type Bar, type BasicAuth, type Account as BrokerAccount, type AccountConfigurations as BrokerAccountConfigurations, type Calendar as BrokerCalendar, type BrokerClient, type BrokerClientConfig, type Clock as BrokerClock, type NonTradeActivity as BrokerNonTradeActivity, type Order as BrokerOrder, type OrderClass as BrokerOrderClass, type OrderSide as BrokerOrderSide, type OrderType as BrokerOrderType, type Position as BrokerPosition, type TimeInForce as BrokerTimeInForce, type TradeActivity as BrokerTradeActivity, type Contact, type CorporateActions, type CreateACHRelationshipRequest, type CreateOrderRequest, type CreateTransferRequest, type CryptoBar, type CryptoOrderbook, type CryptoQuote, type CryptoSnapshot, type CryptoStream, type CryptoTrade, type Disclosures, ErrorType, type ForbiddenApiError, ForbiddenError, type Identity, type InsufficientFundsApiError, InsufficientFundsError, type MarketClosedApiError, MarketClosedError, type MarketDataClient, type MarketDataClientConfig, type MostActive, type Mover, type News, type NewsImage, type NonTradeActivity$1 as NonTradeActivity, type NotFoundApiError, NotFoundError, NotImplementedError, type OAuthAuth, type OpenApiFetchResponse, type OptionBar, type OptionGreeks, type OptionQuote, type OptionSnapshot, type OptionTrade, type OrderRequest, type OrderStatus, type OwnerDocument, type PatchOrderRequest, type PortfolioHistory, type Quote, type RateLimitApiError, RateLimitError, type RequestOptions, type ResolvedAlpacaConfig, type Result, type ServerApiError, ServerError, type StockAuction, type StockBar, type StockQuote, type StockSnapshot, type StockStream, type StockTrade, type StreamConfig, type StreamState, type Trade, type TradeAccount, type TradeUpdate, type TradeUpdatesStream, type Account$1 as TradingAccount, type AccountConfigurations$1 as TradingAccountConfigurations, type TradingActivity, type Asset as TradingAsset, type Calendar$1 as TradingCalendar, type TradingClient, type TradingClientConfig, type Clock$1 as TradingClock, type Order$1 as TradingOrder, type OrderClass$1 as TradingOrderClass, type OrderSide$1 as TradingOrderSide, type OrderType$1 as TradingOrderType, type Position$1 as TradingPosition, type TimeInForce$1 as TradingTimeInForce, type Transfer, type TransferDirection, type TransferType, type TrustedContact, type UnknownApiError, type ValidationApiError, ValidationError, type Watchlist, type WebSocketAuthMessage, createAlpacaClient, createAlpacaError, createApiError, createApiFetch, createApiKeyAuth, createBasicAuth, createBrokerClient, createCryptoStream, createHeaders, createMarketDataClient, createOAuthAuth, createStockStream, createTradeUpdatesStream, createTradingClient, createWebSocketAuth, createWebSocketOAuth, err, fetchWithRetry, isApiError, isAuthenticationError, isBar, isInsufficientFundsError, isMarketClosedError, isNotFoundError, isQuote, isRateLimitError, isServerError, isTrade, isValidationError, ok, resolveConfig, toApiError, unwrap, unwrapList, unwrapOptional };