Skip to content

Commit

Permalink
feat: add the getTradesStream method
Browse files Browse the repository at this point in the history
  • Loading branch information
vansergen committed Sep 22, 2020
1 parent 8abf277 commit fcfc701
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ export interface ISymbolIdType extends IVersion {
symbolType: string;
}

export interface ISymbolIds {
/**
* Financial instrument id
*/
symbolIds: string | string[];
}

export interface ILastQuoteOptions extends IVersion {
/**
* Symbol id or symbol ids
Expand Down Expand Up @@ -1321,6 +1328,15 @@ export class RestClient {
return exchanges;
}

/**
* Get the trades stream for the specified financial instrument
*/
public async getTradesStream({ symbolIds }: ISymbolIds): Promise<JSONStream> {
const url = new URL(`/md/3.0/feed/trades/${symbolIds}`, this.url);
const stream = await this.fetchStream(url);
return stream;
}

/**
* Get the list of OHLC candles
*/
Expand Down

0 comments on commit fcfc701

Please sign in to comment.