Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def createSignString(params):
- for (i, p) in enumerate(params):
- params[i] = p.upper()
- params = sorted(params)
- sign = ""
- for p in params:
- sign += p + "&"
- sign = sign[:-1]
- m = hashlib.md5()
- m.update(sign.encode('utf-8'))
- return m.hexdigest()
- def placeOrder(apiid, price, quantity, symbol, ptype, timestamp, sign):
- r = requests.post('http://api.coinbene.com/v1/trade/order/place',
- data = {'apiid' : apiid, 'price' : price, 'quantity' : quantity,
- 'symbol' : symbol, 'type' : ptype, 'timestamp' : timestamp, 'sign' : sign })
- print(r.text)
- ts = int(round(time.time() * 1000))
- tsstring = 'timestamp=' + str(ts)
- apiidstr = 'apiid=' + str(180220233838457665082)
- placeOrder(180220233838457665082, '0.000001', 1, 'PLAYETH', 'buy-limit', ts,
- createSignString(['symbol=playeth', 'price=0.000001', 'quantity=1', 'type=buy-limit',
- tsstring, apiidstr, 'secret=LOLNO']))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement