getTransactionCount
Callable
Type parameters
- ReturnFormat: DataFormat
Parameters
web3Context: Web3Context<EthExecutionAPI, any>
address: string
The address to get the number of transactions for.
blockNumber: BlockNumberOrTag = web3Context.defaultBlock
(BlockNumberOrTag defaults to Web3Eth.defaultBlock) Specifies what block to use as the current state for the query.
returnFormat: ReturnFormat
(DataFormat defaults to DEFAULT_RETURN_FORMAT) Specifies how the return data should be formatted.
Returns Promise<NumberTypes[ReturnFormat[number]]>
The number of transactions sent from the provided address.
web3.eth.getTransactionCount("0x407d73d8a49eeb85d32cf465507dd71d507100c1").then(console.log);
> 1n
web3.eth.getTransactionCount(
"0x407d73d8a49eeb85d32cf465507dd71d507100c1",
undefined,
{ number: FMT_NUMBER.NUMBER , bytes: FMT_BYTES.HEX }
).then(console.log);
> 1
(Web3Context) Web3 configuration object that contains things such as the provider, request manager, wallet, etc.