get_transaction_receipt_by_block_id_and_index
方法定义
def get_transaction_receipt_by_block_id_and_index(self, block_id: BlockIdentifier, transaction_index: int) -> Optional[TransactionReceiptData]参数说明
参数
类型
说明
返回值
示例代码
# 获取最新区块的第一笔交易
receipt = chain.get_transaction_receipt_by_block_id_and_index("latest", 0)
if receipt:
print(f"Transaction Hash: {receipt.transaction_hash.hex()}")
print(f"From: {receipt.sender}")
print(f"To: {receipt.to}")
print(f"Value: {Web3.from_wei(receipt.value, 'ether')} ETH")最后更新于