Wait for transaction by hash​

Same as /transactions/by_hash, but will wait for a pending transaction to be committed.

To be used as a long poll optimization by clients, to reduce latency caused by polling. The "long" poll is generally a second or less but dictated by the server; the client must deal with the result as if the request was a normal /transactions/by_hash request, e.g., by retrying if the transaction is pending.

Path Parameters::

txn_hash string required

Hash of transaction to retrieve

Response Header:

X-APTOS-BLOCK-HEIGHT integer

Current block height of the chain

X-APTOS-CHAIN-ID integer

Chain ID of the current chain

X-APTOS-EPOCH integer

Current epoch of the chain

X-APTOS-LEDGER-OLDEST-VERSION integer

Oldest non-pruned ledger version of the chain

X-APTOS-LEDGER-TIMESTAMPUSEC integer

Current timestamp of the chain

X-APTOS-LEDGER-VERSION integer

Current ledger version of the chain

X-APTOS-OLDEST-BLOCK-HEIGHT integer

Oldest non-pruned block height of the chain

Response Body:

object

Type string

Hash string

sender string<hex> required

A hex encoded 32 byte Aptos account address.

sequence_number string<uint64> required

A string containing a 64-bit unsigned integer.

max_gas_amount string<uint64> required

A string containing a 64-bit unsigned integer.

gas_unit_price string<uint64> required

A string containing a 64-bit unsigned integer.

expiration_timestamp_secs string<uint64> required

A string containing a 64-bit unsigned integer.

payload object required

Payload which runs a single entry function, or

Payload which runs a script that can run multiple functions, or

An enum of the possible transaction payloads

signature object required

A single Ed25519 signature, or

A Ed25519 multi-sig signature, or

Multi agent signature for multi agent transactions

Example:

// Request
curl -X GET -H 'Content-Type: application/json' https://aptos.blockpi.network/aptos/v1/your_api_key/v1/transactions/wait_by_hash/0x6fe169a36817e5b4225a1d878f6a8680f9a032cce180d1b8f4ddef9f0f045b6c

// Result

Last updated

Was this helpful?