New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@master-chief/alpaca-ts

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@master-chief/alpaca-ts - npm Package Compare versions

Comparing version 7.0.13-alpha to 7.0.14-alpha

dist/services/stock.d.ts

18

dist/Client.d.ts

@@ -73,3 +73,3 @@ import type { BaseHttpRequest } from "./rest/BaseHttpRequest.js";

}) => import("./index.js").CancelablePromise<import("./index.js").Order>;
getStocksBars: (args_0: {
getStockBars: (args_0: {
symbols: string;

@@ -84,7 +84,7 @@ timeframe: string;

}) => import("./index.js").CancelablePromise<import("./index.js").MultiBarsResponse>;
getStocksBarsLatest: (args_0: {
getStockBarsLatest: (args_0: {
symbols: string;
feed?: "iex" | "sip" | "otc";
}) => import("./index.js").CancelablePromise<import("./index.js").LatestMultiBarsResponse>;
getStocksTrades: (args_0: {
getStockTrades: (args_0: {
symbols: string;

@@ -97,7 +97,7 @@ start?: string;

}) => import("./index.js").CancelablePromise<import("./index.js").MultiTradesResponse>;
getStocksTradesLatest: (args_0: {
getStockTradesLatest: (args_0: {
symbols: string;
feed?: "iex" | "sip" | "otc";
}) => import("./index.js").CancelablePromise<import("./index.js").LatestMultiTradesResponse>;
getStocksQuotes: (args_0: {
getStockQuotes: (args_0: {
symbols: string;

@@ -110,12 +110,12 @@ start?: string;

}) => import("./index.js").CancelablePromise<import("./index.js").MultiQuotesReponse>;
getStocksQuotesLatest: (args_0: {
getStockQuotesLatest: (args_0: {
symbols: string;
feed?: "iex" | "sip" | "otc";
}) => import("./index.js").CancelablePromise<import("./index.js").LatestMultiQuotesResponse>;
getStocksSnapshots: (args_0: {
getStockSnapshots: (args_0: {
symbols: string;
feed?: "iex" | "sip" | "otc";
}) => import("./index.js").CancelablePromise<import("./index.js").MultiSnapshotResponse>;
getStocksMetaExchanges: () => import("./index.js").CancelablePromise<import("./index.js").ExchangesResponse>;
getStocksMetaConditions: (args_0: {
getStockMetaExchanges: () => import("./index.js").CancelablePromise<import("./index.js").ExchangesResponse>;
getStockMetaConditions: (args_0: {
type: "trade" | "quote";

@@ -122,0 +122,0 @@ tape: "A" | "B" | "C";

@@ -0,5 +1,5 @@

import { Config } from "../Client.js";
import { BaseHttpRequest } from "./BaseHttpRequest.js";
import type { ApiRequestOptions } from "./ApiRequestOptions.js";
import { BaseHttpRequest } from "./BaseHttpRequest.js";
import type { CancelablePromise } from "./CancelablePromise.js";
import { Config } from "../Client.js";
export declare class AxiosHttpRequest extends BaseHttpRequest {

@@ -6,0 +6,0 @@ constructor(config: Config);

@@ -0,4 +1,4 @@

import { Config } from "../Client.js";
import type { ApiRequestOptions } from "./ApiRequestOptions.js";
import type { CancelablePromise } from "./CancelablePromise.js";
import { Config } from "../Client.js";
export declare abstract class BaseHttpRequest {

@@ -5,0 +5,0 @@ readonly config: Config;

@@ -6,3 +6,27 @@ import { BaseHttpRequest } from "./BaseHttpRequest.js";

};
/**
* The `prewrap` function takes an object containing methods and a BaseHttpRequest instance, and returns a new object with the same structure but with the methods "wrapped" to include the BaseHttpRequest as their first argument. Essentially, it's transforming the methods so that they automatically include the given httpRequest when called.
*
* This function makes it convenient to bind a specific HTTP request object to a set of methods, so that the methods can easily access it without having to include it as a parameter every time.
*
* The implementation involves recursion, which allows this wrapping to be applied to methods that are deeply nested within objects.
*
* @param methods - An object containing methods (functions) that need to be wrapped.
* @param httpRequest - The BaseHttpRequest instance that should be the first argument of all the methods.
* @returns A new object with the same structure as the input, but with the methods wrapped to include `httpRequest` as their first argument.
*
* @template T - The type of the object containing the methods to be wrapped.
*
* @example
* const apiMethods = {
* getUser: (request, userId) => request.get(`/user/${userId}`),
* posts: {
* getPost: (request, postId) => request.get(`/post/${postId}`),
* },
* };
* const wrappedMethods = prewrap(apiMethods, myHttpRequest);
* wrappedMethods.getUser(userId); // myHttpRequest is automatically included
* wrappedMethods.posts.getPost(postId); // myHttpRequest is automatically included
*/
export declare function prewrap<T>(methods: T, httpRequest: BaseHttpRequest): PreWrapped<T>;
export {};

@@ -0,1 +1,25 @@

/**
* The `prewrap` function takes an object containing methods and a BaseHttpRequest instance, and returns a new object with the same structure but with the methods "wrapped" to include the BaseHttpRequest as their first argument. Essentially, it's transforming the methods so that they automatically include the given httpRequest when called.
*
* This function makes it convenient to bind a specific HTTP request object to a set of methods, so that the methods can easily access it without having to include it as a parameter every time.
*
* The implementation involves recursion, which allows this wrapping to be applied to methods that are deeply nested within objects.
*
* @param methods - An object containing methods (functions) that need to be wrapped.
* @param httpRequest - The BaseHttpRequest instance that should be the first argument of all the methods.
* @returns A new object with the same structure as the input, but with the methods wrapped to include `httpRequest` as their first argument.
*
* @template T - The type of the object containing the methods to be wrapped.
*
* @example
* const apiMethods = {
* getUser: (request, userId) => request.get(`/user/${userId}`),
* posts: {
* getPost: (request, postId) => request.get(`/post/${postId}`),
* },
* };
* const wrappedMethods = prewrap(apiMethods, myHttpRequest);
* wrappedMethods.getUser(userId); // myHttpRequest is automatically included
* wrappedMethods.posts.getPost(postId); // myHttpRequest is automatically included
*/
export function prewrap(methods, httpRequest) {

@@ -2,0 +26,0 @@ const wrappedMethods = {};

@@ -0,8 +1,8 @@

import FormData from "form-data";
import type { AxiosResponse, AxiosInstance } from "axios";
import FormData from "form-data";
import type { ApiRequestOptions } from "./ApiRequestOptions.js";
import type { ApiResult } from "./ApiResult.js";
import { Config } from "../Client.js";
import { CancelablePromise } from "./CancelablePromise.js";
import type { OnCancel } from "./CancelablePromise.js";
import { Config } from "../Client.js";
import type { ApiResult } from "./ApiResult.js";
import type { ApiRequestOptions } from "./ApiRequestOptions.js";
export declare const isDefined: <T>(value: T) => value is Exclude<T, null>;

@@ -9,0 +9,0 @@ export declare const isString: (value: any) => value is string;

@@ -0,8 +1,8 @@

import { Account } from "../entities/Account.js";
import { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import { PortfolioHistory } from "../entities/PortfolioHistory.js";
import { CancelablePromise } from "../rest/CancelablePromise.js";
import { TradingActivities } from "../entities/TradingActivities.js";
import { NonTradeActivities } from "../entities/NonTradeActivities.js";
import { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import { CancelablePromise } from "../rest/CancelablePromise.js";
import { AccountConfigurations } from "../entities/AccountConfigurations.js";
import { PortfolioHistory } from "../entities/PortfolioHistory.js";
import { Account } from "../entities/Account.js";
/**

@@ -9,0 +9,0 @@ * Get account activities of one type

@@ -0,4 +1,4 @@

import { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import type { Assets } from "../entities/Assets.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
/**

@@ -5,0 +5,0 @@ * Get Assets

@@ -0,4 +1,4 @@

import { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import type { Calendar } from "../entities/Calendar.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
/**

@@ -5,0 +5,0 @@ * Get Market Calendar info

@@ -0,4 +1,4 @@

import { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import type { Clock } from "../entities/Clock.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
/**

@@ -5,0 +5,0 @@ * Get Market Clock info

@@ -0,10 +1,10 @@

import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import type { MultiBarsResponse } from "../entities/MultiBarsResponse.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import type { MultiQuotesReponse } from "../entities/MultiQuotesReponse.js";
import type { MultiTradesResponse } from "../entities/MultiTradesResponse.js";
import type { MultiSnapshotResponse } from "../entities/MultiSnapshotResponse.js";
import type { LatestMultiBarsResponse } from "../entities/LatestMultiBarsResponse.js";
import type { LatestMultiQuotesResponse } from "../entities/LatestMultiQuotesResponse.js";
import type { LatestMultiTradesResponse } from "../entities/LatestMultiTradesResponse.js";
import type { MultiBarsResponse } from "../entities/MultiBarsResponse.js";
import type { MultiQuotesReponse } from "../entities/MultiQuotesReponse.js";
import type { MultiSnapshotResponse } from "../entities/MultiSnapshotResponse.js";
import type { MultiTradesResponse } from "../entities/MultiTradesResponse.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
/**

@@ -11,0 +11,0 @@ * Get Trade data for multiple crypto symbols

@@ -76,3 +76,3 @@ import { cloneDeep } from "lodash-es";

method: "GET",
url: "/v1beta3/crypto/us/bars/latest",
url: "/v1beta3/crypto/us/latest/bars",
query: {

@@ -79,0 +79,0 @@ symbols,

@@ -12,3 +12,3 @@ import * as account from "./account.js";

import * as logos from "./logos.js";
import * as stocks from "./stocks.js";
import * as stocks from "./stock.js";
declare const _default: {

@@ -15,0 +15,0 @@ account: typeof account;

@@ -12,3 +12,3 @@ import * as account from "./account.js";

import * as logos from "./logos.js";
import * as stocks from "./stocks.js";
import * as stocks from "./stock.js";
export default {

@@ -15,0 +15,0 @@ account,

import type { GetNewsResponse } from "../entities/GetNewsResponse.js";
import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
/**

@@ -5,0 +5,0 @@ * News API

@@ -1,6 +0,6 @@

import type { CanceledOrderResponse } from "../entities/CanceledOrderResponse.js";
import type { Order } from "../entities/Order.js";
import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import type { PatchOrderRequest } from "../entities/PatchOrderRequest.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import type { CanceledOrderResponse } from "../entities/CanceledOrderResponse.js";
/**

@@ -7,0 +7,0 @@ * Order

import type { Order } from "../entities/Order.js";
import type { Position } from "../entities/Position.js";
import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import type { PositionClosedReponse } from "../entities/PositionClosedReponse.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
/**

@@ -7,0 +7,0 @@ * All Open Positions

@@ -0,4 +1,4 @@

import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import type { MarketMoversResponse } from "../entities/MarketMoversResponse.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
/**

@@ -5,0 +5,0 @@ * Get Top Market Movers by Market type

{
"name": "@master-chief/alpaca-ts",
"version": "7.0.13-alpha",
"version": "7.0.14-alpha",
"description": "A TypeScript Node.js library for the https://alpaca.markets REST API and WebSocket streams.",

@@ -5,0 +5,0 @@ "author": "117",

@@ -1,7 +0,8 @@

import type { ApiRequestOptions } from "./ApiRequestOptions.js";
import { Config } from "../Client.js";
import { BaseHttpRequest } from "./BaseHttpRequest.js";
import type { CancelablePromise } from "./CancelablePromise.js";
import { request as __request } from "./request.js";
import { Config } from "../Client.js";
import type { ApiRequestOptions } from "./ApiRequestOptions.js";
import type { CancelablePromise } from "./CancelablePromise.js";
export class AxiosHttpRequest extends BaseHttpRequest {

@@ -8,0 +9,0 @@ constructor(config: Config) {

@@ -0,4 +1,5 @@

import { Config } from "../Client.js";
import type { ApiRequestOptions } from "./ApiRequestOptions.js";
import type { CancelablePromise } from "./CancelablePromise.js";
import { Config } from "../Client.js";

@@ -5,0 +6,0 @@ export abstract class BaseHttpRequest {

@@ -13,2 +13,27 @@ import { BaseHttpRequest } from "./BaseHttpRequest.js";

/**
* The `prewrap` function takes an object containing methods and a BaseHttpRequest instance, and returns a new object with the same structure but with the methods "wrapped" to include the BaseHttpRequest as their first argument. Essentially, it's transforming the methods so that they automatically include the given httpRequest when called.
*
* This function makes it convenient to bind a specific HTTP request object to a set of methods, so that the methods can easily access it without having to include it as a parameter every time.
*
* The implementation involves recursion, which allows this wrapping to be applied to methods that are deeply nested within objects.
*
* @param methods - An object containing methods (functions) that need to be wrapped.
* @param httpRequest - The BaseHttpRequest instance that should be the first argument of all the methods.
* @returns A new object with the same structure as the input, but with the methods wrapped to include `httpRequest` as their first argument.
*
* @template T - The type of the object containing the methods to be wrapped.
*
* @example
* const apiMethods = {
* getUser: (request, userId) => request.get(`/user/${userId}`),
* posts: {
* getPost: (request, postId) => request.get(`/post/${postId}`),
* },
* };
* const wrappedMethods = prewrap(apiMethods, myHttpRequest);
* wrappedMethods.getUser(userId); // myHttpRequest is automatically included
* wrappedMethods.posts.getPost(postId); // myHttpRequest is automatically included
*/
export function prewrap<T>(

@@ -15,0 +40,0 @@ methods: T,

import axios from "axios";
import FormData from "form-data";
import type {

@@ -8,10 +10,10 @@ AxiosError,

} from "axios";
import FormData from "form-data";
import { Config } from "../Client.js";
import { ApiError } from "./ApiError.js";
import type { ApiRequestOptions } from "./ApiRequestOptions.js";
import type { ApiResult } from "./ApiResult.js";
import { CancelablePromise } from "./CancelablePromise.js";
import type { OnCancel } from "./CancelablePromise.js";
import { Config } from "../Client.js";
import type { ApiResult } from "./ApiResult.js";
import type { ApiRequestOptions } from "./ApiRequestOptions.js";

@@ -18,0 +20,0 @@ export const isDefined = <T>(

@@ -0,8 +1,8 @@

import { Account } from "../entities/Account.js";
import { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import { PortfolioHistory } from "../entities/PortfolioHistory.js";
import { CancelablePromise } from "../rest/CancelablePromise.js";
import { TradingActivities } from "../entities/TradingActivities.js";
import { NonTradeActivities } from "../entities/NonTradeActivities.js";
import { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import { CancelablePromise } from "../rest/CancelablePromise.js";
import { AccountConfigurations } from "../entities/AccountConfigurations.js";
import { PortfolioHistory } from "../entities/PortfolioHistory.js";
import { Account } from "../entities/Account.js";

@@ -9,0 +9,0 @@ /**

@@ -0,6 +1,6 @@

import { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import type { Assets } from "../entities/Assets.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
/**

@@ -7,0 +7,0 @@ * Get Assets

@@ -0,6 +1,6 @@

import { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import type { Calendar } from "../entities/Calendar.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
/**

@@ -7,0 +7,0 @@ * Get Market Calendar info

@@ -0,6 +1,6 @@

import { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import type { Clock } from "../entities/Clock.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
/**

@@ -7,0 +7,0 @@ * Get Market Clock info

@@ -0,11 +1,12 @@

import { cloneDeep } from "lodash-es";
import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import type { MultiBarsResponse } from "../entities/MultiBarsResponse.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import type { MultiQuotesReponse } from "../entities/MultiQuotesReponse.js";
import type { MultiTradesResponse } from "../entities/MultiTradesResponse.js";
import type { MultiSnapshotResponse } from "../entities/MultiSnapshotResponse.js";
import type { LatestMultiBarsResponse } from "../entities/LatestMultiBarsResponse.js";
import type { LatestMultiQuotesResponse } from "../entities/LatestMultiQuotesResponse.js";
import type { LatestMultiTradesResponse } from "../entities/LatestMultiTradesResponse.js";
import type { MultiBarsResponse } from "../entities/MultiBarsResponse.js";
import type { MultiQuotesReponse } from "../entities/MultiQuotesReponse.js";
import type { MultiSnapshotResponse } from "../entities/MultiSnapshotResponse.js";
import type { MultiTradesResponse } from "../entities/MultiTradesResponse.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import { cloneDeep } from "lodash-es";

@@ -200,3 +201,3 @@ const BASE = "https://data.alpaca.markets";

method: "GET",
url: "/v1beta3/crypto/us/bars/latest",
url: "/v1beta3/crypto/us/latest/bars",
query: {

@@ -203,0 +204,0 @@ symbols,

@@ -12,3 +12,3 @@ import * as account from "./account.js";

import * as logos from "./logos.js";
import * as stocks from "./stocks.js";
import * as stocks from "./stock.js";

@@ -15,0 +15,0 @@ export default {

import type { GetNewsResponse } from "../entities/GetNewsResponse.js";
import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js";

@@ -6,0 +5,0 @@ /**

@@ -1,7 +0,6 @@

import type { CanceledOrderResponse } from "../entities/CanceledOrderResponse.js";
import type { Order } from "../entities/Order.js";
import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import type { PatchOrderRequest } from "../entities/PatchOrderRequest.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import type { CanceledOrderResponse } from "../entities/CanceledOrderResponse.js";

@@ -8,0 +7,0 @@ /**

import type { Order } from "../entities/Order.js";
import type { Position } from "../entities/Position.js";
import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import type { PositionClosedReponse } from "../entities/PositionClosedReponse.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
/**

@@ -9,0 +8,0 @@ * All Open Positions

@@ -0,6 +1,5 @@

import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import type { MarketMoversResponse } from "../entities/MarketMoversResponse.js";
import type { CancelablePromise } from "../rest/CancelablePromise.js";
import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js";
/**

@@ -7,0 +6,0 @@ * Get Top Market Movers by Market type

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc