Skip to main content
3 of 14
Tidy
BokkyPooBah
  • 40.4k
  • 14
  • 123
  • 193

eth.getTransaction("{txhash}") and eth.getTransactionReceipt("{txhash}") will provide you with the details.

The .blockNumber field will be null until the transaction is included into a mined block.

Examples:

> eth.getTransaction(eth.getBlock("latest").transactions[1])
{
  blockHash: "0x425a4d04ac0185863266b0d1b000f579f9675a37c5c6df3bf3cf72e0bc9a94e7",
  blockNumber: 1701040,
  from: "0x81747eb1afd9e2670aa6883ed80973ffcb531e1f",
  gas: 666666,
  gasPrice: 20000000000,
  hash: "0x6ef5b459ed945fbabfc3a5ef34fb0087752002c319649ff44c3b2759d13a517d",
  input: "0xf04fd2f3000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000001e0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
  nonce: 16,
  to: "0x2cac6e4b11d6b58f6d3c1c9d5fe8faa89f60e5a2",
  transactionIndex: 1,
  value: 0
}

// No pending transactions - eth.getBlock("pending").transactions[0] = null
> eth.getTransaction(eth.getBlock("pending").transactions[0])
invalid or missing value for params[0]
    at web3.js:3119:20
    at web3.js:6023:15
    at web3.js:4995:36
    at <anonymous>:1:1

// Pending transaction
> eth.getTransaction(eth.getBlock("pending").transactions[0])
{
  blockHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
  blockNumber: null,
  from: "0xea674fdde714fd979de3edf0f56aa9716b898ec8",
  gas: 90000,
  gasPrice: 20000000000,
  hash: "0xdfa60d4e97c242c5222a11b485c051bbdeb133c99baccd34dc33ceae1dc0cd67",
  input: "0x",
  nonce: 181930,
  to: "0x4ac944f4e8ab60f9481bcecd78a9915ed3eb98ba",
  transactionIndex: null,
  value: 1005685497455181600
}
BokkyPooBah
  • 40.4k
  • 14
  • 123
  • 193