예제 #1
0
 def getprices(self):
     try:
         client = Client()
         symbols = client.symbols()
         btcsymbol = 'btc'
         ethsymbol = 'eth'
         symbol = 'btcusd'
         lastprice = client.ticker(symbol)['last_price']
         btcresponse = client.lends(btcsymbol)
         ethresponse = client.lends(ethsymbol)
         self.newbtclent = float(btcresponse[0]['amount_lent'])
         self.newbtcused = float(btcresponse[0]['amount_used'])
         self.newethlent = float(ethresponse[0]['amount_lent'])
         self.newethused = float(ethresponse[0]['amount_used'])
         self.keepgoing = 1
     except:
         print('unable to get price data')
예제 #2
0
	def getprices(self):
		try:
			client = Client()
			symbols = client.symbols()
			btcsymbol = 'btc'
			ethsymbol = 'eth'
			symbol = 'btcusd'
			lastprice = client.ticker(symbol)['last_price']
			btcresponse = client.lends(btcsymbol)
			ethresponse = client.lends(ethsymbol)
			self.newbtclent = float(btcresponse[0]['amount_lent'])
			self.newbtcused = float(btcresponse[0]['amount_used'])
			self.newethlent = float(ethresponse[0]['amount_lent'])
			self.newethused = float(ethresponse[0]['amount_used'])
			self.keepgoing = 1
		except:
			print ('unable to get price data')