Example #1
0
def priceupdate():
    a=OAuthClient("7676d0b819a701688eef2f52652e8cbcf2107e440c9c11113ae811f38dfac1ed","5d2eec22fd3bc63edd19758a448b14975c0832ab8ca0ac6a1be2c6676c28ec3e")
    spot_price(btc=(float(a.get_buy_price(currency_pair="BTC-USD").amount)),
           eth=(float(a.get_buy_price(currency_pair="ETH-USD").amount)),
           bch=(float(a.get_buy_price(currency_pair="BCH-USD").amount)),
           ltc=(float(a.get_buy_price(currency_pair="LTC-USD").amount)),
           etc=(float(a.get_buy_price(currency_pair="ETC-USD").amount)),
           ).save()
Example #2
0
def print_price(client: OAuthClient, base: str, currency: str) -> None:
    currency_pair = '{}-{}'.format(base, currency)
    print(f'Price for {currency_pair}:')
    print('Buy price:',
          client.get_buy_price(currency_pair=currency_pair).amount)
    print('Sell price:',
          client.get_sell_price(currency_pair=currency_pair).amount)
    print('Spot price:',
          client.get_spot_price(currency_pair=currency_pair).amount)