支持 EVM 链查询 Nonce,只返回上链数据。
比如:当前地址链上已成功的交易最大 nonce 为 10,则请求的结果为 11。广播了 nonce 为 11 的交易以后,当该交易没有上链还在 pending 的状态时,再次请求的结果也是 11。
所以,对于多交易并行发送的场景,请自行维护 nonce,或等交易上链后再进行下一笔交易的广播。
GET https://www.okx.com/api/waas/wallet/pre-transaction/nonce
Parameter | Type | Required | Description |
---|---|---|---|
chainIndex | String | Yes | 链唯一标识 |
address | String | Yes | 地址 |
Parameter | Type | Description | Description |
---|---|---|---|
nonce | String | 当前 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'
//如果不支持的链,直接提示错误
{
"code": "0",
"data": [
{
"nonce" : "15",
}
],
"msg": "success"
}