Skip to content

Latest commit

 

History

History
716 lines (398 loc) · 13.4 KB

streamclient.md

File metadata and controls

716 lines (398 loc) · 13.4 KB

cw-sdk-node - v1.0.0-beta.8StreamClient

Class: StreamClient

Hierarchy

WebSocketClient

StreamClient

Index

Constructors

Properties

Methods

Constructors

constructor

+ new StreamClient(opts: Partial‹StreamOpts›): StreamClient

Overrides WebSocketClient.constructor

Defined in src/websocket/StreamClient.ts:18

Parameters:

Name Type
opts Partial‹StreamOpts

Returns: StreamClient

Properties

Protected connState

connState: symbol

Inherited from WebSocketClient.connState

Defined in src/websocket/WebSocketClient.ts:58


subscriptions

subscriptions: object

Inherited from WebSocketClient.subscriptions

Defined in src/websocket/WebSocketClient.ts:47

Type declaration:

  • [ key: string]: ClientSubscription

Static defaultMaxListeners

defaultMaxListeners: number

Inherited from void

Defined in node_modules/@types/node/events.d.ts:19

Methods

addListener

addListener(event: string | symbol, listener: function): this

Inherited from void

Overrides void

Defined in node_modules/@types/node/events.d.ts:21

Parameters:

event: string | symbol

listener: function

▸ (...args: any[]): void

Parameters:

Name Type
...args any[]

Returns: this


connect

connect(): void

Inherited from WebSocketClient.connect

Defined in src/websocket/WebSocketClient.ts:101

Returns: void


disconnect

disconnect(): void

Inherited from WebSocketClient.disconnect

Defined in src/websocket/WebSocketClient.ts:161

Returns: void


emit

emit(event: string | symbol, ...args: any[]): boolean

Inherited from void

Overrides void

Defined in node_modules/@types/node/events.d.ts:33

Parameters:

Name Type
event string | symbol
...args any[]

Returns: boolean


error

error(e: string): void

Inherited from WebSocketClient.error

Defined in src/websocket/WebSocketClient.ts:133

Parameters:

Name Type
e string

Returns: void


eventNames

eventNames(): Array‹string | symbol›

Inherited from void

Overrides void

Defined in node_modules/@types/node/events.d.ts:34

Returns: Array‹string | symbol›


getMaxListeners

getMaxListeners(): number

Inherited from void

Overrides void

Defined in node_modules/@types/node/events.d.ts:30

Returns: number


getSubscriptions

getSubscriptions(): ClientSubscription[]

Inherited from WebSocketClient.getSubscriptions

Defined in src/websocket/WebSocketClient.ts:173

Returns: ClientSubscription[]


listenerCount

listenerCount(type: string | symbol): number

Inherited from void

Overrides void

Defined in node_modules/@types/node/events.d.ts:35

Parameters:

Name Type
type string | symbol

Returns: number


listeners

listeners(event: string | symbol): Function[]

Inherited from void

Overrides void

Defined in node_modules/@types/node/events.d.ts:31

Parameters:

Name Type
event string | symbol

Returns: Function[]


off

off(event: string | symbol, listener: function): this

Inherited from void

Overrides void

Defined in node_modules/@types/node/events.d.ts:27

Parameters:

event: string | symbol

listener: function

▸ (...args: any[]): void

Parameters:

Name Type
...args any[]

Returns: this


on

on(event: string | symbol, listener: function): this

Inherited from void

Overrides void

Defined in node_modules/@types/node/events.d.ts:22

Parameters:

event: string | symbol

listener: function

▸ (...args: any[]): void

Parameters:

Name Type
...args any[]

Returns: this


onConnect

onConnect(fn: function): void

Inherited from WebSocketClient.onConnect

Defined in src/websocket/WebSocketClient.ts:138

Parameters:

fn: function

▸ (): void

Returns: void


onDisconnect

onDisconnect(fn: function): void

