Exemplo n.º 1
0
#!/usr/bin/env python3

import requests
import time
import hashlib
import hmac
import base64

from config import apikey_secret
from config import apikey_public
from config import domain
uri = "/account/balance"
url = domain + uri
askey = apikey_secret.encode("utf-8")
apkey = apikey_public.encode("utf-8")
skey = base64.standard_b64decode(askey)
pkey = base64.standard_b64decode(apkey)

# Optional timestamping method, not recommended as ticker results may
# be cached beyond the authentication window.
#
#urt = "/market/BTC/AUD/tick"
#turl = domain + urt
#rt = requests.get(turl, verify=True)
#tstamp = r.json()["timestamp"]
#ctstamp = tstamp * 1000

tstamp = time.time()
ctstamp = int(tstamp * 1000)  # or int(tstamp * 1000) or round(tstamp * 1000)
sctstamp = str(ctstamp)
Exemplo n.º 2
0
#!/usr/bin/env python3

import requests
import time
import hashlib
import hmac
import base64

from config import apikey_secret
from config import apikey_public
from config import domain
uri = "/account/balance"
url = domain + uri
askey = apikey_secret.encode("utf-8")
apkey = apikey_public.encode("utf-8")
skey = base64.standard_b64decode(askey)
pkey = base64.standard_b64decode(apkey)

# Optional timestamping method, not recommended as ticker results may
# be cached beyond the authentication window.
#
#urt = "/market/BTC/AUD/tick"
#turl = domain + urt
#rt = requests.get(turl, verify=True)
#tstamp = r.json()["timestamp"]
#ctstamp = tstamp * 1000

tstamp = time.time()
ctstamp = int(tstamp * 1000)  # or int(tstamp * 1000) or round(tstamp * 1000)
sctstamp = str(ctstamp)