Get the latest nonce
Retrieves the latest nonce values used by an account by inspecting the mempool and anchored transactions.
Path Parameters
Query Parameters
Optionally get the nonce at a given block height.
1 <= value
Optionally get the nonce at a given block hash. Note - Use either of the query parameters but not both at a time.
Response Body
The latest nonce values used by an account by inspecting the mempool, microblock transactions, and anchored transactions
TypeScript Definitions
Use the response body type in TypeScript.
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.
Nonces that appear to be missing and likely causing a mempool transaction to be stuck.
Nonces currently in mempool for this address.
Default Response
TypeScript Definitions
Use the response body type in TypeScript.
curl -X GET "https://api.hiro.so//extended/v1/address/SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP/nonces?block_height=66119&block_hash=0x72d53f3cba39e149dcd42708e535bdae03d73e60d2fe853aaf61c0b392f521e9"
fetch("https://api.hiro.so//extended/v1/address/SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP/nonces?block_height=66119&block_hash=0x72d53f3cba39e149dcd42708e535bdae03d73e60d2fe853aaf61c0b392f521e9")
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.hiro.so//extended/v1/address/SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP/nonces?block_height=66119&block_hash=0x72d53f3cba39e149dcd42708e535bdae03d73e60d2fe853aaf61c0b392f521e9"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
import requests
url = "https://api.hiro.so//extended/v1/address/SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP/nonces?block_height=66119&block_hash=0x72d53f3cba39e149dcd42708e535bdae03d73e60d2fe853aaf61c0b392f521e9"
response = requests.request("GET", url)
print(response.text)
{
"last_mempool_tx_nonce": 0,
"last_executed_tx_nonce": 0,
"possible_next_nonce": 0,
"detected_missing_nonces": [
0
],
"detected_mempool_nonces": [
0
]
}
{
"error": "string",
"message": "string"
}