最后更新于
# 获取交易回执
receipt: TransactionReceiptData = chain.get_transaction_receipt_by_hash("0x...")
if receipt.transaction_status:
print(f"Transaction successful: {receipt.transaction_hash.hex()}")
print(f"Block Number: {receipt.block_number}")
print(f"From: {receipt.sender}")
print(f"To: {receipt.to}")
print(f"Value: {Web3.from_wei(receipt.value, 'ether')} ETH")
print(f"Gas Used: {receipt.gas_used}")
if receipt.contract_address:
print(f"Deployed Contract: {receipt.contract_address}")