@tevm/voltaire / primitives/BinaryTree
primitives/BinaryTree
Classes
InvalidAddressLengthError
Defined in: src/primitives/BinaryTree/errors.js:19 Error thrown when an invalid address length is providedExample
Extends
Constructors
Constructor
new InvalidAddressLengthError(Defined in: src/primitives/BinaryTree/errors.js:30message?,options?):InvalidAddressLengthError
Parameters
message?
string
options?
cause?
Error
code?
string
context?
Record<string, unknown>
docsPath?
string
expected?
string
value?
unknown
Returns
InvalidAddressLengthError
Overrides
InvalidLengthError.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
InvalidLengthError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
InvalidLengthError.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
InvalidLengthError.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
InvalidLengthError.docsPath
expected
expected: string
Defined in: src/primitives/errors/ValidationError.ts:19
Inherited from
InvalidLengthError.expected
name
name: string
Defined in: src/primitives/BinaryTree/errors.js:41
Inherited from
InvalidLengthError.name
value
value: unknown
Defined in: src/primitives/errors/ValidationError.ts:18
Inherited from
InvalidLengthError.value
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
InvalidLengthError.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
InvalidLengthError.toJSON
InvalidKeyLengthError
Defined in: src/primitives/BinaryTree/errors.js:61 Error thrown when an invalid key length is providedExample
Extends
Constructors
Constructor
new InvalidKeyLengthError(Defined in: src/primitives/BinaryTree/errors.js:72message?,options?):InvalidKeyLengthError
Parameters
message?
string
options?
cause?
Error
code?
string
context?
Record<string, unknown>
docsPath?
string
expected?
string
value?
unknown
Returns
InvalidKeyLengthError
Overrides
InvalidLengthError.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
InvalidLengthError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
InvalidLengthError.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
InvalidLengthError.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
InvalidLengthError.docsPath
expected
expected: string
Defined in: src/primitives/errors/ValidationError.ts:19
Inherited from
InvalidLengthError.expected
name
name: string
Defined in: src/primitives/BinaryTree/errors.js:82
Inherited from
InvalidLengthError.name
value
value: unknown
Defined in: src/primitives/errors/ValidationError.ts:18
Inherited from
InvalidLengthError.value
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
InvalidLengthError.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
InvalidLengthError.toJSON
InvalidTreeStateError
Defined in: src/primitives/BinaryTree/errors.js:102 Error thrown when tree is in invalid stateExample
Extends
Constructors
Constructor
new InvalidTreeStateError(Defined in: src/primitives/BinaryTree/errors.js:113message?,options?):InvalidTreeStateError
Parameters
message?
string
options?
cause?
Error
code?
string
context?
Record<string, unknown>
docsPath?
string
expected?
string
value?
unknown
Returns
InvalidTreeStateError
Overrides
ValidationError.constructor
Properties
cause?
Defined in: src/primitives/errors/AbstractError.ts:56 Root cause of this error (for error chaining)optionalcause:Error
Inherited from
ValidationError.cause
code
code: string
Defined in: src/primitives/errors/AbstractError.ts:39
Machine-readable error code for programmatic handling
Example
Inherited from
ValidationError.code
context?
Defined in: src/primitives/errors/AbstractError.ts:45 Additional context metadata for debuggingoptionalcontext:Record<string,unknown>
Example
Inherited from
ValidationError.context
docsPath?
Defined in: src/primitives/errors/AbstractError.ts:51 Path to documentation for this erroroptionaldocsPath:string
Example
Inherited from
ValidationError.docsPath
expected
expected: string
Defined in: src/primitives/errors/ValidationError.ts:19
Inherited from
ValidationError.expected
name
name: string
Defined in: src/primitives/BinaryTree/errors.js:122
Inherited from
ValidationError.name
value
value: unknown
Defined in: src/primitives/errors/ValidationError.ts:18
Inherited from
ValidationError.value
Methods
getErrorChain()
getErrorChain(): string
Defined in: src/primitives/errors/AbstractError.ts:94
Get full error chain as string for logging
Returns
string
Inherited from
ValidationError.getErrorChain
toJSON()
toJSON():Defined in: src/primitives/errors/AbstractError.ts:110 Serialize error to JSON for logging/telemetryRecord<string,unknown>
Returns
Record<string, unknown>
Inherited from
ValidationError.toJSON
Interfaces
AccountData
Defined in: src/primitives/BinaryTree/BinaryTreeType.ts:37 Account basic data layout at index 0- Version (1 byte)
- Code size (3 bytes)
- Nonce (8 bytes)
- Balance (16 bytes)
Properties
balance
Defined in: src/primitives/BinaryTree/BinaryTreeType.ts:41readonlybalance:bigint
codeSize
Defined in: src/primitives/BinaryTree/BinaryTreeType.ts:39readonlycodeSize:number
nonce
Defined in: src/primitives/BinaryTree/BinaryTreeType.ts:40readonlynonce:bigint
version
Defined in: src/primitives/BinaryTree/BinaryTreeType.ts:38readonlyversion:number
BinaryTreeType
Defined in: src/primitives/BinaryTree/BinaryTreeType.ts:7 Binary State Tree (EIP-7864) - Unified tree structure for Ethereum stateSee
https://eips.ethereum.org/EIPS/eip-7864Properties
root
Defined in: src/primitives/BinaryTree/BinaryTreeType.ts:8readonlyroot:Node
Type Aliases
EmptyNode
EmptyNode =Defined in: src/primitives/BinaryTree/BinaryTreeType.ts:28Extract<Node, {type:"empty"; }>
InternalNode
InternalNode =Defined in: src/primitives/BinaryTree/BinaryTreeType.ts:25Extract<Node, {type:"internal"; }>
LeafNode
LeafNode =Defined in: src/primitives/BinaryTree/BinaryTreeType.ts:27Extract<Node, {type:"leaf"; }>
Node
Node = {Defined in: src/primitives/BinaryTree/BinaryTreeType.ts:11type:"empty"; } | {left:Uint8Array;right:Uint8Array;type:"internal"; } | {stem:Uint8Array;type:"stem";values: (Uint8Array|null)[]; } | {type:"leaf";value:Uint8Array; }
StemNode
StemNode =Defined in: src/primitives/BinaryTree/BinaryTreeType.ts:26Extract<Node, {type:"stem"; }>
Variables
addressToKey()
Defined in: src/primitives/BinaryTree/index.ts:56constaddressToKey: (address) =>Uint8Array=_addressToKey
Parameters
address
Uint8Array
Returns
Uint8Array
BinaryTree
Defined in: src/primitives/BinaryTree/index.ts:76constBinaryTree:object
Type Declaration
addressToKey()
addressToKey: (address) =>Uint8Array
Parameters
address
Uint8Array
Returns
Uint8Array
get()
get: (tree,key) =>Uint8Array<ArrayBufferLike> |null
Parameters
tree
BinaryTreeType
key
Uint8Array
Returns
Uint8Array<ArrayBufferLike> | null
getStemBit()
getStemBit: (stem,index) =>0|1
Parameters
stem
Uint8Array
index
number
Returns
0 | 1
hashInternal()
hashInternal: (l,r) =>Uint8Array
Parameters
l
Uint8Array
r
Uint8Array
Returns
Uint8Array
hashLeaf()
hashLeaf: (node) =>Uint8Array
Parameters
node
type
"leaf"
value
Uint8Array
Returns
Uint8Array
hashNode()
hashNode: (node) =>Uint8Array
Parameters
node
Node
Returns
Uint8Array
hashStem()
hashStem: (node) =>Uint8Array
Parameters
node
stem
Uint8Array
type
"stem"
values
(Uint8Array<ArrayBufferLike> | null)[]
Returns
Uint8Array
init()
init: () => BinaryTreeType
Returns
BinaryTreeType
insert()
insert: (tree,key,value) =>BinaryTreeType
Parameters
tree
BinaryTreeType
key
Uint8Array
value
Uint8Array
Returns
BinaryTreeType
rootHash()
rootHash: (tree) =>Uint8Array
Parameters
tree
BinaryTreeType
Returns
Uint8Array
rootHashHex()
rootHashHex: (tree) =>HexType
Parameters
tree
BinaryTreeType
Returns
HexType
splitKey()
splitKey: (key) =>object
Parameters
key
Uint8Array
Returns
object
idx
idx: number
stem
stem: Uint8Array
get()
Defined in: src/primitives/BinaryTree/index.ts:67constget: (tree,key) =>Uint8Array|null=_get
Parameters
tree
BinaryTreeType
key
Uint8Array
Returns
Uint8Array | null
getStemBit()
Defined in: src/primitives/BinaryTree/index.ts:59constgetStemBit: (stem,index) =>0|1=_getStemBit
Parameters
stem
Uint8Array
index
number
Returns
0 | 1
hashInternal()
Defined in: src/primitives/BinaryTree/index.ts:49consthashInternal: (l,r) =>Uint8Array
Parameters
l
Uint8Array
r
Uint8Array
Returns
Uint8Array
HashInternal()
Defined in: src/primitives/BinaryTree/index.ts:38constHashInternal: (deps) => (l,r) =>Uint8Array=_HashInternal
Parameters
deps
Blake3Deps
Returns
(l,r):Uint8Array
Parameters
l
Uint8Array
r
Uint8Array
Returns
Uint8Array
hashLeaf()
Defined in: src/primitives/BinaryTree/index.ts:52consthashLeaf: (node) =>Uint8Array
Parameters
node
LeafNode
Returns
Uint8Array
HashLeaf()
Defined in: src/primitives/BinaryTree/index.ts:43constHashLeaf: (deps) => (node) =>Uint8Array=_HashLeaf
Parameters
deps
Blake3Deps
Returns
(node):Uint8Array
Parameters
node
LeafNode
Returns
Uint8Array
hashNode()
Defined in: src/primitives/BinaryTree/index.ts:53consthashNode: (node) =>Uint8Array
Parameters
node
Node
Returns
Uint8Array
HashNode()
Defined in: src/primitives/BinaryTree/index.ts:45constHashNode: (deps) => (node) =>Uint8Array=_HashNode
Parameters
deps
Blake3Deps
Returns
(node):Uint8Array
Parameters
node
Node
Returns
Uint8Array
hashStem()
Defined in: src/primitives/BinaryTree/index.ts:51consthashStem: (node) =>Uint8Array
Parameters
node
StemNode
Returns
Uint8Array
HashStem()
Defined in: src/primitives/BinaryTree/index.ts:41constHashStem: (deps) => (node) =>Uint8Array=_HashStem
Parameters
deps
Blake3Deps
Returns
(node):Uint8Array
Parameters
node
StemNode
Returns
Uint8Array
init()
Defined in: src/primitives/BinaryTree/index.ts:61constinit: () =>BinaryTreeType=_init
Returns
BinaryTreeType
insert()
Defined in: src/primitives/BinaryTree/index.ts:62constinsert: (tree,key,value) =>BinaryTreeType
Parameters
tree
BinaryTreeType
key
Uint8Array
value
Uint8Array
Returns
BinaryTreeType
rootHash()
Defined in: src/primitives/BinaryTree/index.ts:71constrootHash: (tree) =>Uint8Array=_rootHash
Parameters
tree
BinaryTreeType
Returns
Uint8Array
rootHashHex()
Defined in: src/primitives/BinaryTree/index.ts:72constrootHashHex: (tree) =>HexType=_rootHashHex
Parameters
tree
BinaryTreeType
Returns
HexType
splitKey()
Defined in: src/primitives/BinaryTree/index.ts:57constsplitKey: (key) =>object=_splitKey
Parameters
key
Uint8Array
Returns
object
idx
idx: number
stem
stem: Uint8Array

