Build transactions on diverse Blockchains with Python & Rust Manipulate MEV with Python & Rust Key Features:
- Multi-chain support: EVM-compatible chains and Tendermint-based chains
- Modular design: Separate builders for different blockchain types
- Extensibility: Easy to add support for new chains or transaction types
- DeFi operations: Token swapping with multiple aggregator support
- Staking operations: Particularly detailed for Polygon staking
Areas for Potential Expansion:
- Implement more Tendermint-based chain operations in Rust
- Expand Injective Protocol support beyond send transactions
- Add support for more DeFi operations across different chains
- Implement error handling and recovery mechanisms
- Add more comprehensive testing and documentation
Requirements:
- Python 3.10+
- Rust 1.81+
- Polygon
- Ethereum
- EVM-like Blockchains
Python implementation (evm/builder.py
and evm/swapper.py
)
Rust implementation (evm/swapper.rs
)
-
setup_web3_connection
function:- Establishes a Web3 connection to an EVM-compatible blockchain
-
EVMTransactionBuilder
class: Handles gas estimation, contract ABI fetching, and transaction building Supports allowance, contract interactions, and transaction signing/broadcasting -
PolygonStakingTransactionBuilder
class (extendsEVMTransactionBuilder
):- Specialized for Polygon staking operations
- Supports staking, unstaking, restaking, and reward withdrawal
-
Swapper
class:- Implements token swapping functionality
- Supports multiple aggregators (e.g., 1inch, Uniswap)
- Handles token approvals and swap execution
- Cosmos
- Celestia
- ...
Python implementation (tendermint/builder.py
):
-
Abstract
TendermintTxBuilder
class:- Defines interface for Tendermint-based blockchain transactions
-
CosmosTxBuilder
class (implementsTendermintTxBuilder
):- Supports send, delegate, undelegate, and redelegate transactions
-
InjectiveTxBuilder
class (implementsTendermintTxBuilder
):- Specialized for Injective Protocol transactions
- Currently implements send transaction
- Solana
Python implementation (solana/builder.py
):
-
Abstract
SolanaTxBuilder
class:- Defines interface for Solana transactions
-
SolanaTxBuilder
class (implementsSolanaTxBuilder
):- Supports send transaction