若是你但願立刻開始學習以太坊DApp開發,能夠訪問匯智網提供的出色的在線互動教程:web
指定一個交易哈希,返回一個交易的收據。須要指出的是,處於pending狀態的交易,收據是不可用的。數組
調用:異步
web3.eth.getTransactionReceipt(hashString [, callback])
參數:函數
hashString
: String - 交易的哈希callback
: Function - 回調函數,用於支持異步的方式執行7。返回值:學習
Object
- 交易的收據對象,若是找不到返回null
示例:3d
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. }, ...] }