Inherited from WebSocketClient.onDisconnect

Defined in src/websocket/WebSocketClient.ts:142

Parameters:

fn: function

▸ (): void

Returns: void


onError

onError(fn: function): void

Inherited from WebSocketClient.onError

Defined in src/websocket/WebSocketClient.ts:150

Parameters:

fn: function

▸ (e: Error): void

Parameters:

Name Type
e Error

Returns: void


onMarketUpdate

onMarketUpdate(fn: function): void

Defined in src/websocket/StreamClient.ts:85

Parameters:

fn: function

▸ (m: MarketUpdate): void

Parameters:

Name Type
m MarketUpdate

Returns: void


onPairUpdate

onPairUpdate(fn: function): void

Defined in src/websocket/StreamClient.ts:76

Parameters:

fn: function

▸ (m: PairUpdate): void

Parameters:

Name Type
m PairUpdate

Returns: void


onStateChange

onStateChange(fn: function): void

Inherited from WebSocketClient.onStateChange

Defined in src/websocket/WebSocketClient.ts:146

Parameters:

fn: function

▸ (s: string): void

Parameters:

Name Type
s string

Returns: void


once

once(event: string | symbol, listener: function): this

Inherited from void

Overrides void

Defined in node_modules/@types/node/events.d.ts:23

Parameters:

event: string | symbol

listener: function

▸ (...args: any[]): void

Parameters:

Name Type
...args any[]

Returns: this


prependListener

prependListener(event: string | symbol, listener: function): this

Inherited from void

Overrides void

Defined in node_modules/@types/node/events.d.ts:24

Parameters:

event: string | symbol

listener: function

▸ (...args: any[]): void

Parameters:

Name Type
...args any[]

Returns: this


prependOnceListener

prependOnceListener(event: string | symbol, listener: function): this

Inherited from void

Overrides void

Defined in node_modules/@types/node/events.d.ts:25

Parameters:

event: string | symbol

listener: function

▸ (...args: any[]): void

Parameters:

Name Type
...args any[]

Returns: this


rawListeners

rawListeners(event: string | symbol): Function[]

Inherited from void

Overrides void

Defined in node_modules/@types/node/events.d.ts:32

Parameters:

Name Type
event string | symbol

Returns: Function[]


removeAllListeners

removeAllListeners(event?: string | symbol): this

Inherited from void

Overrides void

Defined in node_modules/@types/node/events.d.ts:28

Parameters:

Name Type
event? string | symbol

Returns: this


removeListener

removeListener(event: string | symbol, listener: function): this

Inherited from void

Overrides void

Defined in node_modules/@types/node/events.d.ts:26

Parameters:

event: string | symbol

listener: function

▸ (...args: any[]): void

Parameters:

Name Type
...args any[]

Returns: this


send

send(data: Buffer | Uint8Array): void

Inherited from WebSocketClient.send

Defined in src/websocket/WebSocketClient.ts:154

Parameters:

Name Type
data Buffer | Uint8Array

Returns: void


setMaxListeners

setMaxListeners(n: number): this

Inherited from void

Overrides void

Defined in node_modules/@types/node/events.d.ts:29

Parameters:

Name Type
n number

Returns: this


state

state(): symbol

Inherited from WebSocketClient.state

Defined in src/websocket/WebSocketClient.ts:169

Returns: symbol


subscribe

subscribe(keys: string[]): void

Defined in src/websocket/StreamClient.ts:44

Parameters:

Name Type
keys string[]

Returns: void


unsubscribe

unsubscribe(keys: string[]): void

Defined in src/websocket/StreamClient.ts:60

Parameters:

Name Type
keys string[]

Returns: void


Static listenerCount

listenerCount(emitter: EventEmitter, event: string | symbol): number

Inherited from void

Defined in node_modules/@types/node/events.d.ts:18

deprecated since v4.0.0

Parameters:

Name Type
emitter EventEmitter
event string | symbol

Returns: number