Skip to content

Commit

Permalink
nonce as int with resolution of 10 msec
Browse files Browse the repository at this point in the history
  • Loading branch information
nederhoed committed May 24, 2013
1 parent e74b531 commit d7ab2bf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions mtgoxexp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ def _get_signature(self, path, data):
def call(self, path, data):
""" """
url = MtGoxAccess.url_api + path
nonce = long(100*time.time()) # max 100 requests per second
if data is None:
data = {'nonce' : time.time()}
data = {'nonce' : nonce}
else:
data.update({'nonce' : time.time()})
data.update({'nonce' : nonce})
# Encode
data = urllib.urlencode(data)
request = urllib2.Request(url, data)
Expand Down Expand Up @@ -171,10 +172,16 @@ class Trade(object):
def __init__(self, mtgox_access):
"""Trade on MtGox """
self.mtgox = mtgox_access

def orders(self):
"""View open orders """

def add(self, todo):
"""Place order """

def cancel(self, todo):
"""Place order """

if __name__ == "__main__":
import doctest
doctest.testmod()

0 comments on commit d7ab2bf

Please sign in to comment.