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.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95f3ad653017df0421b95b0f8f87482f21d532792a9ae0f0b272980fec8381d2 |
|
MD5 | 1d064643ce0eca8d644d4e5a782e6443 |
|
BLAKE2b-256 | f969abea973b0b6b88907760559afb75006c2d79806b24fab865e45ad7137d0d |
Close
Hashes for lbank_connector_python-1.0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49e53bfb22bfa3bdb56b351c627286e7f5b2b652b2dc0ef12739881451b1579c |
|
MD5 | 4c05f0d69c0e189dc2d451b471e35e3a |
|
BLAKE2b-256 | 328cb342c7ef6f6b06e9effd2d492f62d39039888117cb5455b9f948d52e027c |