Skip to content
New issue

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

SOS get open orders #3

Open
Al13n0 opened this issue Sep 29, 2016 · 2 comments
Open

SOS get open orders #3

Al13n0 opened this issue Sep 29, 2016 · 2 comments

Comments

@Al13n0
Copy link

Al13n0 commented Sep 29, 2016

Hello i am a young developer this is my first time with the api of poloniex, I am developing a python bot for Poloniex , but is all the day that i try to make a request to get the open order but it fails!!
My code is very similar to your but I dont know, why it dosent works the request status is 200 but this is the reply:
{'error': 'Invalid command.'}

this is my code:

Returns open orders for a given market

def getOpenOrders(self,url,comand, market):

    nonce = int(time.time())
    print(comand)
    urlrequest = url  + '?apikey=' + self.apiKey +'&command='+comand + '&nonce=' +str(nonce) + '&market=' + str(market)
    print(urlrequest)
    param =  'command='+comand + 'nonce=' +str(nonce) +str(market)

    signature =  hmac.new(self.Secret.encode(),param.encode(), hashlib.sha512).hexdigest()
    headers = {
            'Sign':signature,
            'Key': self.apiKey
        }

    self.r = requests.post(urlrequest,headers= headers,)
    print(self.r)
    print(self.r.json())

I think there is problem with the signature but i dont know where.
coudl you help me?

,

@tianfate
Copy link

maybe it can help you :https://github.com/s4w3d0ff/python-poloniex

2016-09-29 8:00 GMT+08:00 Emanuele Cesari notifications@github.com:

Hello i am a young developer this is my first time with the api of
poloniex, I am developing a python bot for Poloniex , but is all the day
that i try to make a request to get the open order but it fails!!
My code is very similar to your but I dont know, why it dosent works the
request status is 200 but this is the reply:
{'error': 'Invalid command.'}

this is my code:
Returns open orders for a given market

def getOpenOrders(self,url,comand, market):

nonce = int(time.time())
print(comand)
urlrequest = url  + '?apikey=' + self.apiKey +'&command='+comand + '&nonce=' +str(nonce) + '&market=' + str(market)
print(urlrequest)
param =  'command='+comand + 'nonce=' +str(nonce) +str(market)

signature =  hmac.new(self.Secret.encode(),param.encode(), hashlib.sha512).hexdigest()
headers = {
        'Sign':signature,
        'Key': self.apiKey
    }

self.r = requests.post(urlrequest,headers= headers,)
print(self.r)
print(self.r.json())

I think there is problem with the signature but i dont know where.
coudl you help me?

,


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#3, or mute the thread
https://github.com/notifications/unsubscribe-auth/AEMq1lzO4KqvN9mJvcSJKG7schX4bblyks5quv-xgaJpZM4KJcZn
.

@Al13n0
Copy link
Author

Al13n0 commented Sep 29, 2016

still problem with my code :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants