> For the complete documentation index, see [llms.txt](https://phoenixchain-sdk.phoenix.global/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://phoenixchain-sdk.phoenix.global/blocks-and-transactions/querying-transactions.md).

# Querying Transactions

Loop through the transactions in the block, you can get transaction details.

Import the `types` packages:

```go
import (
    "github.com/PhoenixGlobal/Phoenix-Chain-SDK/ethereum/core/types"
)
```

Query transaction details:

<pre class="language-go"><code class="lang-go">for _, trans := range block.Transactions() {
    fmt.Println(trans.Hash().Hex())	// get transaction hash
    fmt.Println(trans.Value().String()) // get transaction value
    chianID, err := client.ChainID(context.Background())
    if err != nil{
    fmt.Println(err)
    }
    msg, err := trans.AsMessage(types.NewEIP155Signer(chianID))
    if err != nil{
    fmt.Println(err)
    } else{
    fmt.Println(msg.From().Hex()) // get from address
    }
    fmt.Println(trans.To().Hex()) // get to address
<strong>}
</strong></code></pre>

Or get transaction details directly by transaction hash:

```go
txHash := common.HexToHash("0xdc52533193e5b31707d7a8cacb06eb78acbcd13dfc4917c61a2215806ad7ece6")
tx, isPending, err := client.TransactionByHash(context.Background(), txHash)
if err != nil {
    log.Fatal(err)
}
fmt.Println(tx.Hash().Hex())
fmt.Println(isPending)
```

You can also get the transaction receipt by a transaction hash:

```go
txHash := common.HexToHash("0xdc52533193e5b31707d7a8cacb06eb78acbcd13dfc4917c61a2215806ad7ece6")
receipt, err := client.TransactionReceipt(context.Background(), txHash)
fmt.Println(receipt.Status)
fmt.Println(receipt.Logs)
```
