> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstream.io/llms.txt
> Use this file to discover all available pages before exploring further.

# ブロックとトランザクション

> Blocks、Transactions、Events、Calls、その他インフラ Cubes のクエリ例

## 概要

このページでは、ブロック、トランザクション、スマートコントラクトイベント、内部トレースなど、ブロックチェーン基盤に関する Cube のクエリ例を扱います。

***

## ブロック

### 最新ブロック（Solana）

```graphql theme={null}
query {
  Solana {
    Blocks(limit: {count: 10}, orderBy: {descending: Block_Time}) {
      Block {
        Time
        Slot
        Height
        Hash
        ParentSlot
        TxCount
      }
    }
  }
}
```

### 最新ブロック（Ethereum）

```graphql theme={null}
query {
  EVM(network: eth) {
    Blocks(limit: {count: 10}, orderBy: {descending: Block_Time}) {
      Block {
        Time
        Number
        Hash
        GasUsed
        GasLimit
        BaseFee
        TxCount
        Coinbase
      }
    }
  }
}
```

***

## トランザクション

### アドレス別の直近トランザクション（Solana）

```graphql theme={null}
query {
  Solana {
    Transactions(
      signer: {is: "WALLET_ADDRESS"}
      limit: {count: 20}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time Slot }
      Transaction {
        Signature
        Fee
        FeePayer
        Result { Success }
      }
    }
  }
}
```

### アドレス別の直近トランザクション（EVM）

```graphql theme={null}
query {
  EVM(network: eth) {
    Transactions(
      fromAddress: {is: "0xWALLET_ADDRESS"}
      limit: {count: 20}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time Number }
      Transaction {
        Hash
        From
        To
        Value
        Gas
        GasPrice
      }
    }
  }
}
```

***

## イベント（EVM のみ）

### コントラクトとトピックでイベントをフィルター

```graphql theme={null}
query {
  EVM(network: eth) {
    Events(
      contractAddress: {is: "0xCONTRACT_ADDRESS"}
      limit: {count: 20}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time Number }
      Transaction { Hash }
      Log {
        SmartContract
        Index
        Signature { Name Signature }
        Data
      }
    }
  }
}
```

### イベントシグネチャ（Topic0）でフィルター

```graphql theme={null}
query {
  EVM(network: eth) {
    Events(
      topic0: {is: "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"}
      limit: {count: 10}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time }
      Transaction { Hash }
      Log { SmartContract Index Data }
    }
  }
}
```

***

## コール / トレース（EVM のみ）

### コントラクトへの内部コール

```graphql theme={null}
query {
  EVM(network: eth) {
    Calls(
      toAddress: {is: "0xCONTRACT_ADDRESS"}
      limit: {count: 20}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time Number }
      Transaction { Hash }
      Call {
        From
        To
        Opcode
        Value
        Gas
        GasUsed
        Signature { Name }
      }
    }
  }
}
```

***

## インストラクション（Solana のみ）

### プログラムの直近インストラクション

```graphql theme={null}
query {
  Solana {
    Instructions(
      programId: {is: "PROGRAM_ADDRESS"}
      limit: {count: 20}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time Slot }
      Transaction { Signature }
      Instruction {
        Index
        Depth
        Program { Address Name Method }
        Accounts
      }
    }
  }
}
```

***

## リワード（Solana のみ）

### バリデータのステーキング報酬

```graphql theme={null}
query {
  Solana {
    Rewards(
      address: {is: "VALIDATOR_ADDRESS"}
      limit: {count: 50}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time Slot }
      Reward {
        Address
        Amount
        AmountInUSD
        PostBalance
        RewardType
        Commission
      }
    }
  }
}
```

***

## マイナー報酬（EVM のみ）

### ブロック報酬の内訳

```graphql theme={null}
query {
  EVM(network: eth) {
    MinerRewards(
      limit: {count: 20}
      orderBy: {descending: Block_Time}
    ) {
      Block { Time Number }
      Reward {
        Miner
        TotalReward
        TotalRewardInUSD
        StaticReward
        DynamicReward
        TxFees
        BurntFees
      }
    }
  }
}
```

***

## 関連ドキュメント

<CardGroup cols={2}>
  <Card title="Data Cubes" icon="cubes" href="/jp/graphql/schema/cubes">
    Blocks、Transactions、Events、Calls を含むすべての Cube のフィールド構造の詳細。
  </Card>

  <Card title="Chain Groups" icon="layer-group" href="/jp/graphql/schema/chain-groups">
    EVM と Solana でどの Cube が利用可能かを理解する。
  </Card>
</CardGroup>
