⚠️Blast API (blastapi.io) ends Oct 31. Migrate to Dwellir and skip Alchemy's expensive compute units.
Switch Today →
Skip to main content

eth_getBlockByHash

Overview

Returns information about a block specified by hash.

Movement-Specific Considerations

  • Identical to Ethereum clients. Fast finality (~1–3s) for recent blocks.

Parameters

NameTypeRequiredDescription
blockHash0x-hexYesBlock hash
fullTxObjectsbooleanYestrue for full transactions, else only hashes

Returns

Block object or null if not found.

Code Examples

cURL

curl -X POST https://api-movement-mainnet.n.dwellir.com/YOUR_API_KEY/v1 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getBlockByHash","params":["0x<hash>", false],"id":1}'

Ethers.js v6

import { JsonRpcProvider } from 'ethers';
const provider = new JsonRpcProvider('https://api-movement-mainnet.n.dwellir.com/YOUR_API_KEY/v1');
const block = await provider.send('eth_getBlockByHash', ['0x<hash>', false]);
console.log(block);

Web3.js

import Web3 from 'web3';
const web3 = new Web3('https://api-movement-mainnet.n.dwellir.com/YOUR_API_KEY/v1');
const block = await web3.eth.getBlock('0x<hash>', false);
console.log(block);

viem

import { createPublicClient, http } from 'viem';

const movement = {
id: 3073,
name: 'Movement',
nativeCurrency: { name: 'MOVE', symbol: 'MOVE', decimals: 18 },
rpcUrls: { default: { http: ['https://api-movement-mainnet.n.dwellir.com/YOUR_API_KEY/v1'] } },
} as const;

const client = createPublicClient({ chain: movement, transport: http('https://api-movement-mainnet.n.dwellir.com/YOUR_API_KEY/v1') });
const block = await client.getBlock({ blockHash: '0x<hash>' });
console.log(block);