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.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9ad6fdbe3ae05a992ef9eef3c0b555c395651ba88e39f94ccddd2eaeb6c6ea5 |
|
MD5 | 2c320bafcfd8d20a06a0e359db4122a5 |
|
BLAKE2b-256 | 9760fb07ade6f5b11b3b311db2843df8596969c0fff010c8b5fb618328dd1b21 |
Close
Hashes for lbank_connector_python-1.0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af040756bdfec306faec0ebc6e63875350e999ce24c62e6ee50b89997743d7bc |
|
MD5 | 237a23e15da1cd8efba23bfa7313497d |
|
BLAKE2b-256 | bfa86dc711b0063f411a44c724dfe9543edd29d8a8ade41205bceafc9c17de58 |