v6

latestOpenAPI 3.0.0Apache 2.0raw.githubusercontent.com2022-08-07178779.8 KB
Transactions

Get transaction by hash

Look up a transaction by its hash. This is the same hash that is returned by the API when submitting a transaction (see PendingTransaction).

When given a transaction hash, the server first looks for the transaction in storage (on-chain, committed). If no on-chain transaction is found, it looks the transaction up by hash in the mempool (pending, not yet committed).

To create a transaction hash by yourself, do the following:

  1. Hash message bytes: "RawTransaction" bytes + BCS bytes of Transaction.
  2. Apply hash algorithm SHA3-256 to the hash message bytes.
  3. Hex-encode the hash bytes with 0x prefix.
get/transactions/by_hash/{txn_hash}

Path parameters

txn_hashstring required

Response

OR
OR
OR
OR

Example response

{
  "type": "pending_transaction",
  "sequence_number": "32425224034",
  "max_gas_amount": "32425224034",
  "gas_unit_price": "32425224034",
  "expiration_timestamp_secs": "32425224034",
  "payload": {
    "type": "script_function_payload"
  },
  "signature": {
    "type": "ed_25519_signature"
  }
}