We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi I'm using this code to query orders. i have set TP on my limit order but it doesn't return in order response
import json import time import requests import hmac from hashlib import sha256 APIURL = "https://open-api-vst.bingx.com" APIKEY = "----" SECRETKEY = "----" def demo(): payload = {} path = '/openApi/swap/v2/trade/openOrders' method = "GET" paramsMap = { "symbol": "BTC-USDT", "timestamp": str(int(time.time() * 1000)) } paramsStr = parseParam(paramsMap) return send_request(method, path, paramsStr, payload) def get_sign(api_secret, payload): signature = hmac.new(api_secret.encode("utf-8"), payload.encode("utf-8"), digestmod=sha256).hexdigest() print("sign=" + signature) return signature def send_request(method, path, urlpa, payload): url = "%s%s?%s&signature=%s" % (APIURL, path, urlpa, get_sign(SECRETKEY, urlpa)) print(url) headers = { 'X-BX-APIKEY': APIKEY, } response = requests.request(method, url, headers=headers, data=payload) return response.text def parseParam(paramsMap): sortedKeys = sorted(paramsMap) paramsStr = "&".join(["%s=%s" % (x, paramsMap[x]) for x in sortedKeys]) if paramsStr != "": return paramsStr+"×tamp="+str(int(time.time() * 1000)) else: return paramsStr+"timestamp="+str(int(time.time() * 1000)) if __name__ == '__main__': demo = json.loads(demo()) print("demo:", demo)
Response is:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi I'm using this code to query orders. i have set TP on my limit order but it doesn't return in order response
Response is:
The text was updated successfully, but these errors were encountered: