UNPKG

@master-chief/alpaca-ts

Version:

A TypeScript Node.js library for the https://alpaca.markets REST API and WebSocket streams.

149 lines (148 loc) 4.52 kB
import type { UpdateWatchlistRequest } from "../entities/UpdateWatchlistRequest.js"; import type { Watchlist } from "../entities/Watchlist.js"; import type { CancelablePromise } from "../rest/CancelablePromise.js"; import type { BaseHttpRequest } from "../rest/BaseHttpRequest.js"; /** * Watchlists * Returns the list of watchlists registered under the account. * @returns Watchlist Successful response * @throws ApiError */ export declare const getWatchlists: (httpRequest: BaseHttpRequest) => CancelablePromise<Array<Watchlist>>; /** * Watchlist * Create a new watchlist with initial set of assets. * @returns Watchlist Successful response * @throws ApiError */ export declare const postWatchlist: (httpRequest: BaseHttpRequest, { requestBody, }: { requestBody: UpdateWatchlistRequest; }) => CancelablePromise<Watchlist>; /** * Get Watchlist by ID * Returns a watchlist identified by the ID. * @returns Watchlist Successful response * @throws ApiError */ export declare const getWatchlistById: (httpRequest: BaseHttpRequest, { watchlistId, }: { /** * watchlist id */ watchlistId: string; }) => CancelablePromise<Watchlist>; /** * Update Watchlist By Id * Update the name and/or content of watchlist * @returns Watchlist Successful response * @throws ApiError */ export declare const updateWatchlistByI: (httpRequest: BaseHttpRequest, { watchlistId, requestBody, }: { /** * watchlist id */ watchlistId: string; requestBody?: UpdateWatchlistRequest; }) => CancelablePromise<Watchlist>; /** * Add Asset to Watchlist * Append an asset for the symbol to the end of watchlist asset list * @returns Watchlist Successful response * @throws ApiError */ export declare const addAssetToWatchlist: (httpRequest: BaseHttpRequest, { watchlistId, requestBody, }: { /** * watchlist id */ watchlistId: string; requestBody?: { /** * the symbol name to add to the watchlist */ symbol?: string; }; }) => CancelablePromise<Watchlist>; /** * Delete Watchlist By Id * Delete a watchlist. This is a permanent deletion. * @returns void * @throws ApiError */ export declare const deleteWatchlistById: (httpRequest: BaseHttpRequest, { watchlistId, }: { /** * watchlist id */ watchlistId: string; }) => CancelablePromise<void>; /** * Get Watchlist by Name * You can also call GET, PUT, POST and DELETE with watchlist name with another endpoint /v2/watchlists:by_name and query parameter name=<watchlist_name>, instead of /v2/watchlists/{watchlist_id} endpoints * * Returns a watchlist by name * @returns Watchlist Successful response * @throws ApiError */ export declare const getWatchlistByName: (httpRequest: BaseHttpRequest, { name, }: { /** * name of the watchlist */ name: string; }) => CancelablePromise<Watchlist>; /** * Update Watchlist By Name * Update the name and/or content of watchlist * @returns Watchlist Successful response * @throws ApiError */ export declare const updateWatchlistByName: (httpRequest: BaseHttpRequest, { name, requestBody, }: { /** * name of the watchlist */ name: string; requestBody?: UpdateWatchlistRequest; }) => CancelablePromise<Watchlist>; /** * Add Asset to Watchlist By Name * Append an asset for the symbol to the end of watchlist asset list * @returns Watchlist Successful response * @throws ApiError */ export declare const addAssetToWatchlistByName: (httpRequest: BaseHttpRequest, { name, requestBody, }: { /** * name of the watchlist */ name: string; requestBody?: { /** * the symbol name to add to the watchlist */ symbol?: string; }; }) => CancelablePromise<Watchlist>; /** * Delete Watchlist By Name * Delete a watchlist. This is a permanent deletion. * @returns void * @throws ApiError */ export declare const deleteWatchlistByName: (httpRequest: BaseHttpRequest, { name, }: { /** * name of the watchlist */ name: string; }) => CancelablePromise<void>; /** * Symbol from Watchlist * Delete one entry for an asset by symbol name * @returns Watchlist Returns the updated watchlist * @throws ApiError */ export declare const removeAssetFromWatchlist: (httpRequest: BaseHttpRequest, { watchlistId, symbol, }: { /** * Watchlist ID */ watchlistId: string; /** * symbol name to remove from the watchlist content */ symbol: string; }) => CancelablePromise<Watchlist>;