Welcome to TruBit-Python

An official Python implementation of the lastest Open API for Broker.

Install

pip install broker-trade-client

or download from github

Note: pip install may be fail. We are working on fix this. if so, just download from github

Usage

REST API

Init broker client:

b = BrokerClient(entry_point='', api_key='', secret='')

Init broker options client:

b = BrokerOptionClient(entry_point='', api_key='', secret='')

Init broker contract client:

b = BrokerContractClient(entry_point='', api_key='', secret='')

Request with proxies:

proxies = {
  "http": "http://ip:port",
  "https": "http://ip:port",
}

b = BrokerClient(entry_point='', api_key='', secret='', proxies=proxies)

Web Socket

Init

Init broker websocket client:

Subscribe

Subscribe trades:

Subscribe Kline/Candlestick:

Subscribe market tickers:

Subscribe book depth tickers:

Subscribe user data:

Start

Start websocket thread

API List

Public API

ping

time

broker info

depth

trades

klines

ticker 24hr

Private API

new order

get order

cancel order

open orders

history orders

account

my trades

deposit orders

Examples

Last updated