LBANK connector for the public API, private API, and websockets.
Project description
Installation
- pip install --upgrade lbank-connector-python -i https://pypi.org/simple
Contract Call
- You need to apply for the corresponding api_key and api_secret
from lbank.old_api import BlockHttpClient
api_key = ""
api_secret = ""
# service address
base_url = "https://lbkperp.lbank.com"
# Encryption method
sign_method = "RSA"
client = BlockHttpClient(
sign_method=sign_method,
api_key=api_key,
api_secret=api_secret,
base_url=base_url
)
# Order api
order_url = "/cfd/openApi/v1/prv/placeOrder"
order_data = {
"clientOrderId": f"{order_id}",
"offsetFlag": 0,
"orderPriceType": 4,
"origType": 0,
"price": 2000,
"side": "BUY",
"symbol": "ETHUSDT",
"volume": 0.01,
}
res = client.http_request("POST", order_url, order_data)
print(res)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for lbank-connector-python-1.0.12.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9d7f17c7d2a91702f898a28142236f36a11ecd720c6c121aeaedbe94c88d9c8 |
|
MD5 | 284c7697158c8ae36bb5a076ab7019a1 |
|
BLAKE2b-256 | d075cdb4787fb2f566e1174990ec662443974be995f23f934b356c220fa2da90 |
Close
Hashes for lbank_connector_python-1.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4108ac7e5cb48dce88c45f8e24d7185a894b573c13346ff0880baf03c91d83c |
|
MD5 | bcf1075f8447fb6b4b71c0f0ea173cd1 |
|
BLAKE2b-256 | dc7374d81d052d12c3e35f619ed81e4743af74f79b863efc77f71c6539677fdd |