Skip to main content
Glama
types.ts3.73 kB
/** * Types and interfaces for DhanHQ MCP Server */ export interface DhanConfig { clientId: string; apiKey: string; apiSecret: string; redirectUrl: string; } export interface AuthStep1Response { consentAppId: string; consentAppStatus: string; status: string; } export interface AuthStep3Response { dhanClientId: string; dhanClientName: string; dhanClientUcc: string; givenPowerOfAttorney: boolean; accessToken: string; expiryTime: string; } export interface DhanAuthToken { accessToken: string; dhanClientId: string; dhanClientName: string; dhanClientUcc: string; expiryTime: string; givenPowerOfAttorney: boolean; generatedAt: string; } export interface FundLimit { dhanClientId: string; availabelBalance: number; sodLimit: number; collateralAmount: number; receiveableAmount: number; utilizedAmount: number; blockedPayoutAmount: number; withdrawableBalance: number; } export interface AuthState { consentAppId?: string; consentAppStatus?: string; tokenId?: string; authToken?: DhanAuthToken; } // Order Management Types export interface PlaceOrderRequest { dhanClientId: string; correlationId: string; transactionType: 'BUY' | 'SELL'; exchangeSegment: string; productType: 'CNC' | 'INTRADAY' | 'MARGIN' | 'MTF' | 'CO' | 'BO'; orderType: 'LIMIT' | 'MARKET' | 'STOP_LOSS' | 'STOP_LOSS_MARKET'; validity: 'DAY' | 'IOC'; securityId: string; quantity: number; disclosedQuantity?: number; price?: number; triggerPrice?: number; afterMarketOrder?: boolean; amoTime?: 'PRE_OPEN' | 'OPEN' | 'OPEN_30' | 'OPEN_60'; boProfitValue?: number; boStopLossValue?: number; } export interface OrderResponse { orderId: string; orderStatus: string; } export interface OrderBook { dhanClientId: string; orderId: string; correlationId: string; orderStatus: string; transactionType: string; exchangeSegment: string; productType: string; orderType: string; validity: string; securityId: string; quantity: number; price: number; triggerPrice?: number; disclosedQuantity?: number; createTime: string; algoId?: string; remainingQuantity: number; filledQty: number; updateTime?: string; } export interface TradeBook { dhanClientId: string; orderId: string; exchangeOrderId: string; exchangeTradeId: string; transactionType: string; exchangeSegment: string; tradingSymbol: string; tradedQuantity: number; tradedPrice: number; exchangeTime: string; } export interface ModifyOrderRequest { dhanClientId: string; orderId: string; orderType: 'LIMIT' | 'MARKET' | 'STOP_LOSS' | 'STOP_LOSS_MARKET'; quantity?: number; price?: number; triggerPrice?: number; disclosedQuantity?: number; } // Super Order Types export interface SuperOrderLeg { orderId?: string; legName: 'ENTRY_LEG' | 'TARGET_LEG' | 'STOP_LOSS_LEG'; price: number; quantity?: number; orderStatus?: string; trailingJump?: number; } export interface PlaceSuperOrderRequest { dhanClientId: string; correlationId: string; transactionType: 'BUY' | 'SELL'; exchangeSegment: string; productType: 'CNC' | 'INTRADAY' | 'MARGIN' | 'MTF' | 'CO' | 'BO'; orderType: 'LIMIT' | 'MARKET' | 'STOP_LOSS' | 'STOP_LOSS_MARKET'; securityId: string; quantity: number; price: number; targetPrice: number; stopLossPrice: number; trailingJump?: number; } export interface SuperOrderBook { dhanClientId: string; orderId: string; correlationId: string; orderStatus: string; legName: 'ENTRY_LEG' | 'TARGET_LEG' | 'STOP_LOSS_LEG'; quantity: number; price: number; exchangeSegment: string; productType: string; orderType: string; transactionType: string; legDetails?: SuperOrderLeg[]; }

Implementation Reference

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/harshitdynamite/DhanMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server