QubicTypeScript

computeTransactionHash

Computes the canonical K12 hash of transaction bytes as a hex TxHash.

computeTransactionHash(txBytes)

Computes the canonical transaction hash: K12 of the transaction bytes, truncated to 32 bytes, returned as a 60-character lowercase hex TxHash. Use this to look the transaction up in the archive after broadcasting.

import { computeTransactionHash } from "@qubic.org/tx"

const hash: TxHash = computeTransactionHash(signed)
// Use to poll the archive for confirmation
const result = await archive.getTransaction(hash)

Parameters

NameTypeDescription
txBytesUint8ArraySigned transaction bytes

Returns TxHash — 60-character lowercase hex string.

On this page