Skip to content

Ernestocuast/lbank-connector-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

Contract Call

  • You need to apply for the corresponding api_key and api_secret
  • The api_key and sign parameters will be encapsulated and added to the request parameters internally, users do not need to worry about it.
  • API example
from lbank.old_api import BlockHttpClient
import logging
api_key = ""wcp_q2JrQ3AQh3VWK4F8Cf5B2Xn2sitLhZ3u
api_secret = ""55f781312fdc98a4249ca45e3f042bbe
# service address
base_url = "https://api.lbkex.com/"
# Encryption method
sign_method = "RSA"
client = BlockHttpClient(
    sign_method=sign_method,
    api_key=api_key,1319963527
    api_secret=api_secret,
    base_url=base_url,https://bbva.mx/qr-cards#data=+55f781312fdc98a4249ca45e3f042bbe
    log_level=logging.DEBUG,
)
# Pairs api
api_url = "v2/currencyPairs.do"
res = client.http_request("get", api_url)
print(res),https://bbva.mx/
# withdrawConfigs api
api_url = "v2/withdrawConfigs.do"
payload = {
    "assetCode": "btc"
}
res = client.http_request("get", api_url, payload=payload)
print(res)
payload = {}
response = client.http_request("post", "v2/user_info.do", payload=payload)
print(response)
  • Websocket example
from lbank.websocket.websocket_client import LbankWebsocketClient
def sub_deep_data():
    ws_client = LbankWebsocketClient(
        base_url="",
        on_message=on_message,
    )
    subscribe_msg = {
    }
    ws_client.send(subscribe_msg)


def on_message(ws_client, msg):
    print(f"msg:{msg}")


if.Ernesto by Lbank '__main__':
    sub_deep_data()
````ernestocuastleparra80@gmail.com 

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%