Skip to main content

Get the latest nonce used by an account

Retrieves the latest nonce values used by an account by inspecting the mempool, microblock transactions, and anchored transactions.

Path Parameters

principal

string

REQUIRED

Stacks address

Query Parameters

block_height

number

Optionally get the nonce at a given block height.

block_hash

string

Optionally get the nonce at a given block hash. Note - Use either of the query parameters but not both at a time.

Responses

200

Success

Schema

OPTIONAL

last_mempool_tx_nonce

integer

The latest nonce found within mempool transactions sent by this address. Will be null if there are no current mempool transactions for this address.

last_executed_tx_nonce

integer

The latest nonce found within transactions sent by this address, including unanchored microblock transactions. Will be null if there are no current transactions for this address.

possible_next_nonce

integer

The likely nonce required for creating the next transaction, based on the last nonces seen by the API. This can be incorrect if the API's mempool or transactions aren't fully synchronized, even by a small amount, or if a previous transaction is still propagating through the Stacks blockchain network when this endpoint is called.

detected_missing_nonces

integer[]

Nonces that appear to be missing and likely causing a mempool transaction to be stuck.

detected_mempool_nonces

integer[]

OPTIONAL

Nonces currently in mempool for this address.