Spaces:
Runtime error
Runtime error
gauravlochab
commited on
Commit
·
afd26c5
1
Parent(s):
5e378b4
refactor: Add delay before making API request for token price
Browse files- app_value_locked.py +1 -0
app_value_locked.py
CHANGED
@@ -266,6 +266,7 @@ def requests_retry_session(
|
|
266 |
def get_token_price_usd(chain, token_address):
|
267 |
chain_dict = {"optimism": "optimistic-ethereum", "base": "base", "ethereum": "ethereum"}
|
268 |
chain_name = chain_dict.get(chain, chain)
|
|
|
269 |
url = f"https://api.coingecko.com/api/v3/simple/token_price/{chain_name}?contract_addresses={token_address}&vs_currencies=usd"
|
270 |
|
271 |
headers = {
|
|
|
266 |
def get_token_price_usd(chain, token_address):
|
267 |
chain_dict = {"optimism": "optimistic-ethereum", "base": "base", "ethereum": "ethereum"}
|
268 |
chain_name = chain_dict.get(chain, chain)
|
269 |
+
time.sleep(4)
|
270 |
url = f"https://api.coingecko.com/api/v3/simple/token_price/{chain_name}?contract_addresses={token_address}&vs_currencies=usd"
|
271 |
|
272 |
headers = {
|