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

# Get MIP20 gas for a block

> Returns per-token gas totals and `0x7f` transaction details for a block. Returns `null` if the block is unknown.



## OpenAPI

````yaml /reference/json-rpc/json-rpc.json post /metal_getMip20GasByBlock
openapi: 3.1.0
info:
  title: Metal JSON-RPC
  version: 1.0.0
  description: Interactive playground for Metal's public JSON-RPC endpoints.
servers:
  - url: https://rpc-testnet.metalntwx.com/v1/{endpointId}
    variables:
      endpointId:
        default: YOUR_ENDPOINT_ID
        description: >-
          Your endpoint ID from the Metal console. It is a credential, so keep
          it private. Paste it once, and the playground remembers it in this
          browser.
    description: Testnet
  - url: https://rpc-devnet.metalntwx.com
    description: Devnet
security: []
tags:
  - name: Chain
    description: Identify the chain and its head.
  - name: Consensus
    description: Simplex finality, node build, and gas-token metadata.
  - name: Blocks
    description: Read blocks with Metal's millisecond timestamps and proposer.
  - name: State
    description: Read accounts, contracts, and storage.
  - name: Gas
    description: Quote gas in MIP20 gas-token base units.
  - name: Transactions
    description: Submit and inspect transactions.
  - name: Logs
    description: Query event logs.
  - name: MIP20
    description: Gas-token pricing detail standard Ethereum responses cannot represent.
paths:
  /metal_getMip20GasByBlock:
    post:
      tags:
        - MIP20
      summary: Get MIP20 gas for a block
      description: >-
        Returns per-token gas totals and `0x7f` transaction details for a block.
        Returns `null` if the block is unknown.
      operationId: metal_getMip20GasByBlock
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  default: '2.0'
                  description: JSON-RPC protocol version. Always `2.0`.
                id:
                  type: integer
                  default: 1
                  description: Request identifier echoed back in the response.
                method:
                  type: string
                  enum:
                    - metal_getMip20GasByBlock
                  default: metal_getMip20GasByBlock
                  description: JSON-RPC method name.
                params:
                  type: array
                  prefixItems:
                    - type: string
                      default: >-
                        0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722
                      description: Block hash.
                  items: false
                  minItems: 1
                  maxItems: 1
                  default:
                    - >-
                      0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722
                  description: '`[blockHash]`.'
                  x-default:
                    - >-
                      0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722
            example:
              jsonrpc: '2.0'
              id: 1
              method: metal_getMip20GasByBlock
              params:
                - >-
                  0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722
      responses:
        '200':
          description: >-
            JSON-RPC 2.0 response. Errors are reported in-band via an `error`
            object with `code` and `message` in place of `result`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    enum:
                      - '2.0'
                  id:
                    type: integer
                  result:
                    type:
                      - object
                      - 'null'
                    description: >-
                      Per-token gas totals and MIP20 transaction details, or
                      `null`.
              example:
                jsonrpc: '2.0'
                id: 1
                result:
                  blockHash: >-
                    0xd4ddea8815732fae7af5b907c5d3db50475ed180510e8035789640fb144b1722
                  gasByToken:
                    - gasToken: '0x0000000000000000000000000000000000000000'
                      transactionCount: '0x1'
                      gasUsed: '0x5208'
                      gasCost: '0x5208'
                  transactions:
                    - transactionHash: >-
                        0x0000000000000000000000000000000000000000000000000000000000000000
                      transactionIndex: '0x0'
                      gasUsed: '0x5208'
                      gasCost: '0x5208'
                      transactionType: '0x7f'
                      gasToken: '0x0000000000000000000000000000000000000000'
                      gasLimit: '0x5208'
                      maxFeePerGas: '0x1'
                      maxPriorityFeePerGas: '0x1'
                      effectiveGasPrice: '0x1'
                      maxGasCost: '0x5208'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.