Bware Docs
  • About Bware Labs Decentralized API
  • API Docs
    • Ethereum API
      • RPC
        • eth_getBlockByNumber method
        • eth_getBalance method
        • eth_blockNumber method
        • eth_syncing method
      • Websocket API
        • eth_syncing method
    • Binance Smart Chain API
      • RPC
        • eth_getTransactionByHash method
        • eth_getBlockByNumber method
        • eth_blockNumber method
        • eth_syncing method
        • eth_getBalance method
        • eth_accounts method
        • eth_gasPrice method
      • Websocket API
        • eth_syncing method
    • Avalanche API
      • X-Chain
      • C-Chain
      • P-Chain
      • Keystore API
      • Health API
      • Admin API
      • Info API
      • Metrics API
    • Moonbeam/Moonriver API
      • RPC
        • eth_getBlockByNumber method
        • eth_getBalance method
        • eth_blockNumber method
        • eth_syncing method
      • Websocket
    • Astar/Shiden APIs
      • RPC
        • eth_getBlockByNumber method
        • eth_getBalance method
        • eth_blockNumber method
        • eth_syncing method
      • Websocket
    • Fantom API
      • RPC
        • eth_getBlockByNumber method
        • eth_getBalance method
        • eth_blockNumber method
        • eth_syncing method
      • Websockets
        • eth_syncing method
    • Polkadot API
      • RPC
        • chain_getBlock
        • chain_getHeader
        • system_chainType
        • state_getMetadata
      • Websockets
        • system_chainType
    • Elrond API
      • REST API
        • Get Block By Hash
        • Get Shard Status
  • Tutorials
    • Using Bware Labs Platform
      • Getting a Bware Labs full endpoint
    • Using Bware Labs Endpoint in PolkadotJs
    • Using Bware Labs Endpoint in Metamask
    • Using a Bware Labs endpoint in code
Powered by GitBook
On this page
  • Parameters
  • Returns
  • Example

Was this helpful?

  1. API Docs
  2. Moonbeam/Moonriver API
  3. RPC

eth_getBlockByNumber method

Returns data about a block given its block number

PreviousRPCNexteth_getBalance method

Last updated 3 years ago

Was this helpful?

Parameters

  1. TAG - integer of a block number, or the string "earliest", "latest" or "pending", as in the .

  2. Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions.

Returns

Data about the specified block as seen below

Example

// Request
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "eth_getBlockByNumber","params": ["0x1b4", true]}' https://moonbeam-api.bwarelabs.com/<your-endpoint-id>

// Response
{

   "jsonrpc":"2.0",
   "id":1,
   "result":{
      "difficulty":"0x4ea3f27bc",
      "extraData":"0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32",
      "gasLimit":"0x1388",
      "gasUsed":"0x0",
      "hash":"0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae",
      "logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
      "miner":"0xbb7b8287f3f0a933474a79eae42cbca977791171",
      "mixHash":"0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843",
      "nonce":"0x689056015818adbe",
      "number":"0x1b4",
      "parentHash":"0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54",
      "receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
      "sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
      "size":"0x220",
      "stateRoot":"0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d",
      "timestamp":"0x55ba467c",
      "totalDifficulty":"0x78ed983323d",
      "transactions":[
      ],
      "transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
      "uncles":[ 
      ]
   }
}
default block parameter