Skip to content
LogoLogo

getBlockTransactionCount

Returns the number of Transactions at a block number, hash or tag.

Usage

import {  } from './client'
 
const  = await .getBlockTransactionCount() 
 
Output: 23

Returns

number

The block transaction count.

Parameters

blockHash (optional)

Count at a given block hash.

const  = await .getBlockTransactionCount({
  : '0x89644bbd5c8d682a2e9611170e6c1f02573d866d286f006cbf517eec7254ec2d'
})

blockNumber (optional)

  • Type: bigint

Count at a given block number.

const  = await .getBlockTransactionCount({
  : 42069n
})

blockTag (optional)

  • Type: 'latest' | 'earliest' | 'pending' | 'safe' | 'finalized'
  • Default: 'latest'

Count at a given block tag.

const  = await .getBlockTransactionCount({
  : 'safe'
})

JSON-RPC Method