Channel

# Import statement

from bcx.channels import Channel
class Channel(name: str, ws: bcx.websocket.BlockchainWebsocket)[source]

Base class for all channels

Attributes

extra_message

Additional message to be send to server

Methods

on_event(self, event_type, event_response)

Perform action based on event type received from server

on_reject(self, event_response)

Perform action upon reject event message received from server

on_snapshot(self, event_response)

Perform action upon snapshot event message received from server

on_subscribe(self)

Perform action upon subscribe event message received from server

on_unsubscribe(self)

Perform action upon unsubscribe event message received from server

on_update(self, event_response)

Perform action upon update event message received from server

subscribe(self)

Subscribe to a channel

unsubscribe(self)

Unsubscribe from a channel

property extra_message

Additional message to be send to server

on_event(self, event_type: str, event_response: Dict)[source]

Perform action based on event type received from server

Parameters
event_typestr
event_responseDict
on_reject(self, event_response: Dict)[source]

Perform action upon reject event message received from server

Parameters
event_responseDict
on_snapshot(self, event_response: Dict)[source]

Perform action upon snapshot event message received from server

Parameters
event_responseDict
on_subscribe(self)[source]

Perform action upon subscribe event message received from server

on_unsubscribe(self)[source]

Perform action upon unsubscribe event message received from server

on_update(self, event_response: Dict)[source]

Perform action upon update event message received from server

Parameters
event_responseDict
subscribe(self)[source]

Subscribe to a channel

unsubscribe(self)[source]

Unsubscribe from a channel