### Hierarchy

- StacksApiWebSocketClient

## Index

### Constructors

- constructor

### Properties

- eventEmitter
- idCursor
- pendingRequests
- webSocket

### Methods

- handleNotification
- rpcCall
- subscribeAddressBalanceUpdates
- subscribeAddressTransactions
- subscribeTxUpdates
- connect

## Constructors

### constructor

- new StacksApiWebSocketClient(webSocket: IWebSocket): StacksApiWebSocketClient

- - Defined in src/ws/index.ts:56

  #### Parameters

  - ##### webSocket: IWebSocket

  #### Returns StacksApiWebSocketClient

## Properties

### eventEmitter

eventEmitter: EventEmitter<{ addressBalanceUpdate: (event: RpcAddressBalanceNotificationParams) => void; addressTxUpdate: (event: RpcAddressTxNotificationParams) => void; txUpdate: (event: RpcTxUpdateNotificationParams) => any }, any> = ...

- Defined in src/ws/index.ts:28

### idCursor

idCursor: number = 0

- Defined in src/ws/index.ts:22

### pendingRequests

pendingRequests: Map<ID, { reject: (error: any) => void; resolve: (result: any) => void }> = ...

- Defined in src/ws/index.ts:23

### webSocket

webSocket: IWebSocket

- Defined in src/ws/index.ts:21

## Methods

### handleNotification

- handleNotification(data: NotificationObject): void

- - Defined in src/ws/index.ts:83

  #### Parameters

  - ##### data: NotificationObject

  #### Returns void

### Private rpcCall

- rpcCall<TResult>(method: string, params: any): Promise<TResult>

- - Defined in src/ws/index.ts:101

  #### Type parameters

  - #### TResult = void

  #### Parameters

  - ##### method: string

  - ##### params: any

  #### Returns Promise<TResult>

### subscribeAddressBalanceUpdates

- subscribeAddressBalanceUpdates(address: string, update: (event: RpcAddressBalanceNotificationParams) => any): Promise<Subscription>

- - Defined in src/ws/index.ts:149

  #### Parameters

  - ##### address: string

  - ##### update: (event: RpcAddressBalanceNotificationParams) => any

    - - (event: RpcAddressBalanceNotificationParams): any

      - #### Parameters

        - ##### event: RpcAddressBalanceNotificationParams

        #### Returns any

  #### Returns Promise<Subscription>

### subscribeAddressTransactions

- subscribeAddressTransactions(address: string, update: (event: RpcAddressTxNotificationParams) => any): Promise<Subscription>

- - Defined in src/ws/index.ts:129

  #### Parameters

  - ##### address: string

  - ##### update: (event: RpcAddressTxNotificationParams) => any

    - - (event: RpcAddressTxNotificationParams): any

      - #### Parameters

        - ##### event: RpcAddressTxNotificationParams

        #### Returns any

  #### Returns Promise<Subscription>

### subscribeTxUpdates

- subscribeTxUpdates(txId: string, update: (event: RpcTxUpdateNotificationParams) => any): Promise<Subscription>

- - Defined in src/ws/index.ts:109

  #### Parameters

  - ##### txId: string

  - ##### update: (event: RpcTxUpdateNotificationParams) => any

    - - (event: RpcTxUpdateNotificationParams): any

      - #### Parameters

        - ##### event: RpcTxUpdateNotificationParams

        #### Returns any

  #### Returns Promise<Subscription>

### Static connect

- connect(url?: string): Promise< StacksApiWebSocketClient >

- - Defined in src/ws/index.ts:34

  #### Parameters

  - ##### url: string = ...

  #### Returns Promise< StacksApiWebSocketClient >

Generated using TypeDoc