Skip to content

Latest commit

 

History

History
202 lines (109 loc) · 3.61 KB

BitcoinTxHash.md

File metadata and controls

202 lines (109 loc) · 3.61 KB

Class: BitcoinTxHash

Represents a Bitcoin transaction hash (or transaction ID) as an un-prefixed hex string. This hash is supposed to have the same byte order as used by the Bitcoin block explorers which is the opposite of the byte order used by the Bitcoin protocol internally. That means the hash must be reversed in the use cases that expect the Bitcoin internal byte order.

Hierarchy

  • Hex

    BitcoinTxHash

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new BitcoinTxHash(value): BitcoinTxHash

Parameters

Name Type
value string | Buffer

Returns

BitcoinTxHash

Inherited from

Hex.constructor

Defined in

src/lib/utils/hex.ts:7

Properties

_hex

Protected Readonly _hex: Buffer

Inherited from

Hex._hex

Defined in

src/lib/utils/hex.ts:5

Methods

equals

equals(otherValue): boolean

Checks if other value equals the current value.

Parameters

Name Type Description
otherValue Hex Other value that will be compared to this value.

Returns

boolean

True if both values are equal, false otherwise.

Inherited from

Hex.equals

Defined in

src/lib/utils/hex.ts:57


reverse

reverse(): Hex

Returns

Hex

Reversed hexadecimal value.

Inherited from

Hex.reverse

Defined in

src/lib/utils/hex.ts:64


toBuffer

toBuffer(): Buffer

Returns

Buffer

Hexadecimal value as a Buffer.

Inherited from

Hex.toBuffer

Defined in

src/lib/utils/hex.ts:32


toPrefixedString

toPrefixedString(): string

Returns

string

Hexadecimal string prefixed with '0x'.

Inherited from

Hex.toPrefixedString

Defined in

src/lib/utils/hex.ts:46


toString

toString(): string

Returns

string

Unprefixed hexadecimal string.

Inherited from

Hex.toString

Defined in

src/lib/utils/hex.ts:39


from

from(value): Hex

Parameters

Name Type
value string | Buffer

Returns

Hex

Inherited from

Hex.from

Defined in

src/lib/utils/hex.ts:25