Give this package a star if you like it!
pip install python-ftx
API and SECRET should be assgin with your api key and secret key.
from ftx import Client
import os
API = os.getenv("API")
SECRET = os.getenv("SECRET")
client = Client(API, SECRET)
info = client.get_markets()
print(info)
API and SECRET should be assgin with your api key and secret key.
from ftx import ThreadedWebsocketManager
def on_read(payload):
print(payload)
API = os.getenv("API")
SECRET = os.getenv("SECRET")
wsm = ThreadedWebsocketManager(API, SECRET)
wsm.start()
# Un-auth subscribe
name = 'market_connection'
wsm.start_socket(on_read, socket_name=name)
wsm.subscribe(name, channel="ticker", op="subscribe", market="BTC/USDT")
# Auth subscribe
name = 'private_connection'
wsm.start_socket(on_read, socket_name=name)
wsm.login(socket_name=name)
wsm.subscribe(
name,
channel="fills",
op="subscribe",
)
clinet = Client(API, SECRET, "Subaacount_name")
wsm = ThreadedWebsocketManager(API, SECRET, "Subaccount_name")
$ make lint
I put dontaion address here because all open source Crypto API did. It seems unprofessional if I don't
ETH:0xB32A3CbEaD5667e026CCEC7118b132DCA349A8e6