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
import logging
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,
log_level=logging.DEBUG,
)
# 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.13.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 958e367092201ce88def7c4eb9156463cd00659b0eb40b641eb9eb24bcc6db01 |
|
MD5 | 4e96c0e41c36e2114285e5e0bbd502ca |
|
BLAKE2b-256 | 1f90ee1bf2a91b46015a925a1d741c46c04b10ff65a57043866451ee88640ac4 |
Close
Hashes for lbank_connector_python-1.0.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3c4965eb2f536e299905feba7f500811af04fe69a3c93218fef1c3790499319 |
|
MD5 | 33150fbae32d187df6e3d1b18ffb682a |
|
BLAKE2b-256 | 250ec3847f2a7584561a917fbccdc60d8b43f806fc6d4c340100b32f809b2968 |