Created
July 14, 2021 02:48
-
-
Save staccDOTsol/5c52dd57a05865ecae1ec3c55f667049 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from web3 import Web3 | |
w3= Web3(Web3.HTTPProvider("https://mainnet.infura.io/v3/yourkey", request_kwargs={'timeout': 60})) | |
from web3.gas_strategies.time_based import construct_time_based_gas_price_strategy | |
time_based_gas_price_strategy = construct_time_based_gas_price_strategy( | |
9, 120, 98 | |
) | |
w3.eth.set_gas_price_strategy(time_based_gas_price_strategy) | |
actual = w3.eth.generate_gas_price() | |
print(actual) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment