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

primitives/BuilderBid

Classes

InvalidBuilderBidError

Defined in: src/primitives/BuilderBid/errors.js:6 Error thrown when BuilderBid operations fail

Extends

  • Error

Constructors

Constructor
new InvalidBuilderBidError(message, details): InvalidBuilderBidError
Defined in: src/primitives/BuilderBid/errors.js:7
Parameters
message
any
details
any
Returns
InvalidBuilderBidError
Overrides
Error.constructor

Properties

details
details: any
Defined in: src/primitives/BuilderBid/errors.js:10
name
name: string
Defined in: src/primitives/BuilderBid/errors.js:9
Inherited from
Error.name

Type Aliases

BuilderBidHex

BuilderBidHex = object
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:102 BuilderBid with hex strings (common in RPC responses)

Properties

block_hash
readonly block_hash: string
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:105
builder_pubkey
readonly builder_pubkey: string
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:106
gas_limit
readonly gas_limit: string
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:109
gas_used
readonly gas_used: string
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:110
parent_hash
readonly parent_hash: string
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:104
proposer_fee_recipient
readonly proposer_fee_recipient: string
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:108
proposer_pubkey
readonly proposer_pubkey: string
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:107
signature
readonly signature: string
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:112
slot
readonly slot: string
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:103
value
readonly value: string
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:111

BuilderBidLike

BuilderBidLike = BuilderBidType | { blockHash: HashType | string | Uint8Array; builderPubkey: Uint8Array | string; gasLimit: Type | bigint | number | string; gasUsed: Type | bigint | number | string; parentHash: HashType | string | Uint8Array; proposerFeeRecipient: AddressType | string; proposerPubkey: Uint8Array | string; signature: Uint8Array | string; slot: SlotType | bigint | number | string; value: Type | bigint | number | string; }
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:84 Inputs that can be converted to BuilderBid

BuilderBidType

BuilderBidType = object
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:19 BuilderBid type Represents a block builder bid in Proposer-Builder Separation (PBS). Block builders compete to provide the most valuable block to validators through MEV-Boost relays. The bid includes the proposed block details, value offered to the proposer, and cryptographic signatures.

See

Since

0.0.0

Properties

blockHash
readonly blockHash: HashType
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:36 Proposed block hash Hash of the block being bid on
builderPubkey
readonly builderPubkey: Uint8Array
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:42 Builder’s BLS public key (48 bytes) Identity of the block builder
gasLimit
readonly gasLimit: Type
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:60 Block gas limit Maximum gas allowed in the proposed block
gasUsed
readonly gasUsed: Type
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:66 Gas used in block Actual gas consumed by transactions
parentHash
readonly parentHash: HashType
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:30 Parent block hash The block being built on top of
proposerFeeRecipient
readonly proposerFeeRecipient: AddressType
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:54 Fee recipient address Where block rewards and tips are sent
proposerPubkey
readonly proposerPubkey: Uint8Array
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:48 Proposer’s BLS public key (48 bytes) Identity of the validator proposing this slot
signature
readonly signature: Uint8Array
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:78 Builder’s BLS signature (96 bytes) Cryptographic proof of bid authenticity
slot
readonly slot: SlotType
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:24 Beacon chain slot number for this bid Each slot is 12 seconds
value
readonly value: Type
Defined in: src/primitives/BuilderBid/BuilderBidType.ts:72 Bid value to proposer (in wei) Amount builder pays validator for block inclusion

Functions

from()

from(value): BuilderBidType
Defined in: src/primitives/BuilderBid/from.js:73 Creates a BuilderBid from various input types

Parameters

value
BuilderBidLike BuilderBid input

Returns

BuilderBidType BuilderBid instance

Throws

If bid format is invalid

Example

import * as BuilderBid from './BuilderBid/index.js';
const bid = BuilderBid.from({
  slot: 123456n,
  parentHash: "0x...",
  blockHash: "0x...",
  builderPubkey: builderKey,
  proposerPubkey: proposerKey,
  proposerFeeRecipient: feeRecipient,
  gasLimit: 30000000n,
  gasUsed: 25000000n,
  value: 1000000000000000000n,
  signature: signature,
});

getValue()

getValue(bid): bigint
Defined in: src/primitives/BuilderBid/getValue.js:19 Gets the bid value in wei

Parameters

bid
BuilderBidType BuilderBid instance

Returns

bigint Bid value in wei

Example

import * as BuilderBid from './BuilderBid/index.js';
const value = BuilderBid.getValue(bid);
console.log(`Bid: ${value} wei`);

toHex()

toHex(bid): BuilderBidHex
Defined in: src/primitives/BuilderBid/toHex.js:32 Converts BuilderBid to hex representation (RPC format)

Parameters

bid
BuilderBidType BuilderBid instance

Returns

BuilderBidHex BuilderBid with hex strings

Example

import * as BuilderBid from './BuilderBid/index.js';
const hexBid = BuilderBid.toHex(bid);

verify()

verify(bid, crypto): boolean
Defined in: src/primitives/BuilderBid/verify.js:22 Verifies the builder’s BLS signature on the bid

Parameters

bid
BuilderBidType BuilderBid instance
crypto
Crypto dependencies
blsVerify
(pubkey, message, signature) => boolean BLS verification function

Returns

boolean True if signature is valid

Example

import * as BuilderBid from './BuilderBid/index.js';
import { blsVerify } from './crypto/bls.js';
const valid = BuilderBid.verify(bid, { blsVerify });
console.log(`Signature valid: ${valid}`);