web3.eth.getTransactionCount

If you want to start learning Ethereum DApp development right away, you can visit the excellent online interactive tutorial provided by Huizhi.com:

Returns the number of transactions initiated by the specified address.

transfer:

web3.eth.getTransactionCount(addressHexString [, defaultBlock] [, callback])

parameter:

  • addressHexString: String - The address to get the transaction number from.
  • defaultBlock: Number|String - (optional) If no parameter is passed, the block defined by web3.eth.defaultBlock is used by default, otherwise the specified block is used.
  • callback: Function - callback function, used to support asynchronous execution 7.

return value:

  • Number- The number of transactions sent by the specified address.

Example:

var number = web3.eth.getTransactionCount("0x407d73d8a49eeb85d32cf465507dd71d507100c1");
console.log(number); // 1

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324841321&siteId=291194637