eth_gettransactioncount - Worldchain

Example code for the eth_getTransactionCount JSON-RPC method. Complete guide on how to use eth_getTransactionCount JSON-RPC in GetBlock Web3 documentation.

Returns the number of transactions sent from an address on the World Chain network. This is also known as the nonce.

Parameters

Parameter
Type
Description

address

string

The address to get the transaction count from

blockNumber

string

Block number in hex, or "latest", "earliest", "pending"

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_getTransactionCount",
    "params": ["0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "latest"],
    "id": "getblock.io"
}'

Response

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": "0x1"
}

Response Parameters

Field
Type
Description

result

string

Hexadecimal representation of the number of transactions sent from this address

Use Case

The eth_getTransactionCount method on World Chain is typically used for:

  • Nonce management

  • Transaction sequencing

  • Account activity tracking

  • Transaction preparation

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS-TOKEN

Web3 Integration

Last updated

Was this helpful?