-
-
Notifications
You must be signed in to change notification settings - Fork 114
/
Copy pathgastracker.py
29 lines (26 loc) · 862 Bytes
/
gastracker.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from etherscan.enums.actions_enum import ActionsEnum as actions
from etherscan.enums.fields_enum import FieldsEnum as fields
from etherscan.enums.modules_enum import ModulesEnum as modules
class GasTracker:
@staticmethod
def get_est_confirmation_time(gas_price: int) -> str:
# NOTE: gas_price in wei, result in seconds
url = (
f"{fields.MODULE}"
f"{modules.GASTRACKER}"
f"{fields.ACTION}"
f"{actions.GAS_ESTIMATE}"
f"{fields.GAS_PRICE}"
f"{gas_price}"
)
return url
@staticmethod
def get_gas_oracle() -> str:
# NOTE: gas_price in wei, result in seconds
url = (
f"{fields.MODULE}"
f"{modules.GASTRACKER}"
f"{fields.ACTION}"
f"{actions.GAS_ORACLE}"
)
return url