@tevm/voltaire / primitives/BundleHash
primitives/BundleHash
Classes
InvalidBundleHashError
Defined in: src/primitives/BundleHash/errors.js:4 Error thrown when BundleHash operations failExtends
Error
Constructors
Constructor
new InvalidBundleHashError(Defined in: src/primitives/BundleHash/errors.js:9message,details?):InvalidBundleHashError
Parameters
message
string
Error message
details?
Record<string, unknown>
Error details
Returns
InvalidBundleHashError
Overrides
Error.constructor
Properties
details
details:Defined in: src/primitives/BundleHash/errors.js:12Record<string,unknown> |undefined
name
name: string
Defined in: src/primitives/BundleHash/errors.js:11
Inherited from
Error.name
Type Aliases
BundleHashLike
BundleHashLike =Defined in: src/primitives/BundleHash/BundleHashType.ts:22 Inputs that can be converted to BundleHashBundleHashType|string|Uint8Array
BundleHashType
BundleHashType =Defined in: src/primitives/BundleHash/BundleHashType.ts:14 BundleHash type Unique identifier for a transaction bundle. Computed as keccak256 of the bundle contents (concatenated transaction hashes). Used to track bundle status through MEV relays and block builders.Uint8Array&object
Type Declaration
[brand]
readonly[brand]:"BundleHash"
length
readonlylength:32
See
- https://voltaire.tevm.sh/primitives/bundle-hash for BundleHash documentation
- https://docs.flashbots.net/flashbots-auction/overview for Flashbots Auction
Since
0.0.0Variables
SIZE
Defined in: src/primitives/BundleHash/BundleHashType.ts:24constSIZE:32=32
Functions
equals()
equals(Defined in: src/primitives/BundleHash/equals.js:17 Checks if two BundleHashes are equala,b):boolean
Parameters
a
BundleHashType
First hash
b
BundleHashType
Second hash
Returns
boolean
True if hashes are equal
Example
from()
from(Defined in: src/primitives/BundleHash/from.js:21 Creates a BundleHash from various input typesvalue):BundleHashType
Parameters
value
BundleHashLike
BundleHash input (hex string or bytes)
Returns
BundleHashType
BundleHash instance
Throws
If input format is invalidExample
fromBundle()
fromBundle(Defined in: src/primitives/BundleHash/fromBundle.js:20 Computes BundleHash from a Bundlebundle,crypto):BundleHashType
Parameters
bundle
BundleType
Bundle instance
crypto
Crypto dependencieskeccak256
(data) => Uint8Array
Keccak256 function
Returns
BundleHashType
Bundle hash
Example
fromHex()
fromHex(Defined in: src/primitives/BundleHash/fromHex.js:20 Creates BundleHash from hex stringvalue):BundleHashType
Parameters
value
string
Hex string (with or without 0x prefix)
Returns
BundleHashType
BundleHash instance
Throws
If hex format is invalidExample
toHex()
toHex(Defined in: src/primitives/BundleHash/toHex.js:17 Converts BundleHash to hex stringhash):string
Parameters
hash
BundleHashType
BundleHash instance
Returns
string
Hex string with 0x prefix

