BlockchainWebsocketClient

# Import statement

from bcx.client import BlockchainWebsocketClient
class BlockchainWebsocketClient[source]

High level API to interact with Blockchain Exchange

Attributes

channel_manager

(ChannelManager)

Methods

cancel_all_orders(self)

Cancel all orders

cancel_order(self, order_id)

Cancel order

create_limit_order(self, price, symbol, …)

Create limit order

create_market_order(self, symbol, side, …)

Create market order

create_order(self, order)

Create generic order

get_channel(self, name, \*\*channel_params)

Get connection to a channel of interest

get_last_heartbeat(self)

Get last heartbeat

get_prices_channel(self, symbol, granularity)

Get connection to prices channel

get_trading_channel(self)

Get connection to trading channel

subscribe_to_balances(self)

Subscribe to balances channel

subscribe_to_heartbeat(self)

Subscribe to heartbeat channel

subscribe_to_orderbook_l2(self, symbol)

Subscribe to L2 order book channel

subscribe_to_orderbook_l3(self, symbol)

Subscribe to L3 order book channel

subscribe_to_prices(self, symbol, granularity)

Subscribe to prices channel

subscribe_to_symbols(self)

Subscribe to symbols channel

subscribe_to_ticker(self, symbol)

Subscribe to ticker channel

subscribe_to_trades(self, symbol)

Subscribe to trades channel

subscribe_to_trading(self)

Subscribe to trading channel

property available_channels

List of all available channels on Blockchain Exchange

cancel_all_orders(self)[source]

Cancel all orders

cancel_order(self, order_id)[source]

Cancel order

Parameters
order_id
property connected_channels

List of all channels that you can interact with

create_limit_order(self, price: float, symbol: str, side: str, quantity: float, time_in_force: str, order_id: str = None)[source]

Create limit order

Parameters
price
symbol
side
quantity
time_in_force
order_id
create_market_order(self, symbol: str, side: str, quantity: float, time_in_force: str, order_id: str = None)[source]

Create market order

Parameters
symbol
side
quantity
time_in_force
order_id
create_order(self, order: bcx.orders.Order)[source]

Create generic order

Parameters
orderOrder
get_channel(self, name: str, \*\*channel_params)bcx.channels.Channel[source]

Get connection to a channel of interest

Parameters
name: str

Name of the channel

channel_params: Dict

Parameters used to subscribe to channel

Returns
channel: Channel
get_last_heartbeat(self) → datetime.datetime[source]

Get last heartbeat

get_prices_channel(self, symbol: str, granularity: int)bcx.channels.PricesChannel[source]

Get connection to prices channel

Parameters
symbol
granularity
Returns
channelPricesChannel
get_trading_channel(self)bcx.channels.TradingChannel[source]

Get connection to trading channel

Returns
channelTradingChannel
subscribe_to_balances(self)[source]

Subscribe to balances channel

subscribe_to_heartbeat(self)[source]

Subscribe to heartbeat channel

subscribe_to_orderbook_l2(self, symbol: str)[source]

Subscribe to L2 order book channel

subscribe_to_orderbook_l3(self, symbol: str)[source]

Subscribe to L3 order book channel

subscribe_to_prices(self, symbol: str, granularity: int)[source]

Subscribe to prices channel

subscribe_to_symbols(self)[source]

Subscribe to symbols channel

subscribe_to_ticker(self, symbol: str)[source]

Subscribe to ticker channel

subscribe_to_trades(self, symbol: str)[source]

Subscribe to trades channel

subscribe_to_trading(self)[source]

Subscribe to trading channel