def __init__(self): key,secret,passphrase = unlock_api_key.unlock("bitfloor") self._key = key self._secret = secret self._passphrase = passphrase self._product_id = 1 #the 1 means "product_ID" is USD (currently our only option anyway) self._inc = D('0.01') # (the currency precision) TODO: get from bitfloor(can't yet)
def __init__(self, enc_password=""): #This is part of my encrypt_api_key and unlock_api_key file. #without these, set self.key and self.secret to your API Key/Secret in " " self.key,self.secret,self.enc_password = unlock_api_key.unlock("mtgox") self.buff = "" self.__url_parts = "https://data.mtgox.com/api/" self.query_now = time.time() self.query_last = time.time() self.query_count = 0 self.query_limit_per_time_slice = 40 self.query_time_slice = 20 self.query_timeout = 5 self.order_first = 0 self.order_now = time.time() self.order_last = time.time() self.order_count = 0 self.order_limit_per_time_slice = 6 self.order_time_slice = 6 self.order_timeout = 0.1 self.order_ban = 0 #self.throttled = False self.cPrec = D('0.00001') self.bPrec = D('0.00000001') self.orders = [] self.fulldepth = []
def __init__(self, enc_password=""): #This is part of my encrypt_api_key and unlock_api_key file. #without these, set self.key and self.secret to your User ID and password self.key,self.secret,_ = unlock_api_key.unlock("bitstamp",enc_password) self.cPrec = D('0.01') self.bPrec = D('0.00000001')
def __init__(self, encpassword=""): self._key, self._secret, self._passphrase = unlock_api_key.unlock( "bitfloor", encpassword) self._product_id = 1 #the 1 means "product_ID" is USD (currently our only option anyway) self._inc = D( '0.01' ) # (the currency precision) TODO: get from bitfloor(can't yet) self.cPrec = D('0.01') self.bPrec = D('0.00001')
def __init__(self, enc_password=""): #unlock the encrypted API key file self.key,self.secret,_ = unlock_api_key.unlock("btc-e")
def __init__(self, enc_password=""): #unlock the encrypted API key file self.key, self.secret, _ = unlock_api_key.unlock("btc-e")
import hmac import time import winsound import os import unlock_api_key fullpath = os.path.dirname(os.path.realpath(__file__)) if os.name == 'nt': partialpath=os.path.join(fullpath + '\\..\\data\\') else: partialpath=os.path.join(fullpath + '/../data/' + site) BTC_api_key,BTC_api_secret,unused = unlock_api_key.unlock("btc-e") #you must have a nonce_state_btce file located in your ..\data\ directory with an integer number inside the file def nonce_generator(): fd = open(os.path.join(partialpath + 'nonce_state_btce') ,'r') nonce = int(fd.read()) fd.close() while (True): nonce = nonce+1 fd = open(os.path.join(partialpath + 'nonce_state_btce'),'w') fd.write(str(nonce)) fd.close() yield nonce def btcepost(method) : nonce = nonce_generator()
import json import hashlib import hmac import time import os if os.name == 'nt': import winsound import unlock_api_key fullpath = os.path.dirname(os.path.realpath(__file__)) if os.name == 'nt': partialpath = os.path.join(fullpath + '\\..\\data\\') else: partialpath = os.path.join(fullpath + '/../data/') BTC_api_key, BTC_api_secret, unused = unlock_api_key.unlock("btc-e") #you must have a nonce_state_btce file located in your ..\data\ directory with an integer number inside the file def nonce_generator(): fd = open(os.path.join(partialpath + 'nonce_state_btce'), 'r') nonce = int(fd.read()) fd.close() while (True): nonce = nonce + 1 fd = open(os.path.join(partialpath + 'nonce_state_btce'), 'w') fd.write(str(nonce)) fd.close() yield nonce
def __init__(self, encpassword=""): self._key, self._secret, self._passphrase = unlock_api_key.unlock("bitfloor", encpassword) self._product_id = 1 # the 1 means "product_ID" is USD (currently our only option anyway) self._inc = D("0.01") # (the currency precision) TODO: get from bitfloor(can't yet) self.cPrec = D("0.01") self.bPrec = D("0.00001")