getTransactionByHashWithProof

返回根据交易哈希查询的带证明的交易信息,本接口仅在兼容性版本为2.2.0及以后的版本有效,证明信息是为了验证交易的存在性,交易存在性证明请参考文档交易证明

参数

  • groupID: unsigned int - 群组ID
  • transactionHash: string - 交易哈希

返回值

  • object: - 交易信息,其字段如下:
    • blockHash: string - 包含该交易的区块哈希
    • blockNumber: string - 包含该交易的区块高度
    • from: string - 发送者的地址
    • gas: string - 发送者提供的gas
    • gasPrice: string - 发送者提供的gas的价格
    • hash: string - 交易哈希
    • input: string - 交易的输入
    • nonce: string - 交易的nonce值
    • to: string - 接收者的地址,创建合约交易的该值为0x0000000000000000000000000000000000000000
    • transactionIndex: string - 交易的序号
    • value: string - 转移的值
  • array - 交易证明,字段如下:
    • left: array - 左边的哈希列表
    • right: array - 右边的哈希列表
  • 示例
  1. curl -X POST --data '{"jsonrpc":"2.0","method":"getTransactionByHashWithProof","params":[1,"0xd2c12e211315ef09dbad53407bc820d062780232841534954f9c23ab11d8ab4c"],"id":1}' http://127.0.0.1:8585 |jq
  2. {
  3. "id": 1,
  4. "jsonrpc": "2.0",
  5. "result": {
  6. "transaction": {
  7. "blockHash": "0xcd31b05e466bce99460b1ed70d6069fdfbb15e6eef84e9b9e4534358edb3899a",
  8. "blockNumber": "0x5",
  9. "from": "0x148947262ec5e21739fe3a931c29e8b84ee34a0f",
  10. "gas": "0x1c9c380",
  11. "gasPrice": "0x1c9c380",
  12. "hash": "0xd2c12e211315ef09dbad53407bc820d062780232841534954f9c23ab11d8ab4c",
  13. "input": "0x8a42ebe90000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000003b9aca00000000000000000000000000000000000000000000000000000000000000000a3564646636663863653800000000000000000000000000000000000000000000",
  14. "nonce": "0x208f6fd78d48aad370df51c6fdf866f8ab022de765c2959841ff2e81bfd9af9",
  15. "to": "0xd6c8a04b8826b0a37c6d4aa0eaa8644d8e35b79f",
  16. "transactionIndex": "0x32",
  17. "value": "0x0"
  18. },
  19. "txProof": [
  20. {
  21. "left": [
  22. "30f0abfcf4ca152815548620e33d21fd0feaa7c78867791c751e57cb5aa38248c2",
  23. "31a864156ca9841da8176738bb981d5da9102d9703746039b3e5407fa987e5183e"
  24. ],
  25. "right": [
  26. "33d8078d7e71df3544f8845a9db35aa35b2638e8468a321423152e64b9004367b4",
  27. "34343a4bce325ec8f6cf48517588830cd15f69b60a05598b78b03c3656d1fbf2f5",
  28. "35ac231554047ce77c0b31cd1c469f1f39ebe23404fa8ff6cc7819ad83e2c029e7",
  29. "361f6c588e650323e03afe6460dd89a9c061583e0d62c117ba64729d2c9d79317c",
  30. "377606f79f3e08b1ba3759eceada7fde3584f01822467855aa6356652f2499c738",
  31. "386722fe270659232c5572ba54ce23b474c85d8b709e7c08e85230afb1c155fe18",
  32. "39a9441d668e5e09a5619c365577c8c31365f44a984bde04300d4dbba190330c0b",
  33. "3a78a8c288120cbe612c24a33cce2731dd3a8fe6927d9ee25cb2350dba08a541f5",
  34. "3bd9b67256e201b5736f6081f39f83bcb917261144384570bdbb8766586c3bb417",
  35. "3c3158e5a82a1ac1ed41c4fd78d5be06bf79327f60b094895b886e7aae57cff375",
  36. "3de9a4d98c5ae658ffe764fbfa81edfdd4774e01b35ccb42beacb67064a5457863",
  37. "3e525e60c0f7eb935125f1156a692eb455ab4038c6b16390ce30937b0d1b314298",
  38. "3f1600afe67dec2d21582b8c7b76a15e569371d736d7bfc7a96c0327d280b91dfc"
  39. ]
  40. },
  41. {
  42. "left": [
  43. "3577673b86ad4d594d86941d731f17d1515f4669483aed091d49f279d677cb19",
  44. "75603bfea5b44df4c41fbb99268364641896334f006af3a3f67edaa4b26477ca",
  45. "1339d43c526f0f34d8a0f4fb3bb47b716fdfde8d35697be5992e0888e4d794c9"
  46. ],
  47. "right": [
  48. "63c8e574fb2ef52e995427a8acaa72c27073dd8e37736add8dbf36be4f609ecb",
  49. "e65353d911d6cc8ead3fad53ab24cab69a1e31df8397517b124f578ba908558d"
  50. ]
  51. },
  52. {
  53. "left": [],
  54. "right": []
  55. }
  56. ]
  57. }
  58. }