> For the complete documentation index, see [llms.txt](https://poseidon.seaeye.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://poseidon.seaeye.cn/evm/dataclass/transactionreceiptdata.md).

# TransactionReceiptData

交易回执数据结构。

## 字段说明

| 字段                           | 类型                           | 说明                  |
| ---------------------------- | ---------------------------- | ------------------- |
| transaction\_hash            | HexBytes                     | 交易哈希                |
| block\_number                | BlockNumber                  | 区块高度                |
| transaction\_index           | int                          | 交易在区块中的索引           |
| transaction\_status          | int                          | 交易状态(1 成功,0 失败)     |
| transaction\_type            | int                          | 交易类型                |
| action                       | str                          | 交易动作类型              |
| sender                       | ChecksumAddress              | 发送者地址               |
| to                           | ChecksumAddress              | 接收者地址               |
| nonce                        | Nonce                        | 交易序号                |
| value                        | Wei                          | 转账金额                |
| gas\_used                    | int                          | 实际使用的 Gas           |
| gas\_limit                   | int                          | Gas 上限              |
| gas\_price                   | Optional\[Wei]               | Gas 价格              |
| max\_fee\_per\_gas           | Optional\[Wei]               | 最大 Gas 费用(EIP-1559) |
| max\_priority\_fee\_per\_gas | Optional\[Wei]               | 最大优先费用(EIP-1559)    |
| effective\_gas\_price        | Optional\[Wei]               | 实际 Gas 价格           |
| contract\_address            | Optional\[ChecksumAddress]   | 部署的合约地址(仅合约创建交易)    |
| contract                     | Optional\[Any]               | 合约实例(仅合约创建交易)       |
| logs                         | Optional\[List\[LogReceipt]] | 交易日志                |
| input\_data                  | HexBytes                     | 交易输入数据              |
| r                            | HexBytes                     | 签名 r 值              |
| s                            | HexBytes                     | 签名 s 值              |
| v                            | HexBytes                     | 签名 v 值              |

## 示例代码

```python
# 获取交易回执
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}")
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://poseidon.seaeye.cn/evm/dataclass/transactionreceiptdata.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
