Skip to main content

Get transaction by hash

GET 

/transactions/by_hash/:txn_hash

Retrieves a transaction by its hash. This hash is the same value returned by the API when submitting a transaction (Pending Transaction).

How to generate a transaction hash directly:

  1. Create message bytes: concatenate "RawTransaction" bytes + the transaction's BCS bytes
  2. Apply the SHA3-256 hash algorithm to the message bytes
  3. Encode the hashed bytes as a hex string with the 0x prefix

Request

Responses

Successful Response

Response Headers
    X-APTOS-BLOCK-HEIGHT

    Current block height of the chain

    X-APTOS-CHAIN-ID

    Chain ID of the current chain

    X-APTOS-EPOCH

    Current epoch of the chain

    X-APTOS-LEDGER-OLDEST-VERSION

    Oldest unpruned ledger version of the chain

    X-APTOS-LEDGER-TIMESTAMPUSEC

    Current timestamp of the chain

    X-APTOS-LEDGER-VERSION

    Current ledger version of the chain

    X-APTOS-OLDEST-BLOCK-HEIGHT

    Oldest unpruned block height of the chain

    X-APTOS-CURSOR

    Cursor for the next page

    X-APTOS-GAS-USED

    Amount of gas actually used for transaction execution