@tevm/voltaire / primitives/Bundle
primitives/Bundle
Classes
InvalidBundleError
Defined in: src/primitives/Bundle/errors.js:6 Error thrown when bundle operations failExtends
Error
Constructors
Constructor
new InvalidBundleError(Defined in: src/primitives/Bundle/errors.js:7message,details):InvalidBundleError
Parameters
message
any
details
any
Returns
InvalidBundleError
Overrides
Error.constructor
Properties
details
details: any
Defined in: src/primitives/Bundle/errors.js:10
name
name: string
Defined in: src/primitives/Bundle/errors.js:9
Inherited from
Error.name
Type Aliases
BundleLike
BundleLike =Defined in: src/primitives/Bundle/BundleType.ts:53 Inputs that can be converted to BundleBundleType| {blockNumber?:BlockNumberType|bigint|number|string;maxTimestamp?:Type|bigint|number|string;minTimestamp?:Type|bigint|number|string;revertingTxHashes?: (HashType|string)[];transactions: (Uint8Array|string)[]; }
BundleType
BundleType = object
Defined in: src/primitives/Bundle/BundleType.ts:17
Bundle type
Represents a transaction bundle for MEV (Maximal Extractable Value) strategies.
Bundles are atomic collections of transactions submitted to block builders via
MEV relays like Flashbots. All transactions in a bundle execute sequentially
in the same block or the bundle is discarded.
See
- https://voltaire.tevm.sh/primitives/bundle for Bundle documentation
- https://docs.flashbots.net/flashbots-auction/overview for Flashbots Auction
Since
0.0.0Properties
blockNumber?
Defined in: src/primitives/Bundle/BundleType.ts:28 Target block number for bundle inclusion (optional) If specified, bundle is only valid for this blockreadonlyoptionalblockNumber:BlockNumberType
maxTimestamp?
Defined in: src/primitives/Bundle/BundleType.ts:40 Maximum block timestamp for bundle inclusion (optional) Bundle will not be included after this timestampreadonlyoptionalmaxTimestamp:Type
minTimestamp?
Defined in: src/primitives/Bundle/BundleType.ts:34 Minimum block timestamp for bundle inclusion (optional) Bundle will not be included before this timestampreadonlyoptionalminTimestamp:Type
revertingTxHashes?
Defined in: src/primitives/Bundle/BundleType.ts:47 Transaction hashes allowed to revert (optional) If any other transaction reverts, entire bundle is discarded If a hash in this array reverts, bundle continues executionreadonlyoptionalrevertingTxHashes: readonlyHashType[]
transactions
Defined in: src/primitives/Bundle/BundleType.ts:22 Ordered array of signed transaction bytes All transactions execute sequentially in this orderreadonlytransactions: readonlyUint8Array[]
Functions
addTransaction()
addTransaction(Defined in: src/primitives/Bundle/addTransaction.js:19 Adds a transaction to the bundlebundle,transaction):BundleType
Parameters
bundle
BundleType
Bundle instance
transaction
Signed transaction to addstring | Uint8Array<ArrayBufferLike>
Returns
BundleType
New bundle with added transaction
Example
from()
from(Defined in: src/primitives/Bundle/from.js:25 Creates a Bundle from various input typesvalue):BundleType
Parameters
value
BundleLike
Bundle input
Returns
BundleType
Bundle instance
Throws
If bundle format is invalidExample
size()
size(Defined in: src/primitives/Bundle/size.js:19 Returns the number of transactions in the bundlebundle):number
Parameters
bundle
BundleType
Bundle instance
Returns
number
Number of transactions
Example
toFlashbotsParams()
toFlashbotsParams(Defined in: src/primitives/Bundle/toFlashbotsParams.js:19 Converts bundle to Flashbots RPC parametersbundle):object
Parameters
bundle
BundleType
Bundle instance
Returns
object
Flashbots eth_sendBundle parameters
Example
toHash()
toHash(Defined in: src/primitives/Bundle/toHash.js:22 Computes the bundle hash (keccak256 of bundle contents)bundle,crypto):HashType
Parameters
bundle
BundleType
Bundle instance
crypto
Crypto dependencieskeccak256
(data) => Uint8Array
Keccak256 function
Returns
HashType
Bundle hash

