예제 #1
0
def settings_context_processor(request):
    return {
        "account_name_force": settings.ACCOUNTS_NAME_FORCE,
        "google_tracking_id": settings.GOOGLE_TRACKING_ID,
        "test_net": settings.TEST_NET,
        "wallet_url": settings.WALLET_URL,
        "burst_info": {
            "exchange": get_exchange_info()
        },
    }
예제 #2
0
 def test_test_net(self):
     self.assertDictEqual(
         get_exchange_info(_refresh=True),
         {
             "price_usd": 0,
             "24h_volume_usd": 0,
             "market_cap_usd": 0,
             "percent_change_24h": 0,
         },
     )
예제 #3
0
 def test_test_net(self):
     self.assertDictEqual(
         get_exchange_info(_refresh=True),
         {
             'price_usd': 0,
             '24h_volume_usd': 0,
             'market_cap_usd': 0,
             'percent_change_24h': 0,
         }
     )
def settings_context_processor(request):
    return {
        'account_name_force': settings.ACCOUNTS_NAME_FORCE,
        'google_tracking_id': settings.GOOGLE_TRACKING_ID,
        'test_net': settings.TEST_NET,
        'wallet_url': settings.WALLET_URL,
        'burst_info': {
            'exchange': get_exchange_info(),
        }
    }
예제 #5
0
 def test_ok(self):
     self.assertDictEqual(
         get_exchange_info(_refresh=True),
         {
             "id": "burst",
             "name": "Burst",
             "symbol": "BURST",
             "rank": "437",
             "price_usd": 0.002973448,
             "price_btc": "0.00000038",
             "24h_volume_usd": 38229.8232334,
             "market_cap_usd": 6078590.0,
             "available_supply": "2044290023.0",
             "total_supply": "2044290023.0",
             "max_supply": "2158812800.0",
             "percent_change_1h": "-3.81",
             "percent_change_24h": -5.14,
             "percent_change_7d": "-4.53",
             "last_updated": "1559812981",
         },
     )
예제 #6
0
def in_usd(value: float) -> float:
    info = get_exchange_info()
    return value * info["price_usd"]