From: Ardis Lu Date: Sun, 29 Jun 2025 05:46:35 +0000 (-0700) Subject: Make block number field optional X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=6c70fd8869f231ea348979ae2dacc7e332f11418;p=block-hash-calculator Make block number field optional --- diff --git a/index.html b/index.html index a25ab30..acdd32b 100644 --- a/index.html +++ b/index.html @@ -27,8 +27,8 @@ GitHub

Enter a block number and a JSON-RPC provider below to recalculate the block's hash from its header fields. Known supported networks: Ethereum, Polygon PoS, BNB Chain, OP Mainnet, Base, Arbitrum One, Linea, Scroll, Blast, Mantle, Avalanche C-Chain, ZKsync Era, Ink Mainnet, Sonic Mainnet, Unichain, World Chain, Soneium, Zircuit Mainnet, and Taiko Alethia.

- - + + @@ -72,7 +72,7 @@ jsonrpc: '2.0', id: 1, method: 'eth_getBlockByNumber', - params: [`0x${BigInt(num).toString(16)}`, false] + params: [num === '' ? 'latest' : `0x${BigInt(num).toString(16)}`, false] }) }).then(r => r.json()).catch(e => e);