Skip to content

Commit

Permalink
feat: add getSymbolSpecification method
Browse files Browse the repository at this point in the history
  • Loading branch information
vansergen committed Sep 21, 2020
1 parent 79158c6 commit 350c0ea
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,29 @@ export interface IInstrumentSchedule {
intervals: IIntrumentInterval[];
}

export interface IInstrumentSpecification {
/**
* Instrument leverage rate value
*/
leverage: string;
/**
* Instrument contract multiplier
*/
contractMultiplier: string;
/**
* Instrument price unit
*/
priceUnit: string;
/**
* Instrument units name
*/
units?: string | null;
/**
* Instrument lot size value
*/
lotSize: string;
}

export interface IQuoteSideV2 {
/**
* Quantity value
Expand Down Expand Up @@ -1234,6 +1257,19 @@ export class RestClient {
return schedule;
}

/**
* Get additional parameters for requested instrument
*/
public async getSymbolSpecification({
version = DefaultAPIVersion,
symbolId,
}: ISymbolId): Promise<IInstrumentSpecification> {
const path = `/md/${version}/symbols/${symbolId}/specification`;
const url = new URL(path, this.url);
const instrument = (await this.fetch(url)) as IInstrumentSpecification;
return instrument;
}

/**
* Get the last quote
*/
Expand Down

0 comments on commit 350c0ea

Please sign in to comment.