Add support for Web3.py v6 and enhance Flashbots module
This pull request introduces support for Web3.py v6 and includes several improvements to the Flashbots module, enhancing type safety and refactoring code for better maintainability.
Key Changes
Web3.py v6 Support
Updated code to be compatible with Web3.py v6
Adjusted type hints and function signatures to align with Web3.py v6 changes
Updated dependencies to include Web3.py v6
Network Handling Refactor
Converted Network type to Enum for improved type safety
Updated FLASHBOTS_NETWORKS to use Network enum as keys
Added EnumAction class for argparse to handle Network enum
Improved Transaction Handling
Updated create_transaction function for dynamic gas price calculation
Enhanced flashbot() function with better documentation
Type Safety Enhancements
Introduced FlashbotsWeb3 class for better type checking
Updated type hints throughout the code to align with Web3.py v6
Code Quality Improvements
Switched from Black to Ruff for code formatting and linting
Reordered and optimized imports across multiple files
Enhanced Logging
Added logging to Flashbots class for key operations
Implemented dynamic logging configuration in simple.py example
Additional Notes
The simple.py example has been updated with command-line arguments for network selection and log level
Error handling for environment variables in examples has been improved
Minor code style improvements and formatting adjustments have been made throughout the project
These changes primarily focus on ensuring compatibility with Web3.py v6 while also enhancing the overall quality, maintainability, and usability of the Flashbots module.
Add support for Web3.py v6 and enhance Flashbots module
This pull request introduces support for Web3.py v6 and includes several improvements to the Flashbots module, enhancing type safety and refactoring code for better maintainability.
Key Changes
Web3.py v6 Support
Network Handling Refactor
Improved Transaction Handling
Type Safety Enhancements
Code Quality Improvements
Enhanced Logging
Additional Notes
These changes primarily focus on ensuring compatibility with Web3.py v6 while also enhancing the overall quality, maintainability, and usability of the Flashbots module.