send_transaction
最后更新于
# 发送 ETH
receipt = account.send_transaction(
to="0x...",
value=Web3.to_wei(0.1, 'ether')
)
if receipt and receipt.transaction_status:
print(f"Transaction successful: {receipt.transaction_hash.hex()}")
# 调用合约函数
contract_function_data = HexBytes("0x...") # 合约函数的编码数据
receipt = account.send_transaction(
to="0x...", # 合约地址
data=contract_function_data,
gas_limit=100000
)