Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python2.7
- import hashlib
- import hmac
- import time
- base_url = 'https://api.coinnest.co.kr'
- class Coinnest():
- def __init__(self, key, secret):
- self.key = key
- self.secret = secret
- def get_balance(self):
- url = base_url + '/api/account/balance'
- nonce = str(int(time.time())*1000)
- key = hashlib.md5(self.secret).hexdigest()
- message = 'key={}&nonce={}'.format(self.key, nonce)
- signature = hmac.new(key, message, hashlib.sha256).hexdigest()
- payload = {'key': key, 'nonce': nonce, 'signature': signature}
- r = requests.post(url, data=payload)
- return r.json()
- coinnest = Coinnest('','')
- print coinnest.get_order_history()
Add Comment
Please, Sign In to add comment