Skip to content
LogoLogo

getTransactionCount

Returns the number of Transactions an Account has broadcast / sent.

Usage

import {  } from './client'
 
const  = await .({  
  : '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
})
 
> 420

Returns

number

The number of transactions an account has sent.

Parameters

address

The address of the account.

const  = await .({
  : '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e', 
})

blockNumber (optional)

  • Type: bigint

Get the count at a block number.

const  = await .({
  : '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
  : 69420n
})

blockTag (optional)

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

Get the count at a block tag.

const  = await .({
  : '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
  : 'safe'
})

Notes

  • The transaction count of an account can also be used as a nonce.

JSON-RPC Method

eth_getTransactionCount