Skip to main content

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

Project description

安装

合约调用

  • 需申请好对应的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


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.10.tar.gz (12.1 kB view hashes)

Uploaded Source

Built Distribution

lbank_connector_python-1.0.10-py3-none-any.whl (16.5 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