Comment on page
eth_getTransactionCount
Returns the number of transactions sent from an address.
Command Shell
Bash
## using block numbers
curl https://bsc-<network>.web3api.com/v1/YOUR-API-KEY
-X POST
-H "Content-Type: application/json"
-d "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionCount\",\"params\": [\"0x71C7656EC7ab88b098defB751B7401B5f6d8976F\", \"0x6D8185\"],\"id\":1}"
## using pre-defined strings
curl https://bsc-<network>.web3api.com/v1/YOUR-API-KEY
-X POST
-H "Content-Type: application/json"
-d "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionCount\",\"params\": [\"0x71C7656EC7ab88b098defB751B7401B5f6d8976F\", \"latest\"],\"id\":1}"
## using block numbers
curl -X POST 'https://bsc-<network>.web3api.com/v1/YOUR-API-KEY' \
-H 'Content-Type: application/json' \
--data-raw '{"jsonrpc":"2.0","method":"eth_getTransactionCount","params": ["0x71C7656EC7ab88b098defB751B7401B5f6d8976F", "0x6D8185"],"id":1}'
## using pre-defined strings
curl -X POST 'https://bsc-<network>.web3api.com/v1/YOUR-API-KEY' \
-H 'Content-Type: application/json' \
--data-raw '{"jsonrpc":"2.0","method":"eth_getTransactionCount","params": ["0x71C7656EC7ab88b098defB751B7401B5f6d8976F", "latest"],"id":1}'
Request Parameters
Response
- 1.
ADDRESS
- A string representing the address to check for balance. - 2.
BLOCK PARAMETER
- Anint
block number in the form of hex, appended with 0x such as0x6D7FE0
, or pre-defined stringslatest
,earliest
,pending
.
Web3API's Composer accepts
int
block numbers, which will be auto-converted to a hex representation before being sent to a node. Result Fields
TRANSACTION COUNT
- A hex code of an integer representing the number of transactions sent from this address.Body
{
"jsonrpc":"2.0",
"id":1,
"result":"0x0"
}
Last modified 2yr ago