LBANK connector for the public API, private API, and websockets.
Project description
安装
- pip install --upgrade lbank-connector-python -i https://pypi.org/simple
合约调用
- 需申请好对应的api_key以及api_secret
from lbank.old_api import BlockHttpClient
api_key = ""
api_secret = ""
# 对应的服务地址 正式
base_url = "https://lbkperp.lbank.com"
# 加密方式
sign_method = "RSA"
client = BlockHttpClient(
sign_method=sign_method,
api_key=api_key,
api_secret=api_secret,
base_url=base_url
)
# 下单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.9.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05f4083271341ae8161f207d9cd02b834fd3eb794023cb858447bdd72421ba6a |
|
MD5 | 6b246a75cb843e5354822e26a7b45210 |
|
BLAKE2b-256 | 3d59a478b6563c42c3e3201e4a2b4a88f0e64cc96fa4a93d9d6f367f199cc46e |
Close
Hashes for lbank_connector_python-1.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4c6ceb896ce8593bd432d2cbe197bd202e1e9425b9a37405dd36bd97ddbdeec |
|
MD5 | 80e1bcf466bb9cbcc7a70ddaf8ab9ad7 |
|
BLAKE2b-256 | 41b8a989a7c0ea1e3f359326c5f5c4c54308954a5eeb98851dda510904e94bbe |