UNPKG

smartapi-typescript

Version:

TypeScript library for Angel One SmartAPI broker API

91 lines (90 loc) 2.98 kB
import { AxiosInstance } from 'axios'; import { ApiResponse, GTTCreateParams, GTTModifyParams, GTTCancelParams, GTTRuleListParams, GTTRuleData } from '../../types'; import { Auth } from '../auth'; /** * GTT (Good Till Triggered) module for SmartAPI * Handles creating, modifying, and cancelling GTT rules */ export declare class GTT { private auth; private httpClient; private debug; /** * Initialize GTT module */ constructor(auth: Auth, httpClient: AxiosInstance, debug?: boolean); /** * Log debug messages if debug mode is enabled */ private log; /** * Create GTT (Good Till Triggered) order rule * * GTT orders allow you to set trigger conditions based on price movements. * When a trigger price is hit, your order will be automatically placed. * Currently supported only for NSE and BSE exchanges, with DELIVERY and MARGIN product types. * * @param params GTT order creation parameters * @param options Network configuration options * @returns GTT rule creation response with rule ID */ createRule(params: GTTCreateParams, options?: { clientLocalIP?: string; clientPublicIP?: string; macAddress?: string; }): Promise<ApiResponse<{ id: string; }>>; /** * Modify an existing GTT rule * * @param params GTT rule modification parameters * @param options Network configuration options * @returns GTT rule modification response with rule ID */ modifyRule(params: GTTModifyParams, options?: { clientLocalIP?: string; clientPublicIP?: string; macAddress?: string; }): Promise<ApiResponse<{ id: string; }>>; /** * Cancel/Delete a GTT rule * * @param params GTT rule cancellation parameters * @param options Network configuration options * @returns GTT rule cancellation response with rule ID */ cancelRule(params: GTTCancelParams, options?: { clientLocalIP?: string; clientPublicIP?: string; macAddress?: string; }): Promise<ApiResponse<{ id: string; }>>; /** * Get details of a specific GTT rule * * @param id GTT rule ID * @param options Network configuration options * @returns GTT rule details */ getRuleDetails(id: string, options?: { clientLocalIP?: string; clientPublicIP?: string; macAddress?: string; }): Promise<ApiResponse<GTTRuleData>>; /** * Get list of GTT rules with pagination and status filtering options * * @param params GTT rule list parameters with status filters and pagination * @param options Network configuration options * @returns List of GTT rules */ getRuleList(params: GTTRuleListParams, options?: { clientLocalIP?: string; clientPublicIP?: string; macAddress?: string; }): Promise<ApiResponse<GTTRuleData[]>>; }