Skip to content

API Reference


API Reference / Skill

Abstract Class: Skill<TContext>

Defined in: src/skills/Skill.ts:52

Base class for composable trading skills.

A skill is a named sequence of steps over a shared context. Steps run in declaration order and each returns the context for the next, so a skill stays inspectable — the registry can list its steps without running it.

Skills that build multi-leg positions stop at an intent: they resolve strikes and premiums but never place orders, leaving execution to an explicit, separately-gated call.

Extended by

Type Parameters

TContext

TContext extends SkillContext = SkillContext

Constructors

Constructor

new Skill<TContext>(): Skill<TContext>

Returns

Skill<TContext>

Properties

definition

abstract readonly definition: SkillDefinition

Defined in: src/skills/Skill.ts:53

Methods

steps()

abstract protected steps(): SkillStep<TContext>[]

Defined in: src/skills/Skill.ts:55

Returns

SkillStep<TContext>[]


call()

call(args, client): Promise<TContext>

Defined in: src/skills/Skill.ts:58

Runs every step in order and returns the final context.

Parameters

args

Record<string, unknown>

client

DhanClient

Returns

Promise<TContext>


stepNames()

stepNames(): string[]

Defined in: src/skills/Skill.ts:73

Step names in execution order, for tool listings and docs.

Returns

string[]


buildContext()

protected buildContext(args, client): TContext

Defined in: src/skills/Skill.ts:77

Parameters

args

Record<string, unknown>

client

DhanClient

Returns

TContext


validate()

protected validate(context): void

Defined in: src/skills/Skill.ts:91

Parameters

context

Record<string, unknown>

Returns

void

Community project — not affiliated with Dhan. MIT License.