compilar projecto

This commit is contained in:
2025-10-05 22:16:20 +01:00
parent 41a3dd4da6
commit cb4a51a52a
11 changed files with 233 additions and 9 deletions

View File

@ -36,6 +36,8 @@ def API(
ampersand = "&"
url_pedido = url_raiz_API + api_endpoint + api_params_string
resposta = requests.get(url_pedido, headers=headers)
# log to url do pedido
# print(f"URL: {url_pedido}")
return url_pedido, resposta.status_code, resposta.json()
@ -209,12 +211,14 @@ def coin_price_by_token_addresses(
if not isinstance(include_24hr_change, bool):
include_24hr_change = False
if include_24hr_change != False:
api_parameters["include_24hr_change"] = str(include_24hr_change).lower()
api_parameters["include_24hr_change"] = str(
include_24hr_change).lower()
# include_last_updated_at
if not isinstance(include_last_updated_at, bool):
include_last_updated_at = False
if include_last_updated_at != False:
api_parameters["include_last_updated_at"] = str(include_last_updated_at).lower()
api_parameters["include_last_updated_at"] = str(
include_last_updated_at).lower()
# precision
if not isinstance(precision, (int, str)):
raise TypeError("'precision' tem de ser do tipo 'int' ou 'str'")
@ -542,7 +546,8 @@ def coin_tickers_by_id(
if not isinstance(include_exchange_logo, bool):
raise TypeError("'include_exchange_logo' tem de ser do tipo 'str'")
if include_exchange_logo:
api_parameters["include_exchange_logo"] = str(include_exchange_logo).lower()
api_parameters["include_exchange_logo"] = str(
include_exchange_logo).lower()
# page
if not isinstance(page, int | None):
raise TypeError("'page' tem de ser do tipo 'int'")
@ -861,7 +866,8 @@ def coin_data_by_token_address(
api_parameters["contract_address"] = contract_address
return API(
f"coins/{api_parameters['id']}/contract/{api_parameters['contract_address']}",
f"coins/{api_parameters['id']
}/contract/{api_parameters['contract_address']}",
{},
)
@ -1723,4 +1729,3 @@ def public_companies_holdings(coin_id: str = "") -> tuple[str, int, dict[Any, An
# print(f'{item}: {dados[item]}')
# else:
# print(f'erro {codigo}: {dados}')