smartapi-typescript
Version:
TypeScript library for Angel One SmartAPI broker API
81 lines (80 loc) • 3.02 kB
TypeScript
import { AxiosInstance } from 'axios';
import { ApiResponse, InstrumentData, LtpData, SearchScripResult, IntradayScrip } from '../../types';
import { Auth } from '../auth';
/**
* Instruments module for SmartAPI
* Handles operations related to market instruments, scrips and LTP data
*/
export declare class Instruments {
private auth;
private httpClient;
private debug;
/**
* Initialize instruments module
*/
constructor(auth: Auth, httpClient: AxiosInstance, debug?: boolean);
/**
* Log debug messages if debug mode is enabled
*/
private log;
/**
* Fetch the complete instrument list with all tradable instruments
* This provides a consolidated, import-ready JSON list of instruments across all exchanges
*
* @returns Array of instrument data
*/
getInstruments(): Promise<ApiResponse<InstrumentData[]>>;
/**
* Fetch LTP (Last Traded Price) data for a specific instrument
*
* @param exchange Exchange name (e.g., NSE, BSE, NFO)
* @param symbolToken Symbol token/ID
* @param tradingSymbol Trading symbol
* @param options Network configuration options
* @returns Last traded price data
*/
getLtp(exchange: string, symbolToken: string, tradingSymbol: string, options?: {
clientLocalIP?: string;
clientPublicIP?: string;
macAddress?: string;
}): Promise<ApiResponse<LtpData>>;
/**
* Search for scrips by name or keyword
*
* @param exchange Exchange name (e.g., NSE, BSE, NFO)
* @param searchQuery Search keyword or partial symbol name
* @param options Network configuration options
* @returns List of matching scrips with their tokens
*/
searchScrip(exchange: string, searchQuery: string, options?: {
clientLocalIP?: string;
clientPublicIP?: string;
macAddress?: string;
}): Promise<ApiResponse<SearchScripResult[]>>;
/**
* Get list of NSE scrips allowed for intraday trading
* This provides a list of scripts that are allowed for intraday (MIS) trading on NSE
* along with their margin multipliers
*
* @param options Network configuration options
* @returns List of NSE scrips allowed for intraday trading with their margin multipliers
*/
getNseIntradayScrips(options?: {
clientLocalIP?: string;
clientPublicIP?: string;
macAddress?: string;
}): Promise<ApiResponse<IntradayScrip[]>>;
/**
* Get list of BSE scrips allowed for intraday trading
* This provides a list of scripts that are allowed for intraday (MIS) trading on BSE
* along with their margin multipliers
*
* @param options Network configuration options
* @returns List of BSE scrips allowed for intraday trading with their margin multipliers
*/
getBseIntradayScrips(options?: {
clientLocalIP?: string;
clientPublicIP?: string;
macAddress?: string;
}): Promise<ApiResponse<IntradayScrip[]>>;
}