Skip to main content
@tevm/voltaire
@tevm/voltaire / primitives/BlockHash

primitives/BlockHash

Classes

InvalidBlockHashFormatError

Defined in: src/primitives/BlockHash/errors.js:18

Extends

  • Error

Constructors

Constructor
new InvalidBlockHashFormatError(message, details?): InvalidBlockHashFormatError
Defined in: src/primitives/BlockHash/errors.js:25
Parameters
message
string
details?
expected?
string
value?
unknown
Returns
InvalidBlockHashFormatError
Overrides
Error.constructor

Properties

details
details: { expected?: string; value?: unknown; } | undefined
Defined in: src/primitives/BlockHash/errors.js:29
name
name: string
Defined in: src/primitives/BlockHash/errors.js:27
Inherited from
Error.name

InvalidBlockHashLengthError

Defined in: src/primitives/BlockHash/errors.js:1

Extends

  • Error

Constructors

Constructor
new InvalidBlockHashLengthError(message, details?): InvalidBlockHashLengthError
Defined in: src/primitives/BlockHash/errors.js:9
Parameters
message
string
details?
context?
Record<string, unknown>
expected?
string
value?
unknown
Returns
InvalidBlockHashLengthError
Overrides
Error.constructor

Properties

details
details: { context?: Record<string, unknown>; expected?: string; value?: unknown; } | undefined
Defined in: src/primitives/BlockHash/errors.js:13
name
name: string
Defined in: src/primitives/BlockHash/errors.js:11
Inherited from
Error.name

Type Aliases

BlockHashType

BlockHashType = Uint8Array & object
Defined in: src/primitives/BlockHash/BlockHashType.ts:6 Block hash (32-byte identifier)

Type Declaration

[brand]
readonly [brand]: "BlockHash"
length
readonly length: 32

Variables

equals()

const equals: (a, b) => boolean = _equals
Defined in: src/primitives/BlockHash/index.ts:14 Check if two BlockHashes are equal

Parameters

a
BlockHashType
b
BlockHashType

Returns

boolean

from()

const from: (value) => BlockHashType = _from
Defined in: src/primitives/BlockHash/index.ts:10 Create BlockHash from various input types

Parameters

value
string | Uint8Array<ArrayBufferLike>

Returns

BlockHashType

Throws


fromBytes()

const fromBytes: (bytes) => BlockHashType = _fromBytes
Defined in: src/primitives/BlockHash/index.ts:11 Create BlockHash from bytes

Parameters

bytes
Uint8Array<ArrayBufferLike>

Returns

BlockHashType

Throws


fromHex()

const fromHex: (hex) => BlockHashType = _fromHex
Defined in: src/primitives/BlockHash/index.ts:12 Create BlockHash from hex string

Parameters

hex
string

Returns

BlockHashType

Throws


toHex()

const toHex: (hash) => string = _toHex
Defined in: src/primitives/BlockHash/index.ts:13 Convert BlockHash to hex string

Parameters

hash
BlockHashType

Returns

string