Skip to main content

LBANK connector for the public API, private API, and websockets.

Project description

Installation

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lbank-connector-python-1.0.11.tar.gz (11.8 kB view hashes)

Uploaded Source

Built Distribution

lbank_connector_python-1.0.11-py3-none-any.whl (16.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page