In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "how to use web3.eth.getTransactionReceipt". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Specify a transaction hash and return a receipt for a transaction. It should be noted that receipts are not available for transactions in the pending state.
Call:
Web3.eth.getTransactionReceipt (hashString [, callback])
Parameters:
HashString: String-Hash of the transaction
Callback: Function-callback function to support asynchronous execution of 7.
Return value:
Object-the receipt object for the transaction, if not found, return null
BlockHash: String-32 bytes, the hash of this exchange in the block.
BlockNumber: Number-the block number of the block where the exchange is located.
TransactionHash: String-32 bytes, the hash value of the transaction.
TransactionIndex: Number-the serial number of the transaction in the block, integer.
From: String-20 bytes, the address of the transaction sender.
To: String-20 bytes, address of the recipient of the transaction. If it is a deal created by a contract, return null.
CumulativeGasUsed: Number-the total gas value of the cumulative cost after the execution of the current transaction.
GasUsed: Number-the gas spent separately to execute the current transaction.
ContractAddress: String-20 bytes, the address of the contract created. If it is a contract creation transaction, return the contract address, and otherwise return null.
Logs: Array-an array of log objects generated by this transaction.
Example:
Var receipt = web3.eth.getTransactionReceipt ('0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b'); console.log (receipt) {"transactionHash": "0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b", "transactionIndex": 0, "blockHash": "0xef95f2f1ed3ca60b048b4bf67cde2195961e0bba6f70bcbea9a2c4e133e34b46", "blockNumber": 3, "contractAddress": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "cumulativeGasUsed": 314159, "gasUsed": 30234, "logs": [{/ / logs as returned by getFilterLogs, etc.},...]} "how to use web3.eth.getTransactionReceipt" is introduced here, thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.