Skip to content

Create your own strategy on WooX with python-wootrade in a second

License

Notifications You must be signed in to change notification settings

wanth1997/python-wooX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trader Zone

WooX is a zero fee crypto exchange, click here to register with my referal code.

Give this package a star if you like it!

Package User Zone

Installation

pip install python-woox

Sample Code

Restful Api

from woox import Client
import os

API = os.getenv("API")
SECRET = os.getenv("SECRET")
APPLICATION_ID = os.getenv("APPLICATION_ID")

client = Client(API, SECRET, APPLICATION_ID, testnet=True)
info = client.get_exchange_info(symbol="SPOT_BTC_USDT")
print(info)

Websocket

from wootrade import ThreadedWebsocketManager

def on_read(payload):
    print(payload)

API = os.getenv("API")
SECRET = os.getenv("SECRET")
APPLICATION_ID = os.getenv("APPLICATION_ID")

wsm = ThreadedWebsocketManager(API, SECRET, APPLICATION_ID, testnet=True)
wsm.start()

# Un-auth subscribe
name = 'market_connection'
wsm.start_socket(on_read, socket_name=name, auth=False)
wsm.subscribe(name, topic="SPOT_BTC_USDT@kline_1m", id="ClientID", event="subscribe")

# Auth subscribe
name = 'private_connection'
wsm.start_socket(on_read, socket_name=name, auth=True)
wsm.authentication(socket_name=name)
wsm.subscribe(
    name,
    topic="executionreport",
    id="ClientID",
    event="subscribe",
)

Developer Zone

Lint

$ make lint

Test

# Should Set up env variable API, SECRET and APPLICATION_ID in tox.ini
$ make test 

About

Create your own strategy on WooX with python-wootrade in a second

Resources

License

Stars

Watchers

Forks

Packages

No packages published