send_transaction_by_eip1559
方法定义
def send_transaction_by_eip1559(self, to: Optional[ChecksumAddress] = None, data: HexBytes = HexBytes("0x"), value: Wei = Wei(0), base_fee: Optional[Wei] = None, max_priority_fee: Optional[Wei] = None, gas_limit: int = 500000) -> Optional[TransactionReceiptData]参数说明
参数
类型
说明
返回值
示例代码
# 发送 EIP-1559 交易
receipt = account.send_transaction_by_eip1559(
to="0x...",
value=Web3.to_wei(0.1, 'ether'),
max_priority_fee=Web3.to_wei(2, 'gwei')
)
if receipt and receipt.transaction_status:
print(f"Transaction successful: {receipt.transaction_hash.hex()}")
print(f"Effective gas price: {Web3.from_wei(receipt.effective_gas_price, 'gwei')} Gwei")最后更新于