Skip to content
This repository has been archived by the owner on Jan 20, 2020. It is now read-only.

Commit

Permalink
Fix WebsocketClient typescript definition (#160)
Browse files Browse the repository at this point in the history
* Fix WebsocketClient typescript definition

* Add channels and heartbeat options
  • Loading branch information
iffy authored and fb55 committed Dec 24, 2017
1 parent 46e2b22 commit 913cd31
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,19 @@ declare module 'gdax' {
getTrailingVolume(): Promise<any>;
}

interface WebsocketClientOptions {
heartbeat?: boolean;
channels?: string[];
}

export class WebsocketClient {
constructor(productIds: string[]);
constructor(
productIds: string[],
websocketURI?: string,
auth?: {key:string, secret:string, passphrase:string},
{ heartbeat, channels }?: WebsocketClientOptions );

on(event: 'message', eventHandler: (data) => void);
on(event: 'message', eventHandler: (data:object) => void);
on(event: 'error', eventHandler: (err) => void);
on(event: 'open', eventHandler: () => void);
on(event: 'close', eventHandler: () => void);
Expand Down

0 comments on commit 913cd31

Please sign in to comment.