Supports querying Nonce for EVM chains, returning only confirmed transaction data.
For example: If the maximum nonce of successfully confirmed transactions on the address chain is 10, the request result will be 11. After broadcasting a transaction with nonce 11, if it remains pending without confirmation, subsequent requests will also return nonce 11.
Therefore, for scenarios involving parallel sending of multiple transactions, please manage nonce manually or wait for transactions to be confirmed before broadcasting the next transaction.
GET https://www.okx.com/api/waas/wallet/pre-transaction/nonce
Parameter | Type | Required | Description |
---|---|---|---|
chainIndex | String | Yes | Unique identifier for the chain |
address | String | Yes | Address |
Parameter | Type | Description |
---|---|---|
nonce | String | Current nonce |
curl --location --request GET 'https://www.okx.com/api/v5/waas/wallet/transaction/nonce?chainIndex=1&address=0x1ucda' \
--header 'Content-Type: application/json' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'
// If the chain is not supported, an error will be returned directly
{
"code": "0",
"data": [
{
"nonce" : "15"
}
],
"msg": "success"
}