Python SDK
This package facilitates the use of the tanX (previously Brine.fi) APIs.
Installation
pip install tanx-connectorUsage
Quickstart:
from tanxconnector import Client
ETH_ADDRESS = "(your eth wallet address)"
ETH_WALLET_PRIVATE_KEY = "(your wallet's private key)"
STARK_PRIVATE_KEY = "(stark private key from the L2 Key Pair)"
client = Client()
# login to the network
login = client.complete_login(ETH_ADDRESS, PRIVATE_KEY)
# create an order nonce
nonce: CreateOrderNonceBody = {'market': 'ethusdc', 'ord_type':'market', 'price': 29580.51, 'side': 'sell', 'volume': 0.0005}
# create the order
order = client.create_complete_order(nonce, STARK_PRIVATE_KEY)
print(order)
# fetch the details of the order just created
order_id = order['payload']['id']
fetch_order = client.get_order(order_id)
print(fetch_order)Github repo
Last updated