nonce

Returns an address's transaction count in live, pinned, or retained execution state. Without a CLIENT, it builds a reusable READ and does not access state.

Example

Local

1
SELECT nonce('0x0000000000000000000000000000000000000001'::ADDRESS);
Notebook ready in readonly mode.

API reference

Exact signatures with descriptions, requirements, inputs, returns, and examples.

nonce(CLIENT, ADDRESS) # Immediate Read · RPC required

Reads the account nonce from the CLIENT's current state context; only a live CLIENT necessarily resolves latest state.

Inputs

Name Type Use
client CLIENT

Readable EVM state represented by a live, pinned, or execution CLIENT.

required positional
address ADDRESS

Account or contract address whose transaction count should be read.

required positional

Returns

Name Type
nonce UBIGINT

Account transaction count. Returns the account nonce as UBIGINT. Contract nonces and retained execution state follow the selected CLIENT context.

Guidance

Nonce semantics

nonce returns the account transaction count used by EVM account state; it is not a pending-transaction queue length.

  • Use an explicit block number or pinned CLIENT for repeatable evidence.
  • Historical block reads may require archive-capable RPC access.
  • Use the READ overload when scheduling an observation inside a simulation program.

Additional overloads

nonce(CLIENT, ADDRESS, BIGINT) # Immediate Read · RPC required

Reads the account nonce at an explicit block height; older heights may require archive access.

Inputs

Name Type Use
client CLIENT

Readable EVM state represented by a live, pinned, or execution CLIENT.

required positional
address ADDRESS

Account or contract address whose transaction count should be read.

required positional
block_number BIGINT

Explicit historical block height for a repeatable nonce read.

required positional

Returns

Name Type
nonce UBIGINT

Account transaction count. Returns the account nonce as UBIGINT. Contract nonces and retained execution state follow the selected CLIENT context.

Overload examples

Named parameters · RPC required

1
SELECT nonce($client, '0x0000000000000000000000000000000000000001'::ADDRESS, 21000000);
nonce(ADDRESS) # Read Builder · RPC required

Builds a reusable account-nonce READ; no client is resolved and no state is accessed.

Inputs

Name Type Use
address ADDRESS

Account or contract address whose transaction count should be observed.

required positional

Returns

Name Type
read READ

Account-nonce READ. Returns a canonical READ specification for a later account-nonce observation.

Examples

Named parameters · RPC required

1
SELECT nonce($client, '0x0000000000000000000000000000000000000001'::ADDRESS);
Notebook ready in readonly mode.

Category and tags

Category
Chain reads
Tag
RPC
Tag
Simulate